Bug 797821 - Remove the dependency of XPCWrappedNativeScope instantiation on XPCCallContext and expose the raw constructor. r=mrbkap
Bug 797821 - Remove CreateNewGlobal. r=mrbkap

It doesn't do anything useful at this point.
Bug 797821 - Simplify the call signature for XPC::CreateGlobalObject. r=mrbkap
Bug 797821 - Loosen the CompartmentPrivate contract so that having one does not imply being in the compartment set. r=mrbkap

The compartment set goes away in later patches anyway. This is to allow us to
create compartment privates for things like XUL prototype document globals
without having to put them in the set and trace expandos and such.
Bug 797821 - Stop passing wantXrays directly to CreateGlobalObject. r=mrbkap

This can happen after the fact where it needs to.
Bug 797821 - Allow compartment privates to be lazily created when using them just for storing about:memory URIs. r=mrbkap

This will allow us to stop making nsXULPrototypeDocument and nsXBLDocumentInfo
globals XPConnect globals.
Bug 797821 - Stop making nsXBLDocumentInfo and nsXULPrototypeDocument globals with XPConnect. r=mrbkap

We already weren't creating a scope for them. They're generally pretty isolated
and are just used for holding functions that get cloned into other scopes.
Apparently mccr8 once found an edge from an nsXULPrototypeDocument scope into
another scope, but I don't think that should really break anything.
Bug 797821 - Stop storing mScriptObjectPrincipal. r=mrbkap
Bug 797821 - Remove unused aNative parameter to XPCWrappedNativeScope creation. r=mrbkap
Bug 797821 - Remove xpc_NewSystemInheritingJSObject and cached mJSPrototypeObject. r=mrbkap

xpc_NewSystemInheritingJSObject is totally unnecessary now that the system bit
has been removed (\o/). Furthermore, the mJSPrototypeObject optimization is
really dumb. it complicates tracing significantly, and we don't actually use it
in any critical places: XPCWrappedNative and slim wrapper creation use a different
prototype, so this is used only for the creation of tearoff reflectors (seldom/
never used), XPCWrappedNativeProto objects, and the nohelper prototype on the
scope (once per scope).

We could actually just pass NULL to JS_NewObject and let it deal. However, this
would actually trigger a dynamic lookup for the prototype object of the
associated JSClass, which isn't what we want. So we just explicitly pass in
Object.prototype.
Bug 797821 - Create XPCWrappedNativeScopes immediately after global creation. r=mrbkap
Bug 797821 - Replace usage of XPCWrappedNativeScope::FindInJSObjectScope(ccx, obj) with GetObjectScope(obj). r=mrbkap
Bug 797821 - Remove FindInJSObjectScope and friends. r=mrbkap

\o/
Bug 797821 - Don't pass XPCONNECT_GLOBAL_FLAGS for xbl and xul document gSharedGlobalClass. r=mrbkap

A lot of these flags don't make sense in this context.
Bug 797821 - Decide whether we need to trace DOM stuff based on more relevant information than JSCLASS_XPCONNECT_GLOBAL. r=mrbkap

This will let us rip out that flag.
Bug 797821 - Remove JSCLASS_XPCONNECT_GLOBAL flag. r=mrbkap
Bug 797821 - Removed the unused reserved slot for XPConnect globals. r=mrbkap
Bug 797821 - Hoist XPConnect-y stuff out of the compartment private and into the XPCWrappedNativeScope. r=mrbkap

This change means we no longer have to keep around a set of XPConnect compartments.
We keep the compartment private around for non-xpconnecty stuff like about:memory
instrumentation that needs to happen on non-xpconnect compartments.
Bug 797821 - Remove the XPConnect Compartment Set. r=mrbkap
Bug 797821 - Address Ms2ger's review comments. r=me