Bug 859763 - Remove more remains of the old linker. r=blassey
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 10 Apr 2013 09:02:32 +0200
changeset 128336 a4d23f9a3081bea39cc88a82084450df06d207ec
parent 128335 43ec10ce605677f4a9fa79f095da6f29d49346cd
child 128337 32c37babc5bf9f2aa42b0a8d5dc4406e2bf23b60
push idunknown
push userunknown
push dateunknown
reviewersblassey
bugs859763
milestone23.0a1
Bug 859763 - Remove more remains of the old linker. r=blassey
ipc/glue/GeckoChildProcessHost.cpp
mozglue/android/APKOpen.cpp
mozglue/android/APKOpen.h
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -32,20 +32,16 @@
 #include "mozilla/Omnijar.h"
 #include <sys/stat.h>
 
 #ifdef XP_WIN
 #include "nsIWinTaskbar.h"
 #define NS_TASKBAR_CONTRACTID "@mozilla.org/windows-taskbar;1"
 #endif
 
-#ifdef MOZ_WIDGET_ANDROID
-#include "APKOpen.h"
-#endif
-
 using mozilla::MonitorAutoLock;
 using mozilla::ipc::GeckoChildProcessHost;
 
 #ifdef ANDROID
 // Like its predecessor in nsExceptionHandler.cpp, this is
 // the magic number of a file descriptor remapping we must
 // preserve for the child process.
 static const int kMagicAndroidSystemPropFd = 5;
@@ -555,30 +551,16 @@ GeckoChildProcessHost::PerformAsyncLaunc
 #endif  // OS_LINUX || OS_MACOSX
 
   FilePath exePath;
   GetPathToBinary(exePath);
 
 #ifdef MOZ_WIDGET_ANDROID
   // The java wrapper unpacks this for us but can't make it executable
   chmod(exePath.value().c_str(), 0700);
-  int cacheCount = 0;
-  const struct lib_cache_info * cache = getLibraryCache();
-  nsCString cacheStr;
-  while (cache &&
-         cacheCount++ < MAX_LIB_CACHE_ENTRIES &&
-         strlen(cache->name)) {
-    mFileMap.push_back(std::pair<int,int>(cache->fd, cache->fd));
-    cacheStr.Append(cache->name);
-    cacheStr.AppendPrintf(":%d;", cache->fd);
-    cache++;
-  }
-  // fill the last arg with something if there's no cache
-  if (cacheStr.IsEmpty())
-    cacheStr.AppendLiteral("-");
 #endif  // MOZ_WIDGET_ANDROID
 
 #ifdef ANDROID
   // Remap the Android property workspace to a well-known int,
   // and update the environment to reflect the new value for the
   // child process.
   const char *apws = getenv("ANDROID_PROPERTY_WORKSPACE");
   if (apws) {
@@ -663,20 +645,16 @@ GeckoChildProcessHost::PerformAsyncLaunc
   // can't pretend being the child that's forked off.
   std::string mach_connection_name = StringPrintf("org.mozilla.machname.%d",
                                                   base::RandInt(0, std::numeric_limits<int>::max()));
   childArgv.push_back(mach_connection_name.c_str());
 #endif
 
   childArgv.push_back(childProcessType);
 
-#ifdef MOZ_WIDGET_ANDROID
-  childArgv.push_back(cacheStr.get());
-#endif
-
   base::LaunchApp(childArgv, mFileMap,
 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
                   newEnvVars, privs,
 #endif
                   false, &process, arch);
 
 #ifdef MOZ_WIDGET_COCOA
   // Wait for the child process to send us its 'task_t' data.
--- a/mozglue/android/APKOpen.cpp
+++ b/mozglue/android/APKOpen.cpp
@@ -116,24 +116,16 @@ static void * plc_handle = NULL;
 static void * nss_handle = NULL;
 
 template <typename T> inline void
 xul_dlsym(const char *symbolName, T *value)
 {
   *value = (T) (uintptr_t) __wrap_dlsym(xul_handle, symbolName);
 }
 
-static struct lib_cache_info *cache_mapping = NULL;
-
-NS_EXPORT const struct lib_cache_info *
-getLibraryCache()
-{
-  return cache_mapping;
-}
-
 static int mapping_count = 0;
 
 #define MAX_MAPPING_INFO 32
 
 extern "C" void
 report_mapping(char *name, void *base, uint32_t len, uint32_t offset)
 {
   if (mapping_count >= MAX_MAPPING_INFO)
@@ -373,19 +365,16 @@ ChildProcessInit(int argc, char* argv[])
   }
   if (loadSQLiteLibs(argv[i]) != SUCCESS) {
     return FAILURE;
   }
   if (loadGeckoLibs(argv[i]) != SUCCESS) {
     return FAILURE;
   }
 
-  // don't pass the last arg - it's only recognized by the lib cache
-  argc--;
-
   GeckoProcessType (*fXRE_StringToChildProcessType)(char*);
   xul_dlsym("XRE_StringToChildProcessType", &fXRE_StringToChildProcessType);
 
   mozglueresult (*fXRE_InitChildProcess)(int, char**, GeckoProcessType);
   xul_dlsym("XRE_InitChildProcess", &fXRE_InitChildProcess);
 
   GeckoProcessType proctype = fXRE_StringToChildProcessType(argv[--argc]);
 
--- a/mozglue/android/APKOpen.h
+++ b/mozglue/android/APKOpen.h
@@ -19,22 +19,9 @@ struct mapping_info {
 };
 
 const struct mapping_info * getLibraryMapping();
 
 static const int SUCCESS = 0;
 static const int FAILURE = 1;
 void JNI_Throw(JNIEnv* jenv, const char* classname, const char* msg);
 
-#define MAX_LIB_CACHE_ENTRIES 32
-#define MAX_LIB_CACHE_NAME_LEN 32
-
-struct lib_cache_info {
-  char name[MAX_LIB_CACHE_NAME_LEN];
-  int fd;
-  uint32_t lib_size;
-  void* buffer;
-};
-
-NS_EXPORT const struct lib_cache_info * getLibraryCache();
-
-
 #endif /* APKOpen_h */