Bug 743573 - Fix a number of build warnings in dom/; r=mounir
authorMs2ger <ms2ger@gmail.com>
Tue, 07 Aug 2012 09:06:29 +0200
changeset 101568 1bbc0b65dffba17754b8b2066f3c2ea52f757234
parent 101567 f53c2abc69bdf8b17e38f6d0ef4f050b3efead5b
child 101647 4870719fa1bf80941aae1b348626a166137a7646
push id23244
push userMs2ger@gmail.com
push dateTue, 07 Aug 2012 07:26:23 +0000
treeherdermozilla-central@1bbc0b65dffb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs743573
milestone17.0a1
first release with
nightly linux32
1bbc0b65dffb / 17.0a1 / 20120807030518 / files
nightly linux64
1bbc0b65dffb / 17.0a1 / 20120807030518 / files
nightly mac
1bbc0b65dffb / 17.0a1 / 20120807030518 / files
nightly win32
1bbc0b65dffb / 17.0a1 / 20120807030518 / files
nightly win64
1bbc0b65dffb / 17.0a1 / 20120807030518 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 743573 - Fix a number of build warnings in dom/; r=mounir
accessible/src/xul/XULSelectControlAccessible.cpp
content/base/public/nsIXMLHttpRequest.idl
content/xul/content/src/nsXULElement.cpp
dom/base/Makefile.in
dom/base/nsDOMNavigationTiming.h
dom/bindings/Makefile.in
dom/file/FileRequest.cpp
dom/file/FileService.cpp
dom/file/Makefile.in
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/Key.cpp
dom/indexedDB/Makefile.in
dom/indexedDB/OpenDatabaseHelper.cpp
dom/indexedDB/ipc/IndexedDBChild.h
dom/indexedDB/ipc/IndexedDBParent.cpp
dom/indexedDB/ipc/IndexedDBParent.h
dom/indexedDB/ipc/Makefile.in
dom/interfaces/xul/nsIDOMXULMultSelectCntrlEl.idl
dom/ipc/ContentChild.h
dom/ipc/CrashReporterParent.cpp
dom/ipc/Makefile.in
dom/plugins/base/Makefile.in
dom/plugins/base/PluginPRLibrary.cpp
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/base/nsNPAPIPluginInstance.cpp
dom/plugins/base/nsPluginHost.cpp
dom/plugins/ipc/Makefile.in
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginInstanceParent.h
dom/plugins/ipc/PluginModuleParent.cpp
dom/src/events/Makefile.in
dom/src/json/Makefile.in
dom/src/jsurl/Makefile.in
dom/src/jsurl/nsJSProtocolHandler.h
dom/src/storage/Makefile.in
dom/workers/Makefile.in
dom/workers/RuntimeService.cpp
dom/workers/WorkerScope.cpp
--- a/accessible/src/xul/XULSelectControlAccessible.cpp
+++ b/accessible/src/xul/XULSelectControlAccessible.cpp
@@ -65,49 +65,49 @@ XULSelectControlAccessible::SelectedItem
   // For XUL multi-select control
   nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
     do_QueryInterface(mSelectControl);
   if (xulMultiSelect) {
     PRInt32 length = 0;
     xulMultiSelect->GetSelectedCount(&length);
     for (PRInt32 index = 0; index < length; index++) {
       nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
-      xulMultiSelect->GetSelectedItem(index, getter_AddRefs(itemElm));
+      xulMultiSelect->MultiGetSelectedItem(index, getter_AddRefs(itemElm));
       nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
       Accessible* item = mDoc->GetAccessible(itemNode);
       if (item)
         selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
                                      false);
     }
   } else {  // Single select?
-      nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
-      mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
-      nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
-      if(itemNode) {
-        Accessible* item = mDoc->GetAccessible(itemNode);
-        if (item)
-          selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
-                                     false);
-      }
+    nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
+    mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
+    nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
+    if (itemNode) {
+      Accessible* item = mDoc->GetAccessible(itemNode);
+      if (item)
+        selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
+                                   false);
+    }
   }
 
   nsIMutableArray* items = nullptr;
   selectedItems.forget(&items);
   return items;
 }
 
 Accessible*
 XULSelectControlAccessible::GetSelectedItem(PRUint32 aIndex)
 {
   nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelectControl =
     do_QueryInterface(mSelectControl);
 
   nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
   if (multiSelectControl)
-    multiSelectControl->GetSelectedItem(aIndex, getter_AddRefs(itemElm));
+    multiSelectControl->MultiGetSelectedItem(aIndex, getter_AddRefs(itemElm));
   else if (aIndex == 0)
     mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
 
   nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
   return itemNode && mDoc ? mDoc->GetAccessible(itemNode) : nullptr;
 }
 
 PRUint32
--- a/content/base/public/nsIXMLHttpRequest.idl
+++ b/content/base/public/nsIXMLHttpRequest.idl
@@ -390,17 +390,17 @@ interface nsIXHRSendable : nsISupports {
   void getSendInfo(out nsIInputStream body,
                    out ACString contentType,
                    out ACString charset);
 };
 
 /**
  * @deprecated
  */
-[deprecated, scriptable, uuid(8ae70a39-edf1-40b4-a992-472d23421c25)]
+[scriptable, uuid(8ae70a39-edf1-40b4-a992-472d23421c25)]
 interface nsIJSXMLHttpRequest : nsISupports {
 };
 
 %{ C++
 #define NS_XMLHTTPREQUEST_CID                       \
  { /* d164e770-4157-11d4-9a42-000064657374 */       \
   0xd164e770, 0x4157, 0x11d4,                       \
  {0x9a, 0x42, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74} }
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -776,17 +776,17 @@ nsXULElement::RemoveChildAt(PRUint32 aIn
       nsCOMPtr<nsIDOMElement> oldKidElem = do_QueryInterface(oldKid);
       if (controlElement && oldKidElem) {
         // Iterate over all of the items and find out if they are contained inside
         // the removed subtree.
         PRInt32 length;
         controlElement->GetSelectedCount(&length);
         for (PRInt32 i = 0; i < length; i++) {
           nsCOMPtr<nsIDOMXULSelectControlItemElement> node;
-          controlElement->GetSelectedItem(i, getter_AddRefs(node));
+          controlElement->MultiGetSelectedItem(i, getter_AddRefs(node));
           // we need to QI here to do an XPCOM-correct pointercompare
           nsCOMPtr<nsIDOMElement> selElem = do_QueryInterface(node);
           if (selElem == oldKidElem &&
               NS_SUCCEEDED(controlElement->RemoveItemFromSelection(node))) {
             length--;
             i--;
             fireSelectionHandler = true;
           }
--- a/dom/base/Makefile.in
+++ b/dom/base/Makefile.in
@@ -2,16 +2,17 @@
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= dom
 LIBRARY_NAME	= jsdombase_s
 LIBXUL_LIBRARY	= 1
 FORCE_STATIC_LIB = 1
 
--- a/dom/base/nsDOMNavigationTiming.h
+++ b/dom/base/nsDOMNavigationTiming.h
@@ -123,17 +123,16 @@ private:
   DOMTimeMilliSec DurationFromStart();
 
   DOMTimeMilliSec mFetchStart;
   DOMTimeMilliSec mRedirectStart;
   DOMTimeMilliSec mRedirectEnd;
   DOMTimeMilliSec mBeforeUnloadStart;
   DOMTimeMilliSec mUnloadStart;
   DOMTimeMilliSec mUnloadEnd;
-  DOMTimeMilliSec mNavigationEnd;
   DOMTimeMilliSec mLoadEventStart;
   DOMTimeMilliSec mLoadEventEnd;
 
   DOMTimeMilliSec mDOMLoading;
   DOMTimeMilliSec mDOMInteractive;
   DOMTimeMilliSec mDOMContentLoadedEventStart;
   DOMTimeMilliSec mDOMContentLoadedEventEnd;
   DOMTimeMilliSec mDOMComplete;
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -1,16 +1,17 @@
 # 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/.
 
 DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 MODULE           = dom
 LIBRARY_NAME     = dombindings_s
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
 EXPORT_LIBRARY   = 1
 
 include $(topsrcdir)/config/config.mk
--- a/dom/file/FileRequest.cpp
+++ b/dom/file/FileRequest.cpp
@@ -145,24 +145,30 @@ FileRequest::FireProgressEvent(PRUint64 
 {
   if (NS_FAILED(CheckInnerWindowCorrectness())) {
     return;
   }
 
   nsRefPtr<nsDOMProgressEvent> event = new nsDOMProgressEvent(nullptr, nullptr);
   nsresult rv = event->InitProgressEvent(NS_LITERAL_STRING("progress"),
                                          false, false, false, aLoaded, aTotal);
-  NS_ENSURE_SUCCESS(rv,);
+  if (NS_FAILED(rv)) {
+    return;
+  }
 
   rv = event->SetTrusted(true);
-  NS_ENSURE_SUCCESS(rv,);
+  if (NS_FAILED(rv)) {
+    return;
+  }
 
   bool dummy;
   rv = DispatchEvent(static_cast<nsIDOMProgressEvent*>(event), &dummy);
-  NS_ENSURE_SUCCESS(rv,);
+  if (NS_FAILED(rv)) {
+    return;
+  }
 }
 
 void
 FileRequest::RootResultVal()
 {
   NS_ASSERTION(!mRooted, "Don't call me if already rooted!");
   nsXPCOMCycleCollectionParticipant *participant;
   CallQueryInterface(this, &participant);
--- a/dom/file/FileService.cpp
+++ b/dom/file/FileService.cpp
@@ -384,17 +384,19 @@ FileService::LockedFileQueue::OnFileHelp
     mQueue.RemoveElementAt(index);
   }
   else {
     NS_ASSERTION(mCurrentHelper == aFileHelper, "How can this happen?!");
 
     mCurrentHelper = nullptr;
 
     nsresult rv = ProcessQueue();
-    NS_ENSURE_SUCCESS(rv,);
+    if (NS_FAILED(rv)) {
+      return;
+    }
   }
 }
 
 nsresult
 FileService::LockedFileQueue::ProcessQueue()
 {
   if (mQueue.IsEmpty() || mCurrentHelper) {
     return NS_OK;
--- a/dom/file/Makefile.in
+++ b/dom/file/Makefile.in
@@ -1,16 +1,17 @@
 # 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/.
 
 DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE           = dom
 LIBRARY_NAME     = domfile_s
 XPIDL_MODULE     = dom_file
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -1388,18 +1388,17 @@ IDBObjectStore::ConvertActorsToBlobs(
                                    const InfallibleTArray<PBlobChild*>& aActors,
                                    nsTArray<StructuredCloneFile>& aFiles)
 {
   NS_ASSERTION(!IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
   NS_ASSERTION(aFiles.IsEmpty(), "Should be empty!");
 
   if (!aActors.IsEmpty()) {
-    ContentChild* contentChild = ContentChild::GetSingleton();
-    NS_ASSERTION(contentChild, "This should never be null!");
+    NS_ASSERTION(ContentChild::GetSingleton(), "This should never be null!");
 
     PRUint32 length = aActors.Length();
     aFiles.SetCapacity(length);
 
     for (PRUint32 index = 0; index < length; index++) {
       BlobChild* actor = static_cast<BlobChild*>(aActors[index]);
 
       StructuredCloneFile* file = aFiles.AppendElement();
--- a/dom/indexedDB/Key.cpp
+++ b/dom/indexedDB/Key.cpp
@@ -100,17 +100,18 @@ const int MaxArrayCollapse = 3;
 const int MaxRecursionDepth = 256;
 
 nsresult
 Key::EncodeJSValInternal(JSContext* aCx, const jsval aVal,
                          PRUint8 aTypeOffset, PRUint16 aRecursionDepth)
 {
   NS_ENSURE_TRUE(aRecursionDepth < MaxRecursionDepth, NS_ERROR_DOM_INDEXEDDB_DATA_ERR);
 
-  PR_STATIC_ASSERT(eMaxType * MaxArrayCollapse < 256);
+  MOZ_STATIC_ASSERT(eMaxType * MaxArrayCollapse < 256,
+                    "Unable to encode jsvals.");
 
   if (JSVAL_IS_STRING(aVal)) {
     nsDependentJSString str;
     if (!str.init(aCx, aVal)) {
       return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     }
     EncodeString(str, aTypeOffset);
     return NS_OK;
--- a/dom/indexedDB/Makefile.in
+++ b/dom/indexedDB/Makefile.in
@@ -1,16 +1,17 @@
 # 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/.
 
 DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = dom
 LIBRARY_NAME = dom_indexeddb_s
 XPIDL_MODULE = dom_indexeddb
 LIBXUL_LIBRARY = 1
 FORCE_STATIC_LIB = 1
--- a/dom/indexedDB/OpenDatabaseHelper.cpp
+++ b/dom/indexedDB/OpenDatabaseHelper.cpp
@@ -19,30 +19,33 @@
 
 using namespace mozilla;
 USING_INDEXEDDB_NAMESPACE
 
 namespace {
 
 // If JS_STRUCTURED_CLONE_VERSION changes then we need to update our major
 // schema version.
-PR_STATIC_ASSERT(JS_STRUCTURED_CLONE_VERSION == 1);
+MOZ_STATIC_ASSERT(JS_STRUCTURED_CLONE_VERSION == 1,
+                  "Need to update the major schema version.");
 
 // Major schema version. Bump for almost everything.
 const PRUint32 kMajorSchemaVersion = 12;
 
 // Minor schema version. Should almost always be 0 (maybe bump on release
 // branches if we have to).
 const PRUint32 kMinorSchemaVersion = 0;
 
 // The schema version we store in the SQLite database is a (signed) 32-bit
 // integer. The major version is left-shifted 4 bits so the max value is
 // 0xFFFFFFF. The minor version occupies the lower 4 bits and its max is 0xF.
-PR_STATIC_ASSERT(kMajorSchemaVersion <= 0xFFFFFFF);
-PR_STATIC_ASSERT(kMajorSchemaVersion <= 0xF);
+MOZ_STATIC_ASSERT(kMajorSchemaVersion <= 0xFFFFFFF,
+                  "Major version needs to fit in 28 bits.");
+MOZ_STATIC_ASSERT(kMinorSchemaVersion <= 0xF,
+                  "Minor version needs to fit in 4 bits.");
 
 inline
 PRInt32
 MakeSchemaVersion(PRUint32 aMajorSchemaVersion,
                   PRUint32 aMinorSchemaVersion)
 {
   return PRInt32((aMajorSchemaVersion << 4) + aMinorSchemaVersion);
 }
@@ -1795,17 +1798,18 @@ OpenDatabaseHelper::CreateDatabaseConnec
       rv = stmt->BindStringByName(NS_LITERAL_CSTRING("name"), aName);
       NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
 
       rv = stmt->Execute();
       NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
     }
     else  {
       // This logic needs to change next time we change the schema!
-      PR_STATIC_ASSERT(kSQLiteSchemaVersion == PRInt32((12 << 4) + 0));
+      MOZ_STATIC_ASSERT(kSQLiteSchemaVersion == PRInt32((12 << 4) + 0),
+                        "Need upgrade code from schema version increase.");
 
       while (schemaVersion != kSQLiteSchemaVersion) {
         if (schemaVersion == 4) {
           rv = UpgradeSchemaFrom4To5(connection);
         }
         else if (schemaVersion == 5) {
           rv = UpgradeSchemaFrom5To6(connection);
         }
--- a/dom/indexedDB/ipc/IndexedDBChild.h
+++ b/dom/indexedDB/ipc/IndexedDBChild.h
@@ -309,17 +309,17 @@ protected:
  ******************************************************************************/
 
 class IndexedDBObjectStoreRequestChild : public IndexedDBRequestChildBase
 {
   nsRefPtr<IDBObjectStore> mObjectStore;
 
   typedef ipc::ObjectStoreRequestParams ParamsUnionType;
   typedef ParamsUnionType::Type RequestType;
-  RequestType mRequestType;
+  DebugOnly<RequestType> mRequestType;
 
 public:
   IndexedDBObjectStoreRequestChild(AsyncConnectionHelper* aHelper,
                                    IDBObjectStore* aObjectStore,
                                    RequestType aRequestType);
   virtual ~IndexedDBObjectStoreRequestChild();
 
 protected:
@@ -332,17 +332,17 @@ protected:
  ******************************************************************************/
 
 class IndexedDBIndexRequestChild : public IndexedDBRequestChildBase
 {
   nsRefPtr<IDBIndex> mIndex;
 
   typedef ipc::IndexRequestParams ParamsUnionType;
   typedef ParamsUnionType::Type RequestType;
-  RequestType mRequestType;
+  DebugOnly<RequestType> mRequestType;
 
 public:
   IndexedDBIndexRequestChild(AsyncConnectionHelper* aHelper, IDBIndex* aIndex,
                              RequestType aRequestType);
   virtual ~IndexedDBIndexRequestChild();
 
 protected:
   virtual bool
@@ -354,17 +354,17 @@ protected:
  ******************************************************************************/
 
 class IndexedDBCursorRequestChild : public IndexedDBRequestChildBase
 {
   nsRefPtr<IDBCursor> mCursor;
 
   typedef ipc::CursorRequestParams ParamsUnionType;
   typedef ParamsUnionType::Type RequestType;
-  RequestType mRequestType;
+  DebugOnly<RequestType> mRequestType;
 
 public:
   IndexedDBCursorRequestChild(AsyncConnectionHelper* aHelper,
                               IDBCursor* aCursor,
                               RequestType aRequestType);
   virtual ~IndexedDBCursorRequestChild();
 
 protected:
--- a/dom/indexedDB/ipc/IndexedDBParent.cpp
+++ b/dom/indexedDB/ipc/IndexedDBParent.cpp
@@ -1192,19 +1192,17 @@ void
 IndexedDBObjectStoreRequestParent::ConvertBlobActors(
                                   const InfallibleTArray<PBlobParent*>& aActors,
                                   nsTArray<nsCOMPtr<nsIDOMBlob> >& aBlobs)
 {
   MOZ_ASSERT(aBlobs.IsEmpty());
 
   if (!aActors.IsEmpty()) {
     // Walk the chain to get to ContentParent.
-    ContentParent* contentParent =
-      mObjectStore->Transaction()->Database()->GetContentParent();
-    MOZ_ASSERT(contentParent);
+    MOZ_ASSERT(mObjectStore->Transaction()->Database()->GetContentParent());
 
     uint32_t length = aActors.Length();
     aBlobs.SetCapacity(length);
 
     for (uint32_t index = 0; index < length; index++) {
       BlobParent* actor = static_cast<BlobParent*>(aActors[index]);
       aBlobs.AppendElement(actor->GetBlob());
     }
--- a/dom/indexedDB/ipc/IndexedDBParent.h
+++ b/dom/indexedDB/ipc/IndexedDBParent.h
@@ -489,17 +489,17 @@ protected:
  ******************************************************************************/
 
 class IndexedDBObjectStoreRequestParent : public IndexedDBRequestParentBase
 {
   nsRefPtr<IDBObjectStore> mObjectStore;
 
   typedef ipc::ObjectStoreRequestParams ParamsUnionType;
   typedef ParamsUnionType::Type RequestType;
-  RequestType mRequestType;
+  DebugOnly<RequestType> mRequestType;
 
   typedef ipc::AddParams AddParams;
   typedef ipc::PutParams PutParams;
   typedef ipc::ClearParams ClearParams;
   typedef ipc::DeleteParams DeleteParams;
   typedef ipc::FIXME_Bug_521898_objectstore::GetParams GetParams;
   typedef ipc::FIXME_Bug_521898_objectstore::GetAllParams GetAllParams;
   typedef ipc::FIXME_Bug_521898_objectstore::CountParams CountParams;
@@ -545,17 +545,17 @@ protected:
  ******************************************************************************/
 
 class IndexedDBIndexRequestParent : public IndexedDBRequestParentBase
 {
   nsRefPtr<IDBIndex> mIndex;
 
   typedef ipc::IndexRequestParams ParamsUnionType;
   typedef ParamsUnionType::Type RequestType;
-  RequestType mRequestType;
+  DebugOnly<RequestType> mRequestType;
 
   typedef ipc::GetKeyParams GetKeyParams;
   typedef ipc::GetAllKeysParams GetAllKeysParams;
   typedef ipc::OpenKeyCursorParams OpenKeyCursorParams;
   typedef ipc::FIXME_Bug_521898_index::GetParams GetParams;
   typedef ipc::FIXME_Bug_521898_index::GetAllParams GetAllParams;
   typedef ipc::FIXME_Bug_521898_index::CountParams CountParams;
   typedef ipc::FIXME_Bug_521898_index::OpenCursorParams OpenCursorParams;
@@ -591,17 +591,17 @@ public:
  ******************************************************************************/
 
 class IndexedDBCursorRequestParent : public IndexedDBRequestParentBase
 {
   nsRefPtr<IDBCursor> mCursor;
 
   typedef ipc::CursorRequestParams ParamsUnionType;
   typedef ParamsUnionType::Type RequestType;
-  RequestType mRequestType;
+  DebugOnly<RequestType> mRequestType;
 
   typedef ipc::ContinueParams ContinueParams;
 
 public:
   IndexedDBCursorRequestParent(IDBCursor* aCursor, RequestType aRequestType);
   virtual ~IndexedDBCursorRequestParent();
 
   bool
--- a/dom/indexedDB/ipc/Makefile.in
+++ b/dom/indexedDB/ipc/Makefile.in
@@ -2,16 +2,17 @@
 # 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/.
 
 DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 relativesrcdir = @relativesrcdir@
 VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = dom
 LIBRARY_NAME = dom_indexeddb_ipc_s
 LIBXUL_LIBRARY = 1
 FORCE_STATIC_LIB = 1
 
@@ -44,9 +45,9 @@ include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 # Copy all the normal xpcshell tests from the regular unit directory.
 copy-xpcshell-tests:
 	$(call install_cmd,$(wildcard $(topsrcdir)/dom/indexedDB/test/unit/test_*.js) \
 		$(testxpcobjdir)/$(relativesrcdir)/$(XPCSHELL_TESTS))
 
-libs-xpcshell-tests: copy-xpcshell-tests
\ No newline at end of file
+libs-xpcshell-tests: copy-xpcshell-tests
--- a/dom/interfaces/xul/nsIDOMXULMultSelectCntrlEl.idl
+++ b/dom/interfaces/xul/nsIDOMXULMultSelectCntrlEl.idl
@@ -24,10 +24,11 @@ interface nsIDOMXULMultiSelectControlEle
 
   void selectAll();
   void invertSelection();
   void clearSelection();
 
   // XXX - temporary, pending implementation of scriptable, 
   //       mutable nsIDOMNodeList for selectedItems
   readonly attribute long selectedCount;
+  [binaryname(MultiGetSelectedItem)]
   nsIDOMXULSelectControlItemElement getSelectedItem(in long index);
 };
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -184,31 +184,32 @@ private:
     /**
      * Exit *now*.  Do not shut down XPCOM, do not pass Go, do not run
      * static destructors, do not collect $200.
      */
     MOZ_NORETURN void QuickExit();
 
     InfallibleTArray<nsAutoPtr<AlertObserver> > mAlertObservers;
     nsRefPtr<ConsoleListener> mConsoleListener;
-#ifdef ANDROID
-    gfxIntSize mScreenSize;
-#endif
 
     /**
      * An ID unique to the process containing our corresponding
      * content parent.
      *
      * We expect our content parent to set this ID immediately after opening a
      * channel to us.
      */
     PRUint64 mID;
 
     AppInfo mAppInfo;
 
+#ifdef ANDROID
+    gfxIntSize mScreenSize;
+#endif
+
     static ContentChild* sSingleton;
 
     DISALLOW_EVIL_CONSTRUCTORS(ContentChild);
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/ipc/CrashReporterParent.cpp
+++ b/dom/ipc/CrashReporterParent.cpp
@@ -122,17 +122,17 @@ CrashReporterParent::GenerateChildData(c
             break;
         default:
             NS_ERROR("unknown process type");
             break;
     }
     mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type);
 
     char startTime[32];
-    sprintf(startTime, "%lld", static_cast<PRInt64>(mStartTime));
+    sprintf(startTime, "%lld", static_cast<long long>(mStartTime));
     mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime));
 
     if (!mAppNotes.IsEmpty())
         mNotes.Put(NS_LITERAL_CSTRING("Notes"), mAppNotes);
 
     bool ret = CrashReporter::AppendExtraData(mChildDumpID, mNotes);
     if (ret && processNotes)
         ret = CrashReporter::AppendExtraData(mChildDumpID, *processNotes);
--- a/dom/ipc/Makefile.in
+++ b/dom/ipc/Makefile.in
@@ -9,16 +9,17 @@ VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = dom
 LIBRARY_NAME = domipc_s
 LIBXUL_LIBRARY = 1
 FORCE_STATIC_LIB = 1
 EXPORT_LIBRARY = 1
+FAIL_ON_WARNINGS := 1
 
 ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 TEST_DIRS += tests
 endif
 
 EXPORTS = PCOMContentPermissionRequestChild.h
 
 EXPORTS_NAMESPACES = \
--- a/dom/plugins/base/Makefile.in
+++ b/dom/plugins/base/Makefile.in
@@ -2,16 +2,17 @@
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= plugin
 LIBRARY_NAME	= gkplugin
 EXPORT_LIBRARY = 1
 IS_COMPONENT    = 1
 MODULE_NAME	= nsPluginModule
--- a/dom/plugins/base/PluginPRLibrary.cpp
+++ b/dom/plugins/base/PluginPRLibrary.cpp
@@ -18,16 +18,17 @@ static int gNotOptimized;
 #else
 #define CALLING_CONVENTION_HACK
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "AndroidBridge.h"
 #include "android_npapi.h"
 #include <android/log.h>
+#undef ALOG
 #define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoJavaEnv", ## args)
 #endif
 
 namespace mozilla {
 #ifdef MOZ_WIDGET_ANDROID
 nsresult
 PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
 			       NPPluginFuncs* pFuncs, NPError* error)
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -96,16 +96,17 @@ using mozilla::plugins::PluginModulePare
 #include "nsWindowsHelpers.h"
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
 #include <android/log.h>
 #include "android_npapi.h"
 #include "ANPBase.h"
 #include "AndroidBridge.h"
+#undef LOG
 #define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
 #endif
 
 using namespace mozilla;
 using namespace mozilla::plugins::parent;
 
 // We should make this const...
 static NPNetscapeFuncs sBrowserFuncs = {
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -165,17 +165,16 @@ static NS_DEFINE_IID(kIOutputStreamIID, 
 
 NS_IMPL_THREADSAFE_ISUPPORTS0(nsNPAPIPluginInstance)
 
 nsNPAPIPluginInstance::nsNPAPIPluginInstance()
   :
     mDrawingModel(kDefaultDrawingModel),
 #ifdef MOZ_WIDGET_ANDROID
     mANPDrawingModel(0),
-    mOnScreen(true),
     mFullScreenOrientation(dom::eScreenOrientation_LandscapePrimary),
     mWakeLocked(false),
     mFullScreen(false),
     mInverted(false),
 #endif
     mRunning(NOT_STARTED),
     mWindowless(false),
     mTransparent(false),
@@ -186,16 +185,19 @@ nsNPAPIPluginInstance::nsNPAPIPluginInst
     mMIMEType(nullptr),
     mOwner(nullptr),
     mCurrentPluginEvent(nullptr),
 #if defined(MOZ_X11) || defined(XP_WIN) || defined(XP_MACOSX)
     mUsePluginLayersPref(true)
 #else
     mUsePluginLayersPref(false)
 #endif
+#ifdef MOZ_WIDGET_ANDROID
+  , mOnScreen(true)
+#endif
 {
   mNPP.pdata = NULL;
   mNPP.ndata = this;
 
   mUsePluginLayersPref =
     Preferences::GetBool("plugins.use_layers", mUsePluginLayersPref);
 
   PLUGIN_LOG(PLUGIN_LOG_BASIC, ("nsNPAPIPluginInstance ctor: this=%p\n",this));
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2196,17 +2196,17 @@ nsresult nsPluginHost::ScanPluginsDirect
     if (!seenBefore) {
       // We have a valid new plugin so report that plugins have changed.
       *aPluginsChanged = true;
     }
     
     // Avoid adding different versions of the same plugin if they are running 
     // in-process, otherwise we risk undefined behaviour.
     if (!nsNPAPIPlugin::RunPluginOOP(pluginTag)) {
-      if (nsPluginTag *duplicate = HaveSamePlugin(pluginTag)) {
+      if (HaveSamePlugin(pluginTag)) {
         continue;
       }
     }
     
     // Don't add the same plugin again if it hasn't changed
     if (nsPluginTag* duplicate = FirstPluginWithPath(pluginTag->mFullPath)) {
       if (LL_EQ(pluginTag->mLastModifiedTime, duplicate->mLastModifiedTime)) {
         continue;
--- a/dom/plugins/ipc/Makefile.in
+++ b/dom/plugins/ipc/Makefile.in
@@ -1,16 +1,17 @@
 # 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/.
 
 DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = dom
 
 EXPORTS_NAMESPACES = mozilla
 
 EXPORTS_mozilla = \
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -1213,19 +1213,19 @@ PluginInstanceChild::AnswerNPP_SetWindow
         ::CGContextRelease(mShContext);
         mShContext = nullptr;
     }
 
     if (mPluginIface->setwindow)
         (void) mPluginIface->setwindow(&mData, &mWindow);
 
 #elif defined(ANDROID)
-#  warning Need Android impl
+    // TODO: Need Android impl
 #elif defined(MOZ_WIDGET_QT)
-#  warning Need QT-nonX impl
+    // TODO: Need QT-nonX impl
 #else
 #  error Implement me for your OS
 #endif
 
     return true;
 }
 
 bool
@@ -3515,18 +3515,18 @@ PluginInstanceChild::ShowPluginFrame()
         SwapSurfaces();
         return true;
     } else {
         NS_ERROR("Unsupported drawing model for async layer rendering");
         return false;
     }
 #endif
 
-    NS_ASSERTION(mWindow.width == (mWindow.clipRect.right - mWindow.clipRect.left) &&
-                 mWindow.height == (mWindow.clipRect.bottom - mWindow.clipRect.top),
+    NS_ASSERTION(mWindow.width == uint32_t(mWindow.clipRect.right - mWindow.clipRect.left) &&
+                 mWindow.height == uint32_t(mWindow.clipRect.bottom - mWindow.clipRect.top),
                  "Clip rect should be same size as window when using layers");
 
     // Clear accRect here to be able to pass
     // test_invalidate_during_plugin_paint  test
     nsIntRect rect = mAccumulatedInvalidRect;
     mAccumulatedInvalidRect.SetEmpty();
 
     // Fix up old invalidations that might have been made when our
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -217,20 +217,20 @@ PluginInstanceParent::AnswerNPN_GetValue
 {
 #ifdef XP_WIN
     HWND id;
 #elif defined(MOZ_X11)
     XID id;
 #elif defined(XP_MACOSX)
     intptr_t id;
 #elif defined(ANDROID)
-#warning Need Android impl
+    // TODO: Need Android impl
     int id;
 #elif defined(MOZ_WIDGET_QT)
-#  warning Need Qt non X impl
+    // TODO: Need Qt non X impl
     int id;
 #else
 #warning Implement me
 #endif
 
     *result = mNPNIface->getvalue(mNPP, NPNVnetscapeWindow, &id);
     *value = id;
     return true;
@@ -1015,17 +1015,17 @@ PluginInstanceParent::NPP_SetWindow(cons
     window.type = aWindow->type;
 #endif
 
 #if defined(XP_MACOSX)
     if (mShWidth != window.width || mShHeight != window.height) {
         if (mDrawingModel == NPDrawingModelCoreAnimation || 
             mDrawingModel == NPDrawingModelInvalidatingCoreAnimation) {
             mIOSurface = MacIOSurface::CreateIOSurface(window.width, window.height);
-        } else if (mShWidth * mShHeight != window.width * window.height) {
+        } else if (uint32_t(mShWidth * mShHeight) != window.width * window.height) {
             if (mShWidth != 0 && mShHeight != 0) {
                 DeallocShmem(mShSurface);
                 mShWidth = 0;
                 mShHeight = 0;
             }
 
             if (window.width != 0 && window.height != 0) {
                 if (!AllocShmem(window.width * window.height*4, 
--- a/dom/plugins/ipc/PluginInstanceParent.h
+++ b/dom/plugins/ipc/PluginInstanceParent.h
@@ -22,16 +22,17 @@
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "nsRect.h"
 #include "gfxASurface.h"
 #include "ImageLayers.h"
 #ifdef MOZ_X11
 class gfxXlibSurface;
 #endif
+#include "mozilla/unused.h"
 #include "nsGUIEvent.h"
 
 namespace mozilla {
 namespace plugins {
 
 class PBrowserStreamParent;
 class PluginModuleParent;
 
@@ -275,17 +276,17 @@ public:
     nsresult BeginUpdateBackground(const nsIntRect& aRect,
                                    gfxContext** aCtx);
     nsresult EndUpdateBackground(gfxContext* aCtx,
                                  const nsIntRect& aRect);
 #if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
     nsresult HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled);
 #endif
 
-    void DidComposite() { SendNPP_DidComposite(); }
+    void DidComposite() { unused << SendNPP_DidComposite(); }
 
 private:
     // Create an appropriate platform surface for a background of size
     // |aSize|.  Return true if successful.
     bool CreateBackground(const nsIntSize& aSize);
     void DestroyBackground();
     SurfaceDescriptor BackgroundDescriptor() /*const*/;
 
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -308,32 +308,32 @@ PluginModuleParent::ShouldContinueFromRe
 }
 
 #ifdef MOZ_CRASHREPORTER
 CrashReporterParent*
 PluginModuleParent::CrashReporter()
 {
     return static_cast<CrashReporterParent*>(ManagedPCrashReporterParent()[0]);
 }
-#endif
 
-#ifdef MOZ_CRASHREPORTER
+#ifdef MOZ_CRASHREPORTER_INJECTOR
 static void
 RemoveMinidump(nsIFile* minidump)
 {
     if (!minidump)
         return;
 
     minidump->Remove(false);
     nsCOMPtr<nsIFile> extraFile;
     if (GetExtraFileForMinidump(minidump,
                                 getter_AddRefs(extraFile))) {
         extraFile->Remove(true);
     }
 }
+#endif // MOZ_CRASHREPORTER_INJECTOR
 
 void
 PluginModuleParent::ProcessFirstMinidump()
 {
     CrashReporterParent* crashReporter = CrashReporter();
     if (!crashReporter)
         return;
 
--- a/dom/src/events/Makefile.in
+++ b/dom/src/events/Makefile.in
@@ -2,16 +2,17 @@
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= dom
 LIBRARY_NAME	= jsdomevents_s
 LIBXUL_LIBRARY	= 1
 
 
--- a/dom/src/json/Makefile.in
+++ b/dom/src/json/Makefile.in
@@ -2,16 +2,17 @@
 # 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/.
 
 DEPTH          = @DEPTH@
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = dom
 LIBRARY_NAME   = json_s
 LIBXUL_LIBRARY = 1
 
 
--- a/dom/src/jsurl/Makefile.in
+++ b/dom/src/jsurl/Makefile.in
@@ -2,16 +2,17 @@
 # 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/.
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= jsurl
 LIBRARY_NAME	= jsurl_s
 FORCE_STATIC_LIB = 1
 MODULE_NAME	= javascript__protocol
 GRE_MODULE	= 1
--- a/dom/src/jsurl/nsJSProtocolHandler.h
+++ b/dom/src/jsurl/nsJSProtocolHandler.h
@@ -58,16 +58,18 @@ protected:
 
     nsCOMPtr<nsITextToSubURI>  mTextToSubURI;
 };
 
 
 class nsJSURI : public nsSimpleURI
 {
 public:
+    using nsSimpleURI::Read;
+    using nsSimpleURI::Write;
 
     nsJSURI() {}
 
     nsJSURI(nsIURI* aBaseURI) : mBaseURI(aBaseURI) {}
 
     nsIURI* GetBaseURI() const
     {
         return mBaseURI;
--- a/dom/src/storage/Makefile.in
+++ b/dom/src/storage/Makefile.in
@@ -2,16 +2,17 @@
 # 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/.
 
 DEPTH          = @DEPTH@
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = dom
 LIBRARY_NAME   = jsdomstorage_s
 LIBXUL_LIBRARY = 1
 
 CPPSRCS = \
--- a/dom/workers/Makefile.in
+++ b/dom/workers/Makefile.in
@@ -1,16 +1,17 @@
 # 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/.
+# 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/.
 
 DEPTH            = @DEPTH@
 topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE           = dom
 LIBRARY_NAME     = domworkers_s
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
 
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -60,17 +60,18 @@ using mozilla::Preferences;
 #else
 // Half the size of the actual C stack, to be safe.
 #define WORKER_CONTEXT_NATIVE_STACK_LIMIT 128 * sizeof(size_t) * 1024
 #endif
 
 // The maximum number of threads to use for workers, overridable via pref.
 #define MAX_WORKERS_PER_DOMAIN 10
 
-PR_STATIC_ASSERT(MAX_WORKERS_PER_DOMAIN >= 1);
+MOZ_STATIC_ASSERT(MAX_WORKERS_PER_DOMAIN >= 1,
+                  "We should allow at least one worker per domain.");
 
 // The default number of seconds that close handlers will be allowed to run.
 #define MAX_SCRIPT_RUN_TIME_SEC 10
 
 // The number of seconds that idle threads can hang around before being killed.
 #define IDLE_THREAD_TIMEOUT_SEC 30
 
 // The maximum number of threads that can be idle at one time.
@@ -134,17 +135,18 @@ const char* gStringChars[] = {
   "WorkerEvent",
   "WorkerMessageEvent",
   "WorkerErrorEvent"
 
   // XXX Don't care about ProgressEvent since it should never leak to the main
   // thread.
 };
 
-PR_STATIC_ASSERT(NS_ARRAY_LENGTH(gStringChars) == ID_COUNT);
+MOZ_STATIC_ASSERT(NS_ARRAY_LENGTH(gStringChars) == ID_COUNT,
+                  "gStringChars should have the right length.");
 
 enum {
   PREF_strict = 0,
   PREF_werror,
   PREF_relimit,
   PREF_methodjit,
   PREF_methodjit_always,
   PREF_typeinference,
@@ -172,17 +174,18 @@ const char* gPrefsToWatch[] = {
   JS_OPTIONS_DOT_STR "jit_hardening",
   JS_OPTIONS_DOT_STR "mem.max"
 
 #ifdef JS_GC_ZEAL
   , PREF_WORKERS_GCZEAL
 #endif
 };
 
-PR_STATIC_ASSERT(NS_ARRAY_LENGTH(gPrefsToWatch) == PREF_COUNT);
+MOZ_STATIC_ASSERT(NS_ARRAY_LENGTH(gPrefsToWatch) == PREF_COUNT,
+                  "gPrefsToWatch should have the right length.");
 
 int
 PrefCallback(const char* aPrefName, void* aClosure)
 {
   AssertIsOnMainThread();
 
   RuntimeService* rts = static_cast<RuntimeService*>(aClosure);
   NS_ASSERTION(rts, "This should never be null!");
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -956,18 +956,21 @@ CreateDedicatedWorkerGlobalScope(JSConte
   JSObject* workerProto = worker::InitClass(aCx, global, eventTargetProto,
                                             false);
   if (!workerProto) {
     return NULL;
   }
 
   if (worker->IsChromeWorker() &&
       (!chromeworker::InitClass(aCx, global, workerProto, false) ||
-       !DefineChromeWorkerFunctions(aCx, global)) ||
-       !DefineOSFileConstants(aCx, global)) {
+       !DefineChromeWorkerFunctions(aCx, global))) {
+    return NULL;
+  }
+
+  if (!DefineOSFileConstants(aCx, global)) {
     return NULL;
   }
 
   // Init other classes we care about.
   if (!events::InitClasses(aCx, global, false) ||
       !file::InitClasses(aCx, global) ||
       !filereadersync::InitClass(aCx, global) ||
       !exceptions::InitClasses(aCx, global) ||