Bug 1261416 - Rename firefox-plugin-container back to plugin-container to satisfy Flash's protected mode checks, and ensure that we launch the correct binary r=ted
authorGeorge Wright <george@mozilla.com>
Fri, 01 Apr 2016 14:17:52 -0400
changeset 291558 4565c4fac8b0280bd892bff86af5b71fd60d1deb
parent 291557 4271ef91a68621e3de091f455a18777fae0f7a0d
child 291559 76134d6ad6365377ae629a783a8446e22280d073
push id30138
push userryanvm@gmail.com
push dateTue, 05 Apr 2016 03:35:11 +0000
treeherdermozilla-central@fd37367d1b1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1261416
milestone48.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 1261416 - Rename firefox-plugin-container back to plugin-container to satisfy Flash's protected mode checks, and ensure that we launch the correct binary r=ted
browser/installer/windows/nsis/installer.nsi
browser/installer/windows/nsis/uninstaller.nsi
build/win32/Makefile.in
ipc/app/plugin-container/Makefile.in
ipc/app/plugin-container/firefox-plugin-container.exe.manifest
ipc/app/plugin-container/plugin-container.exe.manifest
ipc/glue/GeckoChildProcessHost.cpp
ipc/glue/GeckoChildProcessHost.h
old-configure.in
testing/talos/talos/cmanager_win32.py
toolkit/mozapps/installer/make-eme.mk
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -473,17 +473,17 @@ Section "-Application" APP_IDX
   StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
   ${WriteRegStr2} $TmpVal "$0" "" "$INSTDIR\${FileMainEXE}" 0
   ${WriteRegStr2} $TmpVal "$0" "Path" "$INSTDIR" 0
 
   StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\$R9"
   ${CreateRegKey} "$TmpVal" "$0" 0
   StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\firefox-webcontent.exe"
   ${CreateRegKey} "$TmpVal" "$0" 0
-  StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\firefox-plugin-container.exe"
+  StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\plugin-container.exe"
   ${CreateRegKey} "$TmpVal" "$0" 0
 
   ${If} $TmpVal == "HKLM"
     ; Set the permitted LSP Categories for WinVista and above
     ${SetAppLSPCategories} ${LSP_CATEGORIES}
   ${EndIf}
 
   ; Create shortcuts
--- a/browser/installer/windows/nsis/uninstaller.nsi
+++ b/browser/installer/windows/nsis/uninstaller.nsi
@@ -353,17 +353,17 @@ Section "Uninstall"
     DeleteRegKey HKLM "$0"
     DeleteRegKey HKCU "$0"
     StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\${FileMainEXE}"
     DeleteRegKey HKLM "$0"
     DeleteRegKey HKCU "$0"
     StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\firefox-webcontent.exe"
     DeleteRegKey HKLM "$0"
     DeleteRegKey HKCU "$0"
-    StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\firefox-plugin-container.exe"
+    StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\plugin-container.exe"
     DeleteRegKey HKLM "$0"
     DeleteRegKey HKCU "$0"
     StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=firefox"
     DeleteRegKey HKLM "$0"
     DeleteRegKey HKCU "$0"
   ${Else}
     ReadRegStr $R1 HKLM "$0" ""
     ${un.RemoveQuotesFromPath} "$R1" $R1
--- a/build/win32/Makefile.in
+++ b/build/win32/Makefile.in
@@ -26,11 +26,11 @@ libs:: $(libs-preqs)
 endif
 
 # run the binscope tool to make sure the binary and all libraries
 # are using all available Windows OS-level security mechanisms
 # Don't do this in clang-cl since it doesn't support debug information yet.
 ifndef CLANG_CL
 check::
 	$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/crashreporter-symbols/
-	$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/firefox-webcontent.exe $(DIST)/crashreporter-symbols/
-	$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/firefox-plugin-container.exe $(DIST)/crashreporter-symbols/
+	$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME) $(DIST)/crashreporter-symbols/
+	$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/$(MOZ_PLUGIN_PROCESS_NAME) $(DIST)/crashreporter-symbols/
 endif
--- a/ipc/app/plugin-container/Makefile.in
+++ b/ipc/app/plugin-container/Makefile.in
@@ -1,24 +1,32 @@
 # 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 MOZ_WINCONSOLE
+ifdef MOZ_DEBUG
+MOZ_WINCONSOLE = 1
+else
+MOZ_WINCONSOLE = 0
+endif
+endif
+
 # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
 # # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
 NSDISTMODE = copy
 
 include $(topsrcdir)/config/config.mk
 
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_ARCH),WINNT) #{
 # Note the manifest file exists in the tree, so we use the explicit filename
 # here.
-EXTRA_DEPS += firefox-plugin-container.exe.manifest
+EXTRA_DEPS += plugin-container.exe.manifest
 endif #}
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{
 
 libs::
 	$(NSINSTALL) -D $(DIST)/bin/$(PROGRAM).app
 	rsync -a -C --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/bin/$(MOZ_PLUGIN_PROCESS_NAME).app 
 	sed -e 's/%PROGRAM%/$(MOZ_PLUGIN_PROCESS_NAME)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/bin/$(MOZ_PLUGIN_PROCESS_NAME).app/Contents/Info.plist
deleted file mode 100644
--- a/ipc/app/plugin-container/firefox-plugin-container.exe.manifest
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-<assemblyIdentity
-        version="1.0.0.0"
-        processorArchitecture="*"
-        name="firefox-plugin-container"
-        type="win32"
-/>
-<description>Firefox Runtime</description>
-<dependency>
-        <dependentAssembly>
-                <assemblyIdentity
-                        type="win32"
-                        name="Microsoft.Windows.Common-Controls"
-                        version="6.0.0.0"
-                        processorArchitecture="*"
-                        publicKeyToken="6595b64144ccf1df"
-                        language="*"
-                />
-        </dependentAssembly>
-</dependency>
-  <ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
-    <ms_asmv3:security>
-      <ms_asmv3:requestedPrivileges>
-        <ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false" />
-      </ms_asmv3:requestedPrivileges>
-    </ms_asmv3:security>
-  </ms_asmv3:trustInfo>
-  <ms_asmv3:application xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
-    <ms_asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
-      <dpiAware>True/PM</dpiAware>
-    </ms_asmv3:windowsSettings>
-  </ms_asmv3:application>
-  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
-    <application>
-      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
-      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
-      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
-      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
-      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
-    </application>
-  </compatibility>
-</assembly>
new file mode 100644
--- /dev/null
+++ b/ipc/app/plugin-container/plugin-container.exe.manifest
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+        version="1.0.0.0"
+        processorArchitecture="*"
+        name="plugin-container"
+        type="win32"
+/>
+<description>Firefox Runtime</description>
+<dependency>
+        <dependentAssembly>
+                <assemblyIdentity
+                        type="win32"
+                        name="Microsoft.Windows.Common-Controls"
+                        version="6.0.0.0"
+                        processorArchitecture="*"
+                        publicKeyToken="6595b64144ccf1df"
+                        language="*"
+                />
+        </dependentAssembly>
+</dependency>
+  <ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
+    <ms_asmv3:security>
+      <ms_asmv3:requestedPrivileges>
+        <ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false" />
+      </ms_asmv3:requestedPrivileges>
+    </ms_asmv3:security>
+  </ms_asmv3:trustInfo>
+  <ms_asmv3:application xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
+    <ms_asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+      <dpiAware>True/PM</dpiAware>
+    </ms_asmv3:windowsSettings>
+  </ms_asmv3:application>
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+    </application>
+  </compatibility>
+</assembly>
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -138,17 +138,17 @@ GeckoChildProcessHost::~GeckoChildProces
 #if defined(MOZ_WIDGET_COCOA)
   if (mChildTask != MACH_PORT_NULL)
     mach_port_deallocate(mach_task_self(), mChildTask);
 #endif
 }
 
 //static
 void
-GeckoChildProcessHost::GetPathToBinary(FilePath& exePath)
+GeckoChildProcessHost::GetPathToBinary(FilePath& exePath, GeckoProcessType processType)
 {
   if (ShouldHaveDirectoryService()) {
     MOZ_ASSERT(gGREBinPath);
 #ifdef OS_WIN
     exePath = FilePath(char16ptr_t(gGREBinPath));
 #elif MOZ_WIDGET_COCOA
     nsCOMPtr<nsIFile> childProcPath;
     NS_NewLocalFile(nsDependentString(gGREBinPath), false,
@@ -182,18 +182,18 @@ GeckoChildProcessHost::GetPathToBinary(F
 
   // We must use the PIE binary on 5.0 and higher
   const char* processName = mozilla::AndroidBridge::Bridge()->GetAPIVersion() >= 21 ?
     MOZ_CHILD_PROCESS_NAME_PIE : MOZ_CHILD_PROCESS_NAME;
 
   exePath = exePath.AppendASCII(processName);
 #else
 #ifdef OS_WIN
-  if (XRE_GetProcessType() == GeckoProcessType_Plugin ||
-      XRE_GetProcessType() == GeckoProcessType_GMPlugin) {
+  if (processType == GeckoProcessType_Plugin ||
+      processType == GeckoProcessType_GMPlugin) {
     exePath = exePath.AppendASCII(MOZ_PLUGIN_PROCESS_NAME);
   } else
 #endif
     exePath = exePath.AppendASCII(MOZ_CHILD_PROCESS_NAME);
 #endif
 }
 
 #ifdef MOZ_WIDGET_COCOA
@@ -264,17 +264,17 @@ uint32_t GeckoChildProcessHost::GetSuppo
 {
 #ifdef MOZ_WIDGET_COCOA
   if (type == GeckoProcessType_Plugin) {
 
     // Cache this, it shouldn't ever change.
     static uint32_t pluginContainerArchs = 0;
     if (pluginContainerArchs == 0) {
       FilePath exePath;
-      GetPathToBinary(exePath);
+      GetPathToBinary(exePath, type);
       nsresult rv = GetArchitecturesForBinary(exePath.value().c_str(), &pluginContainerArchs);
       NS_ASSERTION(NS_SUCCEEDED(rv) && pluginContainerArchs != 0, "Getting architecture of plugin container failed!");
       if (NS_FAILED(rv) || pluginContainerArchs == 0) {
         pluginContainerArchs = base::GetCurrentProcessArchitecture();
       }
     }
     return pluginContainerArchs;
   }
@@ -757,17 +757,17 @@ GeckoChildProcessHost::PerformAsyncLaunc
     interpose.Append(path.get());
     interpose.AppendLiteral("/libplugin_child_interpose.dylib");
     newEnvVars["DYLD_INSERT_LIBRARIES"] = interpose.get();
 # endif  // OS_LINUX
   }
 #endif  // OS_LINUX || OS_MACOSX
 
   FilePath exePath;
-  GetPathToBinary(exePath);
+  GetPathToBinary(exePath, mProcessType);
 
 #ifdef MOZ_WIDGET_ANDROID
   // The java wrapper unpacks this for us but can't make it executable
   chmod(exePath.value().c_str(), 0700);
 #endif  // MOZ_WIDGET_ANDROID
 
 #ifdef ANDROID
   // Remap the Android property workspace to a well-known int,
@@ -936,17 +936,17 @@ GeckoChildProcessHost::PerformAsyncLaunc
                                      parent_send_port_memory, parent_send_port_memory_ack, false);
 
 #endif
 
 //--------------------------------------------------
 #elif defined(OS_WIN)
 
   FilePath exePath;
-  GetPathToBinary(exePath);
+  GetPathToBinary(exePath, mProcessType);
 
   CommandLine cmdLine(exePath.ToWStringHack());
   cmdLine.AppendSwitchWithValue(switches::kProcessChannelID, channel_id());
 
   for (std::vector<std::string>::iterator it = aExtraOpts.begin();
        it != aExtraOpts.end();
        ++it) {
       cmdLine.AppendLooseValue(UTF8ToWide(*it));
--- a/ipc/glue/GeckoChildProcessHost.h
+++ b/ipc/glue/GeckoChildProcessHost.h
@@ -184,17 +184,17 @@ private:
 
   // Does the actual work for AsyncLaunch, on the IO thread.
   bool PerformAsyncLaunchInternal(std::vector<std::string>& aExtraOpts,
                                   base::ProcessArchitecture arch);
 
   bool RunPerformAsyncLaunch(StringVector aExtraOpts=StringVector(),
 			     base::ProcessArchitecture aArch=base::GetCurrentProcessArchitecture());
 
-  static void GetPathToBinary(FilePath& exePath);
+  static void GetPathToBinary(FilePath& exePath, GeckoProcessType processType);
 
   void SetChildLogName(const char* varName, const char* origLogName);
 
   // In between launching the subprocess and handing off its IPC
   // channel, there's a small window of time in which *we* might still
   // be the channel listener, and receive messages.  That's bad
   // because we have no idea what to do with those messages.  So queue
   // them here until we hand off the eventual listener.
--- a/old-configure.in
+++ b/old-configure.in
@@ -7220,37 +7220,16 @@ MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYN
 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
 if test "$MOZ_DEBUG"; then
   MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
 fi
 
 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
 AC_SUBST(MOZ_MACBUNDLE_ID)
 
-dnl ========================================================
-dnl = Child Process Name for IPC
-dnl ========================================================
-if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
-  MOZ_CHILD_PROCESS_NAME="firefox-webcontent${BIN_SUFFIX}"
-  MOZ_PLUGIN_PROCESS_NAME="firefox-plugin-container${BIN_SUFFIX}"
-else
-  # We want to let Android unpack the file at install time, but it only does
-  # so if the file is named libsomething.so. The lib/ path is also required
-  # because the unpacked file will be under the lib/ subdirectory and will
-  # need to be executed from that path.
-  MOZ_CHILD_PROCESS_NAME="libfirefox-webcontent.so"
-  MOZ_CHILD_PROCESS_NAME_PIE="libplugin-container-pie.so"
-  AC_SUBST(MOZ_CHILD_PROCESS_NAME_PIE)
-fi
-MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
-
-AC_SUBST(MOZ_CHILD_PROCESS_NAME)
-AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
-AC_SUBST(MOZ_PLUGIN_PROCESS_NAME)
-
 # The following variables are available to branding and application
 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
 # impacts profile location and user-visible fields.
 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
 # versions of a given application (e.g. Aurora and Firefox both use
 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
 # for application.ini's "Name" field, which controls profile location in
@@ -7291,16 +7270,37 @@ fi
 if test -z "$MOZ_APP_VERSION_DISPLAY"; then
    MOZ_APP_VERSION_DISPLAY=$MOZ_APP_VERSION
 fi
 
 if test -z "$ANDROID_PACKAGE_NAME" ; then
    ANDROID_PACKAGE_NAME="org.mozilla.$MOZ_APP_NAME"
 fi
 
+dnl ========================================================
+dnl = Child Process Name for IPC
+dnl ========================================================
+if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
+  MOZ_CHILD_PROCESS_NAME="${MOZ_APP_NAME}-webcontent${BIN_SUFFIX}"
+  MOZ_PLUGIN_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
+else
+  # We want to let Android unpack the file at install time, but it only does
+  # so if the file is named libsomething.so. The lib/ path is also required
+  # because the unpacked file will be under the lib/ subdirectory and will
+  # need to be executed from that path.
+  MOZ_CHILD_PROCESS_NAME="libfirefox-webcontent.so"
+  MOZ_CHILD_PROCESS_NAME_PIE="libplugin-container-pie.so"
+  AC_SUBST(MOZ_CHILD_PROCESS_NAME_PIE)
+fi
+MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
+
+AC_SUBST(MOZ_CHILD_PROCESS_NAME)
+AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
+AC_SUBST(MOZ_PLUGIN_PROCESS_NAME)
+
 # Mozilla released Firefox for Android {Release,Beta} and {Aurora,Nightly} to
 # the public with specific common shared IDs and we need to keep them
 # consistent forever.  The specific common values are set by per-channel
 # branding; all other channels use a generic sharedID, set below.
 if test -z "$MOZ_ANDROID_SHARED_ID" ; then
    MOZ_ANDROID_SHARED_ID="${ANDROID_PACKAGE_NAME}.sharedID"
 fi
 
--- a/testing/talos/talos/cmanager_win32.py
+++ b/testing/talos/talos/cmanager_win32.py
@@ -80,17 +80,17 @@ class _PDH_FMT_COUNTERVALUE(Structure):
 
 _PDH_FMT_LONG = 0x00000100
 
 
 class WinCounterManager(CounterManager):
 
     def __init__(self, process_name, process, counters,
                  childProcess="firefox-webcontent",
-                 pluginProcess="firefox-plugin-container"):
+                 pluginProcess="plugin-container"):
         CounterManager.__init__(self)
         self.childProcess = childProcess
         self.pluginProcess = pluginProcess
         self.registeredCounters = {}
         self.registerCounters(counters)
         # PDH might need to be "refreshed" if it has been queried while the
         # browser is closed
         pdh.PdhEnumObjectsA(None, None, 0, 1, 0, True)
--- a/toolkit/mozapps/installer/make-eme.mk
+++ b/toolkit/mozapps/installer/make-eme.mk
@@ -1,14 +1,14 @@
 # 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/.
 
 include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
 
 ifdef MOZ_SIGN_CMD
   ifeq ($(OS_ARCH),WINNT)
-    # The argument to this macro is the directory where firefox-plugin-container.exe
+    # The argument to this macro is the directory where plugin-container.exe
     # exists, and where voucher.bin will be generated.
-    MAKE_SIGN_EME_VOUCHER = $(PYTHON) $(MOZILLA_DIR)/python/eme/gen-eme-voucher.py -input $(1)/firefox-plugin-container.exe -output $(1)/voucher.bin && \
+    MAKE_SIGN_EME_VOUCHER = $(PYTHON) $(MOZILLA_DIR)/python/eme/gen-eme-voucher.py -input $(1)/$(MOZ_PLUGIN_PROCESS_NAME) -output $(1)/voucher.bin && \
       $(MOZ_SIGN_CMD) -f emevoucher "$(1)/voucher.bin"
   endif
 endif