Bug 947336, part 1 - Make nsXPCWrappedJS::mOuter into a smart pointer. r=bholley
Bug 947336, part 2 - Make nsXPCWrappedJS::mClass a smart pointer. r=bholley
Bug 947336, part 3 - Add comment about ownership of nsXPCWrappedJS::mRoot. r=bholley
Bug 952660, part 1 - Use smart pointer for clazz in nsXPCWrappedJS::GetNewOrUsed. r=bholley

The trickiest thing the goto in GetNewOrUsed does is release clazz in some cases,
so using a smart pointer will simplify things.
Bug 952660, part 2 - Take advantage of new being infallible in nsXPCWrappedJS::GetNewOrUsed. r=bholley
Bug 952660, part 3 - Eliminate goto return_wrapper. r=bholley

Substitute in the tail of the function for each goto, then eliminate
the resulting branches where possible.
Bug 952660, part 4 - Eliminate now-unnecessary null check in nsXPCWrappedJS::GetNewOrUsed. r=bholley
Bug 952660, part 5 - The null check at the end of nsXPCWrappedJS::GetNewOrUsed will always fail. r=bholley
Bug 952660, part 6 - Add and use nsXPCWrappedJS::FindOrFindInherited. r=bholley

FindInherited is only ever used after running Find, and the way the checks
are chained is a little weird.
Bug 952660, part 7 - Replace if with else in nsXPCWrappedJS::GetNewOrUsed. r=bholley

We check for root, then don't change root and check for !root, so this can just be
an else.
Bug 952660, part 8 - Insert non-root wrappers into the list in the constructor for nsXPCWrappedJS. r=bholley

A non-root wrapper has to be inserted into the list. There's only one place this is needed, but I
think it makes more sense like this.
Bug 952660, part 9 - rename clazz to clasp in nsXPCWrappedJS::GetNewOrUsed. r=bholley