Bug 939608 - Build xpconnect in unified mode; r=bholley
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 18 Nov 2013 00:47:30 -0500
changeset 155139 161bfee3f57a0a113e7078c23c9ac9c00f8509b6
parent 155138 18d9216b667739372d9d274ecfe4d131979f7452
child 155140 21df28ade757662e6ad8e5dabb02b5422f73372d
push id36256
push usereakhgari@mozilla.com
push dateMon, 18 Nov 2013 05:48:23 +0000
treeherdermozilla-inbound@161bfee3f57a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs939608
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 939608 - Build xpconnect in unified mode; r=bholley
js/xpconnect/loader/moz.build
js/xpconnect/loader/mozJSComponentLoader.h
js/xpconnect/src/XPCJSID.cpp
js/xpconnect/src/moz.build
js/xpconnect/tests/components/native/moz.build
js/xpconnect/wrappers/XrayWrapper.h
js/xpconnect/wrappers/moz.build
--- a/js/xpconnect/loader/moz.build
+++ b/js/xpconnect/loader/moz.build
@@ -1,17 +1,17 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'jsloader'
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'mozJSComponentLoader.cpp',
     'mozJSLoaderUtils.cpp',
     'mozJSSubScriptLoader.cpp',
 ]
 
 LIBRARY_NAME = 'jsloader_s'
 
 EXTRA_JS_MODULES += [
--- a/js/xpconnect/loader/mozJSComponentLoader.h
+++ b/js/xpconnect/loader/mozJSComponentLoader.h
@@ -1,14 +1,17 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifndef mozJSComponentLoader_h
+#define mozJSComponentLoader_h
+
 #include "mozilla/ModuleLoader.h"
 #include "nsISupports.h"
 #include "nsIObserver.h"
 #include "xpcIJSModuleLoader.h"
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.h"
 #include "jsapi.h"
 
@@ -137,8 +140,10 @@ class mozJSComponentLoader : public mozi
 
     nsClassHashtable<nsCStringHashKey, ModuleEntry> mImports;
     nsDataHashtable<nsCStringHashKey, ModuleEntry*> mInProgressImports;
     nsDataHashtable<nsPtrHashKey<JSScript>, JSObject*> mThisObjects;
 
     bool mInitialized;
     bool mReuseLoaderGlobal;
 };
+
+#endif /* mozJSComponentLoader_h */
--- a/js/xpconnect/src/XPCJSID.cpp
+++ b/js/xpconnect/src/XPCJSID.cpp
@@ -820,17 +820,17 @@ nsJSCID::Construct(nsIXPConnectWrappedNa
 {
     RootedObject obj(cx, objArg);
     XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
     if (!rt)
         return NS_ERROR_FAILURE;
 
     // 'push' a call context and call on it
     RootedId name(cx, rt->GetStringID(XPCJSRuntime::IDX_CREATE_INSTANCE));
-    XPCCallContext ccx(JS_CALLER, cx, obj, NullPtr(), name, args.length(), args.array(),
+    XPCCallContext ccx(JS_CALLER, cx, obj, js::NullPtr(), name, args.length(), args.array(),
                        args.rval().address());
 
     *_retval = XPCWrappedNative::CallMethod(ccx);
     return NS_OK;
 }
 
 /* bool hasInstance (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval val, out bool bp); */
 NS_IMETHODIMP
--- a/js/xpconnect/src/moz.build
+++ b/js/xpconnect/src/moz.build
@@ -10,17 +10,17 @@ EXPORTS += [
     'BackstagePass.h',
     'nsCxPusher.h',
     'qsObjectHelper.h',
     'XPCJSMemoryReporter.h',
     'xpcObjectHelper.h',
     'xpcpublic.h',
 ]
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'nsCxPusher.cpp',
     'nsScriptError.cpp',
     'nsXPConnect.cpp',
     'Sandbox.cpp',
     'XPCCallContext.cpp',
     'XPCComponents.cpp',
     'XPCContext.cpp',
     'XPCConvert.cpp',
--- a/js/xpconnect/tests/components/native/moz.build
+++ b/js/xpconnect/tests/components/native/moz.build
@@ -2,17 +2,17 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'xpctest'
 NO_DIST_INSTALL = True
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'xpctest_attributes.cpp',
     'xpctest_module.cpp',
     'xpctest_params.cpp',
 ]
 
 LIBRARY_NAME = 'xpctest'
 
 IS_COMPONENT = True
--- a/js/xpconnect/wrappers/XrayWrapper.h
+++ b/js/xpconnect/wrappers/XrayWrapper.h
@@ -1,15 +1,18 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=4 sw=4 et tw=99 ft=cpp:
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifndef __XrayWrapper_h__
+#define __XrayWrapper_h__
+
 #include "mozilla/Attributes.h"
 
 #include "jswrapper.h"
 
 // Xray wrappers re-resolve the original native properties on the native
 // object and always directly access to those properties.
 // Because they work so differently from the rest of the wrapper hierarchy,
 // we pull them out of the Wrapper inheritance hierarchy and create a
@@ -185,8 +188,9 @@ private:
     JS::HandleId mId;
     JS::RootedObject mHolder;
     ResolvingId *mPrev;
     bool mXrayShadowing;
 };
 
 }
 
+#endif /* __XrayWrapper_h__ */
--- a/js/xpconnect/wrappers/moz.build
+++ b/js/xpconnect/wrappers/moz.build
@@ -5,22 +5,26 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'xpcwrappers'
 
 EXPORTS += [
     'WrapperFactory.h',
 ]
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'AccessCheck.cpp',
     'ChromeObjectWrapper.cpp',
     'FilteringWrapper.cpp',
     'WaiveXrayWrapper.cpp',
     'WrapperFactory.cpp',
+]
+
+# XrayWrapper needs to be built separately because of template instantiations.
+SOURCES += [
     'XrayWrapper.cpp',
 ]
 
 LIBRARY_NAME = 'xpcwrappers_s'
 
 # warning C4661 for FilteringWrapper
 FAIL_ON_WARNINGS = not CONFIG['_MSC_VER']