Bug 940235 - Build uriloader in unified mode. r=ehsan
authorChris Peterson <cpeterson@mozilla.com>
Mon, 18 Nov 2013 23:50:59 -0800
changeset 158167 d4c8a4014d61f7ce7371a03aace74d51badd8f28
parent 158166 253684653c74ab14fc6fa73bd5b1b3cfb8c943f6
child 158168 a6f1b8a182edbe13c2cbda2da8baff169c2488c3
push id3735
push userryanvm@gmail.com
push dateMon, 02 Dec 2013 15:40:19 +0000
treeherderfx-team@2581b84e0ca1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs940235
milestone28.0a1
Bug 940235 - Build uriloader in unified mode. r=ehsan
uriloader/base/moz.build
uriloader/exthandler/ExternalHelperAppChild.h
uriloader/exthandler/moz.build
uriloader/exthandler/unix/nsGNOMERegistry.h
uriloader/prefetch/OfflineCacheUpdateChild.cpp
uriloader/prefetch/OfflineCacheUpdateGlue.cpp
uriloader/prefetch/OfflineCacheUpdateParent.cpp
uriloader/prefetch/moz.build
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
uriloader/prefetch/nsPrefetchService.cpp
--- a/uriloader/base/moz.build
+++ b/uriloader/base/moz.build
@@ -18,17 +18,17 @@ XPIDL_SOURCES += [
 
 XPIDL_MODULE = 'uriloader'
 
 EXPORTS += [
     'nsDocLoader.h',
     'nsURILoader.h',
 ]
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'nsDocLoader.cpp',
     'nsURILoader.cpp',
 ]
 
 FAIL_ON_WARNINGS = True
 
 MSVC_ENABLE_PGO = True
 
--- a/uriloader/exthandler/ExternalHelperAppChild.h
+++ b/uriloader/exthandler/ExternalHelperAppChild.h
@@ -1,14 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* 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 mozilla_dom_ExternalHelperAppChild_h
+#define mozilla_dom_ExternalHelperAppChild_h
 
 #include "mozilla/dom/PExternalHelperAppChild.h"
 #include "nsIStreamListener.h"
 
 namespace mozilla {
 namespace dom {
 
 class ExternalHelperAppChild : public PExternalHelperAppChild
@@ -29,8 +31,10 @@ public:
     virtual bool RecvCancel(const nsresult& aStatus);
 private:
     nsCOMPtr<nsIStreamListener> mHandler;
     nsresult mStatus;
 };
 
 } // namespace dom
 } // namespace mozilla
+
+#endif // mozilla_dom_ExternalHelperAppChild_h
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -51,74 +51,84 @@ if CONFIG['MOZ_ENABLE_MEEGOTOUCHSHARE']:
         osdir + '/nsExternalSharingAppService.h',
     ]
 
 EXPORTS.mozilla.dom += [
     'ExternalHelperAppChild.h',
     'ExternalHelperAppParent.h',
 ]
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'ExternalHelperAppChild.cpp',
     'ExternalHelperAppParent.cpp',
-    'nsExternalHelperAppService.cpp',
-    'nsExternalProtocolHandler.cpp',
     'nsLocalHandlerApp.cpp',
     'nsMIMEInfoImpl.cpp',
 ]
 
+# These files can't be built in unified mode because they force NSPR logging.
+SOURCES += [
+    'nsExternalHelperAppService.cpp',
+    'nsExternalProtocolHandler.cpp',
+]
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'mac/nsLocalHandlerAppMac.mm',
         'mac/nsMIMEInfoMac.mm',
+    ]
+    # These files can't be built in unified mode because they force NSPR logging.
+    SOURCES += [
         'mac/nsOSHelperAppService.mm',
     ]
 else:
+    # These files can't be built in unified mode because they force NSPR logging.
     SOURCES += [
         osdir + '/nsOSHelperAppService.cpp',
     ]
 
 if CONFIG['MOZ_ENABLE_GTK']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'unix/nsGNOMERegistry.cpp',
         'unix/nsMIMEInfoUnix.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'android/nsAndroidHandlerApp.cpp',
         'android/nsExternalSharingAppService.cpp',
         'android/nsExternalURLHandlerService.cpp',
         'android/nsMIMEInfoAndroid.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'unix/nsGNOMERegistry.cpp',
         'unix/nsMIMEInfoUnix.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+    # These files can't be built in unified mode because they force NSPR logging.
     SOURCES += [
         'win/nsMIMEInfoWin.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'os2':
+    # These files can't be built in unified mode because they force NSPR logging.
     SOURCES += [
         'os2/nsMIMEInfoOS2.cpp',
     ]
 
 if CONFIG['MOZ_ENABLE_DBUS']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'nsDBusHandlerApp.cpp',
     ]
 
 if CONFIG['MOZ_ENABLE_MEEGOTOUCHSHARE']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'unix/nsMeegoExternalSharingAppService.cpp',
     ]
 
 if CONFIG['MOZ_ENABLE_CONTENTACTION']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'nsContentHandlerApp.cpp',
     ]
 
 EXTRA_COMPONENTS += [
     'nsHandlerService.js',
     'nsHandlerService.manifest',
     'nsWebHandlerApp.js',
     'nsWebHandlerApp.manifest',
--- a/uriloader/exthandler/unix/nsGNOMERegistry.h
+++ b/uriloader/exthandler/unix/nsGNOMERegistry.h
@@ -1,12 +1,15 @@
 /* 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 nsGNOMERegistry_h
+#define nsGNOMERegistry_h
+
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 
 class nsMIMEInfoBase;
 
 class nsGNOMERegistry
 {
  public:
@@ -16,8 +19,10 @@ class nsGNOMERegistry
 
   static void GetAppDescForScheme(const nsACString& aScheme,
                                   nsAString& aDesc);
 
   static already_AddRefed<nsMIMEInfoBase> GetFromExtension(const nsACString& aFileExt);
 
   static already_AddRefed<nsMIMEInfoBase> GetFromType(const nsACString& aMIMEType);
 };
+
+#endif // nsGNOMERegistry_h
--- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp
@@ -42,18 +42,21 @@ using mozilla::dom::TabChild;
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables PR_LOG_ALWAYS level information and places all output in
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 #endif
+
 #undef LOG
 #define LOG(args) PR_LOG(gOfflineCacheUpdateLog, 4, args)
+
+#undef LOG_ENABLED
 #define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 namespace mozilla {
 namespace docshell {
 
 //-----------------------------------------------------------------------------
 // OfflineCacheUpdateChild::nsISupports
 //-----------------------------------------------------------------------------
--- a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp
@@ -21,17 +21,21 @@
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables PR_LOG_ALWAYS level information and places all output in
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 #endif
+
+#undef LOG
 #define LOG(args) PR_LOG(gOfflineCacheUpdateLog, 4, args)
+
+#undef LOG_ENABLED
 #define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 namespace mozilla {
 namespace docshell {
 
 //-----------------------------------------------------------------------------
 // OfflineCacheUpdateGlue::nsISupports
 //-----------------------------------------------------------------------------
--- a/uriloader/prefetch/OfflineCacheUpdateParent.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateParent.cpp
@@ -22,18 +22,21 @@ using mozilla::dom::TabParent;
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables PR_LOG_ALWAYS level information and places all output in
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 #endif
+
 #undef LOG
 #define LOG(args) PR_LOG(gOfflineCacheUpdateLog, 4, args)
+
+#undef LOG_ENABLED
 #define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 namespace mozilla {
 namespace docshell {
 
 //-----------------------------------------------------------------------------
 // OfflineCacheUpdateParent::nsISupports
 //-----------------------------------------------------------------------------
--- a/uriloader/prefetch/moz.build
+++ b/uriloader/prefetch/moz.build
@@ -15,25 +15,29 @@ EXPORTS += [
     'nsCPrefetchService.h',
 ]
 
 EXPORTS.mozilla.docshell += [
     'OfflineCacheUpdateChild.h',
     'OfflineCacheUpdateParent.h',
 ]
 
-SOURCES += [
-    'nsOfflineCacheUpdate.cpp',
-    'nsOfflineCacheUpdateService.cpp',
+UNIFIED_SOURCES += [
     'nsPrefetchService.cpp',
     'OfflineCacheUpdateChild.cpp',
     'OfflineCacheUpdateGlue.cpp',
     'OfflineCacheUpdateParent.cpp',
 ]
 
+# These files can't be built in unified mode because they force NSPR logging.
+SOURCES += [
+    'nsOfflineCacheUpdate.cpp',
+    'nsOfflineCacheUpdateService.cpp',
+]
+
 IPDL_SOURCES += [
     'POfflineCacheUpdate.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -64,17 +64,21 @@ static const int32_t  kCustomProfileQuot
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables PR_LOG_ALWAYS level information and places all output in
 // the file offlineupdate.log
 //
 extern PRLogModuleInfo *gOfflineCacheUpdateLog;
 #endif
+
+#undef LOG
 #define LOG(args) PR_LOG(gOfflineCacheUpdateLog, 4, args)
+
+#undef LOG_ENABLED
 #define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
 class AutoFreeArray {
 public:
     AutoFreeArray(uint32_t count, char **values)
         : mCount(count), mValues(values) {};
     ~AutoFreeArray() { NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mCount, mValues); }
 private:
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -64,30 +64,23 @@ typedef mozilla::docshell::OfflineCacheU
 //    set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5
 //    set NSPR_LOG_FILE=offlineupdate.log
 //
 // this enables PR_LOG_ALWAYS level information and places all output in
 // the file offlineupdate.log
 //
 PRLogModuleInfo *gOfflineCacheUpdateLog;
 #endif
+
 #undef LOG
 #define LOG(args) PR_LOG(gOfflineCacheUpdateLog, 4, args)
+
+#undef LOG_ENABLED
 #define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4)
 
-class AutoFreeArray {
-public:
-    AutoFreeArray(uint32_t count, char **values)
-        : mCount(count), mValues(values) {};
-    ~AutoFreeArray() { NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mCount, mValues); }
-private:
-    uint32_t mCount;
-    char **mValues;
-};
-
 namespace { // anon
 
 nsresult
 GetAppIDAndInBrowserFromWindow(nsIDOMWindow *aWindow,
                                uint32_t *aAppId,
                                bool *aInBrowser)
 {
     *aAppId = NECKO_NO_APP_ID;
--- a/uriloader/prefetch/nsPrefetchService.cpp
+++ b/uriloader/prefetch/nsPrefetchService.cpp
@@ -39,17 +39,21 @@ using namespace mozilla;
 //    set NSPR_LOG_MODULES=nsPrefetch:5
 //    set NSPR_LOG_FILE=prefetch.log
 //
 // this enables PR_LOG_ALWAYS level information and places all output in
 // the file http.log
 //
 static PRLogModuleInfo *gPrefetchLog;
 #endif
+
+#undef LOG
 #define LOG(args) PR_LOG(gPrefetchLog, 4, args)
+
+#undef LOG_ENABLED
 #define LOG_ENABLED() PR_LOG_TEST(gPrefetchLog, 4)
 
 #define PREFETCH_PREF "network.prefetch-next"
 
 //-----------------------------------------------------------------------------
 // helpers
 //-----------------------------------------------------------------------------