Browse Source

chore: bump chromium to 76.0.3809.73 (6-0-x) (#19324)

* chore: bump chromium in DEPS to 76.0.3809.73

* build: handle new helper apps for renderer and plugin bundles

* build: update symbol generation logic for all helpers
Electron Bot 5 years ago
parent
commit
66c2bd2a02

+ 59 - 31
BUILD.gn

@@ -1,6 +1,7 @@
 import("//build/config/locales.gni")
 import("//build/config/ui.gni")
 import("//build/config/win/manifest.gni")
+import("//content/public/app/mac_helpers.gni")
 import("//pdf/features.gni")
 import("//printing/buildflags/buildflags.gni")
 import("//third_party/ffmpeg/ffmpeg_options.gni")
@@ -548,6 +549,7 @@ static_library("electron_lib") {
   if (is_mac) {
     deps += [
       "//components/remote_cocoa/app_shim",
+      "//content/common:mac_helpers",
       "//ui/accelerated_widget_mac",
     ]
     sources += [
@@ -881,36 +883,48 @@ if (is_mac) {
     }
   }
 
-  mac_app_bundle("electron_helper_app") {
-    output_name = electron_helper_name
-    deps = [
-      ":electron_framework+link",
-    ]
-    if (!is_mas_build) {
-      deps += [ "//sandbox/mac:seatbelt" ]
-    }
-    defines = [ "HELPER_EXECUTABLE" ]
-    sources = filenames.app_sources
-    sources += [ "atom/common/atom_constants.cc" ]
-    include_dirs = [ "." ]
-    info_plist = "atom/renderer/resources/mac/Info.plist"
-    extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
-    ldflags = [
-      "-rpath",
-      "@executable_path/../../..",
-    ]
-    if (is_component_build) {
-      ldflags += [
+  template("electron_helper_app") {
+    mac_app_bundle(target_name) {
+      assert(defined(invoker.helper_name_suffix))
+
+      output_name = electron_helper_name + invoker.helper_name_suffix
+      deps = [
+        ":electron_framework+link",
+      ]
+      if (!is_mas_build) {
+        deps += [ "//sandbox/mac:seatbelt" ]
+      }
+      defines = [ "HELPER_EXECUTABLE" ]
+      sources = filenames.app_sources
+      sources += [ "atom/common/atom_constants.cc" ]
+      include_dirs = [ "." ]
+      info_plist = "atom/renderer/resources/mac/Info.plist"
+      extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
+      ldflags = [
         "-rpath",
-        "@executable_path/../../../../../..",
+        "@executable_path/../../..",
       ]
+      if (is_component_build) {
+        ldflags += [
+          "-rpath",
+          "@executable_path/../../../../../..",
+        ]
+      }
+    }
+  }
+
+  foreach(helper_params, content_mac_helpers) {
+    _helper_target = helper_params[0]
+    _helper_bundle_id = helper_params[1]
+    _helper_suffix = helper_params[2]
+    electron_helper_app("electron_helper_app_${_helper_target}") {
+      helper_name_suffix = _helper_suffix
     }
   }
 
   bundle_data("electron_app_framework_bundle_data") {
     sources = [
       "$root_out_dir/$electron_framework_name.framework",
-      "$root_out_dir/$electron_helper_name.app",
     ]
     if (!is_mas_build) {
       sources += [
@@ -924,8 +938,13 @@ if (is_mac) {
     ]
     public_deps = [
       ":electron_framework+link",
-      ":electron_helper_app",
     ]
+
+    foreach(helper_params, content_mac_helpers) {
+      sources +=
+          [ "$root_out_dir/${electron_helper_name}${helper_params[2]}.app" ]
+      public_deps += [ ":electron_helper_app_${helper_params[0]}" ]
+    }
   }
 
   mac_app_bundle("electron_login_helper") {
@@ -1026,13 +1045,18 @@ if (is_mac) {
       ]
     }
 
-    extract_symbols("electron_helper_syms") {
-      binary = "$root_out_dir/$electron_helper_name.app/Contents/MacOS/$electron_helper_name"
-      symbol_dir = "$root_out_dir/breakpad_symbols"
-      dsym_file = "$root_out_dir/$electron_helper_name.dSYM/Contents/Resources/DWARF/$electron_helper_name"
-      deps = [
-        ":electron_helper_app",
-      ]
+    foreach(helper_params, content_mac_helpers) {
+      _helper_target = helper_params[0]
+      _helper_bundle_id = helper_params[1]
+      _helper_suffix = helper_params[2]
+      extract_symbols("electron_helper_syms_${_helper_target}") {
+        binary = "$root_out_dir/$electron_helper_name${_helper_suffix}.app/Contents/MacOS/$electron_helper_name${_helper_suffix}"
+        symbol_dir = "$root_out_dir/breakpad_symbols"
+        dsym_file = "$root_out_dir/$electron_helper_name${_helper_suffix}.dSYM/Contents/Resources/DWARF/$electron_helper_name${_helper_suffix}"
+        deps = [
+          ":electron_helper_app_${_helper_target}",
+        ]
+      }
     }
 
     extract_symbols("electron_app_syms") {
@@ -1076,10 +1100,14 @@ if (is_mac) {
         ":crashpad_handler_syms",
         ":electron_app_syms",
         ":electron_framework_syms",
-        ":electron_helper_syms",
         ":swiftshader_egl_syms",
         ":swiftshader_gles_syms",
       ]
+
+      foreach(helper_params, content_mac_helpers) {
+        _helper_target = helper_params[0]
+        deps += [ ":electron_helper_syms_${_helper_target}" ]
+      }
     }
   } else {
     group("electron_symbols") {

+ 1 - 1
DEPS

@@ -10,7 +10,7 @@ gclient_gn_args = [
 
 vars = {
   'chromium_version':
-    '76.0.3809.70',
+    '76.0.3809.73',
   'node_version':
     'v12.4.0',
 

+ 16 - 2
atom/app/atom_main_delegate_mac.mm

@@ -14,6 +14,7 @@
 #include "base/mac/scoped_nsautorelease_pool.h"
 #include "base/path_service.h"
 #include "base/strings/sys_string_conversions.h"
+#include "content/common/mac_helpers.h"
 #include "content/public/common/content_paths.h"
 
 namespace atom {
@@ -26,10 +27,23 @@ base::FilePath GetFrameworksPath() {
 
 base::FilePath GetHelperAppPath(const base::FilePath& frameworks_path,
                                 const std::string& name) {
-  return frameworks_path.Append(name + " Helper.app")
+    // Figure out what helper we are running
+  base::FilePath path;
+  base::PathService::Get(base::FILE_EXE, &path);
+
+   std::string helper_name = "Helper";
+  if (base::EndsWith(path.value(), content::kMacHelperSuffix_renderer,
+                     base::CompareCase::SENSITIVE)) {
+    helper_name += content::kMacHelperSuffix_renderer;
+  } else if (base::EndsWith(path.value(), content::kMacHelperSuffix_plugin,
+                            base::CompareCase::SENSITIVE)) {
+    helper_name += content::kMacHelperSuffix_plugin;
+  }
+
+  return frameworks_path.Append(name + " " + helper_name + ".app")
       .Append("Contents")
       .Append("MacOS")
-      .Append(name + " Helper");
+      .Append(name + " " + helper_name);
 }
 
 }  // namespace

+ 15 - 0
atom/browser/atom_browser_client.cc

@@ -114,6 +114,11 @@
 #include "chrome/browser/printing/printing_message_filter.h"
 #endif  // BUILDFLAG(ENABLE_PRINTING)
 
+#if defined(OS_MACOSX)
+#include "content/common/mac_helpers.h"
+#include "content/public/common/child_process_host.h"
+#endif
+
 using content::BrowserThread;
 
 namespace atom {
@@ -476,7 +481,17 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
   // Make sure we're about to launch a known executable
   {
     base::FilePath child_path;
+#if defined(OS_MACOSX)
+    int flags = content::ChildProcessHost::CHILD_NORMAL;
+    if (base::EndsWith(command_line->GetProgram().value(),
+                       content::kMacHelperSuffix_renderer,
+                       base::CompareCase::SENSITIVE)) {
+      flags = content::ChildProcessHost::CHILD_RENDERER;
+    }
+    child_path = content::ChildProcessHost::GetChildPath(flags);
+#else
     base::PathService::Get(content::CHILD_PROCESS_EXE, &child_path);
+#endif
 
     base::ThreadRestrictions::ScopedAllowIO allow_io;
     CHECK(base::MakeAbsoluteFilePath(command_line->GetProgram()) == child_path);

+ 6 - 1
atom/common/mac/main_application_bundle.mm

@@ -10,6 +10,7 @@
 #include "base/mac/foundation_util.h"
 #include "base/path_service.h"
 #include "base/strings/string_util.h"
+#include "content/common/mac_helpers.h"
 
 namespace atom {
 
@@ -30,7 +31,11 @@ base::FilePath MainApplicationBundlePath() {
 
   // Up to Contents.
   if (!HasMainProcessKey() &&
-      base::EndsWith(path.value(), " Helper", base::CompareCase::SENSITIVE)) {
+      (base::EndsWith(path.value(), " Helper", base::CompareCase::SENSITIVE) ||
+       base::EndsWith(path.value(), content::kMacHelperSuffix_renderer,
+                             base::CompareCase::SENSITIVE) ||
+       base::EndsWith(path.value(), content::kMacHelperSuffix_plugin,
+                             base::CompareCase::SENSITIVE))) {
     // The running executable is the helper. Go up five steps:
     // Contents/Frameworks/Helper.app/Contents/MacOS/Helper
     // ^ to here                                     ^ from here

+ 12 - 0
script/zip_manifests/dist_zip.mac.x64.manifest

@@ -137,6 +137,18 @@ Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist
 Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/
 Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper
 Electron.app/Contents/Frameworks/Electron Helper.app/Contents/PkgInfo
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/Info.plist
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS/
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS/Electron Helper (Plugin)
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/PkgInfo
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/Info.plist
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS/
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS/Electron Helper (Renderer)
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/PkgInfo
 Electron.app/Contents/Frameworks/Mantle.framework/
 Electron.app/Contents/Frameworks/Mantle.framework/Headers
 Electron.app/Contents/Frameworks/Mantle.framework/Mantle

+ 12 - 0
script/zip_manifests/dist_zip.mac_mas.x64.manifest

@@ -136,6 +136,18 @@ Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist
 Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/
 Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper
 Electron.app/Contents/Frameworks/Electron Helper.app/Contents/PkgInfo
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/Info.plist
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS/
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS/Electron Helper (Plugin)
+Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/PkgInfo
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/Info.plist
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS/
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS/Electron Helper (Renderer)
+Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/PkgInfo
 Electron.app/Contents/Info.plist
 Electron.app/Contents/Library/
 Electron.app/Contents/Library/LoginItems/