Bug 1034920, part 2 - Fix names of NativeLoadData. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Mon, 28 Jul 2014 10:15:57 -0700
changeset 196373 e814aa7bab58073dc0ae8400066a1a7ba54eb71f
parent 196372 ccfca130bbe3da70abf1979677d4b1ffcbec97d5
child 196374 b84ac541b00e265174030f7e446ac90b765ae79c
push id46864
push useramccreight@mozilla.com
push dateMon, 28 Jul 2014 17:33:27 +0000
treeherdermozilla-inbound@2fd5026e35f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1034920
milestone34.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 1034920, part 2 - Fix names of NativeLoadData. r=froydnj
xpcom/components/nsNativeModuleLoader.cpp
xpcom/components/nsNativeModuleLoader.h
--- a/xpcom/components/nsNativeModuleLoader.cpp
+++ b/xpcom/components/nsNativeModuleLoader.cpp
@@ -126,29 +126,29 @@ nsNativeModuleLoader::LoadModule(FileLoc
     }
 
     nsAutoCString filePath;
     file->GetNativePath(filePath);
 
     NativeLoadData data;
 
     if (mLibraries.Get(hashedFile, &data)) {
-        NS_ASSERTION(data.module, "Corrupt mLibraries hash");
+        NS_ASSERTION(data.mModule, "Corrupt mLibraries hash");
         LOG(PR_LOG_DEBUG,
             ("nsNativeModuleLoader::LoadModule(\"%s\") - found in cache",
              filePath.get()));
-        return data.module;
+        return data.mModule;
     }
 
     // We haven't loaded this module before
     {
 #ifdef HAS_DLL_BLOCKLIST
       AutoSetXPCOMLoadOnMainThread guard;
 #endif
-      rv = file->Load(&data.library);
+      rv = file->Load(&data.mLibrary);
     }
 
     if (NS_FAILED(rv)) {
         char errorMsg[1024] = "<unknown; can't get error from NSPR>";
 
         if (PR_GetErrorTextLength() < (int) sizeof(errorMsg))
             PR_GetErrorText(errorMsg);
 
@@ -171,42 +171,42 @@ nsNativeModuleLoader::LoadModule(FileLoc
                 NS_BREAK();
             }
         }
 
         free(blist);
     }
 #endif
 
-    void *module = PR_FindSymbol(data.library, "NSModule");
+    void *module = PR_FindSymbol(data.mLibrary, "NSModule");
     if (!module) {
         LogMessage("Native module at path '%s' doesn't export symbol `NSModule`.",
                    filePath.get());
-        PR_UnloadLibrary(data.library);
+        PR_UnloadLibrary(data.mLibrary);
         return nullptr;
     }
 
-    data.module = *(mozilla::Module const *const *) module;
-    if (mozilla::Module::kVersion != data.module->mVersion) {
+    data.mModule = *(mozilla::Module const *const *) module;
+    if (mozilla::Module::kVersion != data.mModule->mVersion) {
         LogMessage("Native module at path '%s' is incompatible with this version of Firefox, has version %i, expected %i.",
-                   filePath.get(), data.module->mVersion,
+                   filePath.get(), data.mModule->mVersion,
                    mozilla::Module::kVersion);
-        PR_UnloadLibrary(data.library);
+        PR_UnloadLibrary(data.mLibrary);
         return nullptr;
     }
-        
+
     mLibraries.Put(hashedFile, data); // infallible
-    return data.module;
+    return data.mModule;
 }
 
 PLDHashOperator
 nsNativeModuleLoader::ReleaserFunc(nsIHashable* aHashedFile,
                                    NativeLoadData& aLoadData, void*)
 {
-    aLoadData.module = nullptr;
+    aLoadData.mModule = nullptr;
     return PL_DHASH_NEXT;
 }
 
 PLDHashOperator
 nsNativeModuleLoader::UnloaderFunc(nsIHashable* aHashedFile,
                                    NativeLoadData& aLoadData, void*)
 {
     if (PR_LOG_TEST(GetNativeModuleLoaderLog(), PR_LOG_DEBUG)) {
@@ -221,17 +221,17 @@ nsNativeModuleLoader::UnloaderFunc(nsIHa
 
 #ifdef NS_BUILD_REFCNT_LOGGING
     nsTraceRefcnt::SetActivityIsLegal(false);
 #endif
 
 #if 0
     // XXXbsmedberg: do this as soon as the static-destructor crash(es)
     // are fixed
-    PRStatus ret = PR_UnloadLibrary(aLoadData.library);
+    PRStatus ret = PR_UnloadLibrary(aLoadData.mLibrary);
     NS_ASSERTION(ret == PR_SUCCESS, "Failed to unload library");
 #endif
 
 #ifdef NS_BUILD_REFCNT_LOGGING
     nsTraceRefcnt::SetActivityIsLegal(true);
 #endif
 
     return PL_DHASH_REMOVE;
--- a/xpcom/components/nsNativeModuleLoader.h
+++ b/xpcom/components/nsNativeModuleLoader.h
@@ -36,22 +36,22 @@ class nsNativeModuleLoader : public mozi
     nsresult Init();
 
     void UnloadLibraries();
 
  private:
     struct NativeLoadData
     {
         NativeLoadData()
-            : module(nullptr)
-            , library(nullptr)
+            : mModule(nullptr)
+            , mLibrary(nullptr)
         { }
 
-        const mozilla::Module* module;
-        PRLibrary* library;
+        const mozilla::Module* mModule;
+        PRLibrary* mLibrary;
     };
 
     static PLDHashOperator
     ReleaserFunc(nsIHashable* aHashedFile, NativeLoadData &aLoadData, void*);
 
     static PLDHashOperator
     UnloaderFunc(nsIHashable* aHashedFile, NativeLoadData &aLoadData, void*);