Skip to content

Commit

Permalink
feat: upgrade to Chromium 72.0.3626.52 (#16334)
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon authored and BinaryMuse committed Jan 22, 2019
1 parent ff9b23e commit 1918e76
Show file tree
Hide file tree
Showing 178 changed files with 2,102 additions and 1,734 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Expand Up @@ -167,6 +167,7 @@ step-gn-gen-default: &step-gn-gen-default
step-electron-build: &step-electron-build
run:
name: Electron build
no_output_timeout: 30m
command: |
cd src
ninja -C out/Default electron -j18
Expand Down
11 changes: 5 additions & 6 deletions BUILD.gn
@@ -1,8 +1,3 @@
import("build/asar.gni")
import("build/npm.gni")
import("buildflags/buildflags.gni")
import("electron_paks.gni")
import("filenames.gni")
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
Expand All @@ -14,6 +9,11 @@ import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//v8/snapshot_toolchain.gni")
import("build/asar.gni")
import("build/npm.gni")
import("buildflags/buildflags.gni")
import("electron_paks.gni")
import("filenames.gni")

if (is_mac) {
import("//build/config/mac/rules.gni")
Expand Down Expand Up @@ -421,7 +421,6 @@ static_library("electron_lib") {

if (enable_osr) {
sources += [
"atom/browser/api/atom_api_web_contents_osr.cc",
"atom/browser/osr/osr_output_device.cc",
"atom/browser/osr/osr_output_device.h",
"atom/browser/osr/osr_render_widget_host_view.cc",
Expand Down
4 changes: 2 additions & 2 deletions DEPS
Expand Up @@ -10,9 +10,9 @@ gclient_gn_args = [

vars = {
'chromium_version':
'71.0.3578.98',
'72.0.3626.52',
'node_version':
'aeae08cda811ed122918bfd48fd9e56f8204d818',
'ad2c89ec3be0f5db3ea02b0f591d36a5d84c51ad',

'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'pyyaml_version': '3.12',
Expand Down
34 changes: 34 additions & 0 deletions atom/app/atom_main_delegate.cc
Expand Up @@ -8,6 +8,10 @@
#include <memory>
#include <string>

#if defined(OS_LINUX)
#include <glib.h> // for g_setenv()
#endif

#include "atom/app/atom_content_client.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/relauncher.h"
Expand Down Expand Up @@ -182,6 +186,36 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
return false;
}

void AtomMainDelegate::PostEarlyInitialization(bool is_running_tests) {
std::string custom_locale;
ui::ResourceBundle::InitSharedInstanceWithLocale(
custom_locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
auto* cmd_line = base::CommandLine::ForCurrentProcess();
if (cmd_line->HasSwitch(::switches::kLang)) {
const std::string locale = cmd_line->GetSwitchValueASCII(::switches::kLang);
const base::FilePath locale_file_path =
ui::ResourceBundle::GetSharedInstance().GetLocaleFilePath(locale, true);
if (!locale_file_path.empty()) {
custom_locale = locale;
#if defined(OS_LINUX)
/* When built with USE_GLIB, libcc's GetApplicationLocaleInternal() uses
* glib's g_get_language_names(), which keys off of getenv("LC_ALL") */
g_setenv("LC_ALL", custom_locale.c_str(), TRUE);
#endif
}
}

#if defined(OS_MACOSX)
if (custom_locale.empty())
l10n_util::OverrideLocaleWithCocoaLocale();
#endif

LoadResourceBundle(custom_locale);

AtomBrowserClient::SetApplicationLocale(
l10n_util::GetApplicationLocale(custom_locale));
}

void AtomMainDelegate::PreSandboxStartup() {
auto* command_line = base::CommandLine::ForCurrentProcess();

Expand Down
1 change: 1 addition & 0 deletions atom/app/atom_main_delegate.h
Expand Up @@ -25,6 +25,7 @@ class AtomMainDelegate : public content::ContentMainDelegate {
bool BasicStartupComplete(int* exit_code) override;
void PreSandboxStartup() override;
void PreCreateMainMessageLoop() override;
void PostEarlyInitialization(bool is_running_tests) override;
content::ContentBrowserClient* CreateContentBrowserClient() override;
content::ContentRendererClient* CreateContentRendererClient() override;
content::ContentUtilityClient* CreateContentUtilityClient() override;
Expand Down
14 changes: 8 additions & 6 deletions atom/browser/api/atom_api_app.cc
Expand Up @@ -30,7 +30,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/sys_info.h"
#include "base/system/sys_info.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/icon_manager.h"
#include "chrome/common/chrome_paths.h"
Expand Down Expand Up @@ -780,24 +780,24 @@ void App::OnGpuProcessCrashed(base::TerminationStatus status) {

void App::BrowserChildProcessLaunchedAndConnected(
const content::ChildProcessData& data) {
ChildProcessLaunched(data.process_type, data.GetHandle());
ChildProcessLaunched(data.process_type, data.GetProcess().Handle());
}

void App::BrowserChildProcessHostDisconnected(
const content::ChildProcessData& data) {
ChildProcessDisconnected(base::GetProcId(data.GetHandle()));
ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle()));
}

void App::BrowserChildProcessCrashed(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) {
ChildProcessDisconnected(base::GetProcId(data.GetHandle()));
ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle()));
}

void App::BrowserChildProcessKilled(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) {
ChildProcessDisconnected(base::GetProcId(data.GetHandle()));
ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle()));
}

void App::RenderProcessReady(content::RenderProcessHost* host) {
Expand Down Expand Up @@ -1401,7 +1401,9 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("App", atom::api::App::GetConstructor(isolate)->GetFunction());
dict.Set("App", atom::api::App::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
dict.Set("app", atom::api::App::Create(isolate));
#if defined(OS_MACOSX)
auto browser = base::Unretained(Browser::Get());
Expand Down
4 changes: 3 additions & 1 deletion atom/browser/api/atom_api_auto_updater.cc
Expand Up @@ -147,7 +147,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("autoUpdater", AutoUpdater::Create(isolate));
dict.Set("AutoUpdater", AutoUpdater::GetConstructor(isolate)->GetFunction());
dict.Set("AutoUpdater", AutoUpdater::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
}

} // namespace
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_browser_view.cc
Expand Up @@ -159,8 +159,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
BrowserView::SetConstructor(isolate, base::Bind(&BrowserView::New));

mate::Dictionary browser_view(
isolate, BrowserView::GetConstructor(isolate)->GetFunction());
mate::Dictionary browser_view(isolate, BrowserView::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
browser_view.SetMethod("fromId",
&mate::TrackableObject<BrowserView>::FromWeakMapID);
browser_view.SetMethod("getAllViews",
Expand Down
7 changes: 4 additions & 3 deletions atom/browser/api/atom_api_browser_window_mac.mm
Expand Up @@ -59,8 +59,9 @@ - (NSView*)hitTest:(NSPoint)aPoint {
// Make NativeWindow use a NSView as content view.
static_cast<NativeWindowMac*>(window())->OverrideNSWindowContentView();
// Add webview to contentView.
NSView* webView = iwc->GetView()->GetNativeView();
NSView* contentView = [window()->GetNativeWindow() contentView];
NSView* webView = iwc->GetView()->GetNativeView().GetNativeNSView();
NSView* contentView =
[window()->GetNativeWindow().GetNativeNSWindow() contentView];
[webView setFrame:[contentView bounds]];

// ensure that buttons view is floated to top of view hierarchy
Expand All @@ -80,7 +81,7 @@ - (NSView*)hitTest:(NSPoint)aPoint {
// All ControlRegionViews should be added as children of the WebContentsView,
// because WebContentsView will be removed and re-added when entering and
// leaving fullscreen mode.
NSView* webView = web_contents()->GetNativeView();
NSView* webView = web_contents()->GetNativeView().GetNativeNSView();
NSInteger webViewWidth = NSWidth([webView bounds]);
NSInteger webViewHeight = NSHeight([webView bounds]);

Expand Down
4 changes: 3 additions & 1 deletion atom/browser/api/atom_api_debugger.cc
Expand Up @@ -194,7 +194,9 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary(isolate, exports)
.Set("Debugger", Debugger::GetConstructor(isolate)->GetFunction());
.Set("Debugger", Debugger::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
}

} // namespace
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_download_item.cc
Expand Up @@ -244,8 +244,9 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary(isolate, exports)
.Set("DownloadItem",
atom::api::DownloadItem::GetConstructor(isolate)->GetFunction());
.Set("DownloadItem", atom::api::DownloadItem::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
}

} // namespace
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_in_app_purchase.cc
Expand Up @@ -132,8 +132,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("inAppPurchase", InAppPurchase::Create(isolate));
dict.Set("InAppPurchase",
InAppPurchase::GetConstructor(isolate)->GetFunction());
dict.Set("InAppPurchase", InAppPurchase::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
#endif
}

Expand Down
4 changes: 3 additions & 1 deletion atom/browser/api/atom_api_menu.cc
Expand Up @@ -233,7 +233,9 @@ void Initialize(v8::Local<v8::Object> exports,
Menu::SetConstructor(isolate, base::Bind(&Menu::New));

mate::Dictionary dict(isolate, exports);
dict.Set("Menu", Menu::GetConstructor(isolate)->GetFunction());
dict.Set(
"Menu",
Menu::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
#if defined(OS_MACOSX)
dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu);
dict.SetMethod("sendActionToFirstResponder",
Expand Down
4 changes: 2 additions & 2 deletions atom/browser/api/atom_api_menu_mac.mm
Expand Up @@ -56,7 +56,7 @@
base::Closure callback) {
if (!native_window)
return;
NSWindow* nswindow = native_window->GetNativeWindow();
NSWindow* nswindow = native_window->GetNativeWindow().GetNativeNSWindow();

auto close_callback = base::Bind(
&MenuMac::OnClosed, weak_factory_.GetWeakPtr(), window_id, callback);
Expand Down Expand Up @@ -99,7 +99,7 @@

[popup_controllers_[window_id] setCloseCallback:close_callback];
// Make sure events can be pumped while the menu is up.
base::MessageLoop::ScopedNestableTaskAllower allow;
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;

// One of the events that could be pumped is |window.close()|.
// User-initiated event-tracking loops protect against this by
Expand Down
7 changes: 5 additions & 2 deletions atom/browser/api/atom_api_net.cc
Expand Up @@ -31,7 +31,9 @@ void Net::BuildPrototype(v8::Isolate* isolate,
}

v8::Local<v8::Value> Net::URLRequest(v8::Isolate* isolate) {
return URLRequest::GetConstructor(isolate)->GetFunction();
return URLRequest::GetConstructor(isolate)
->GetFunction(isolate->GetCurrentContext())
.ToLocalChecked();
}

} // namespace api
Expand All @@ -53,7 +55,8 @@ void Initialize(v8::Local<v8::Object> exports,

mate::Dictionary dict(isolate, exports);
dict.Set("net", Net::Create(isolate));
dict.Set("Net", Net::GetConstructor(isolate)->GetFunction());
dict.Set("Net",
Net::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
}

} // namespace
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_notification.cc
Expand Up @@ -263,8 +263,9 @@ void Initialize(v8::Local<v8::Object> exports,
Notification::SetConstructor(isolate, base::Bind(&Notification::New));

mate::Dictionary dict(isolate, exports);
dict.Set("Notification",
Notification::GetConstructor(isolate)->GetFunction());
dict.Set("Notification", Notification::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());

dict.SetMethod("isSupported", &Notification::IsSupported);
}
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_power_monitor.cc
Expand Up @@ -141,8 +141,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("powerMonitor", PowerMonitor::Create(isolate));
dict.Set("PowerMonitor",
PowerMonitor::GetConstructor(isolate)->GetFunction());
dict.Set("PowerMonitor", PowerMonitor::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
}

} // namespace
Expand Down
4 changes: 3 additions & 1 deletion atom/browser/api/atom_api_screen.cc
Expand Up @@ -164,7 +164,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("screen", Screen::Create(isolate));
dict.Set("Screen", Screen::GetConstructor(isolate)->GetFunction());
dict.Set(
"Screen",
Screen::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
}

} // namespace
Expand Down
15 changes: 9 additions & 6 deletions atom/browser/api/atom_api_session.cc
Expand Up @@ -444,10 +444,9 @@ void Session::ClearStorageData(mate::Arguments* args) {
// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-deviceid
MediaDeviceIDSalt::Reset(browser_context()->prefs());
}
storage_partition->ClearData(
options.storage_types, options.quota_types, options.origin,
content::StoragePartition::OriginMatcherFunction(), base::Time(),
base::Time::Max(), base::Bind(&OnClearStorageDataDone, callback));
storage_partition->ClearData(options.storage_types, options.quota_types,
options.origin, base::Time(), base::Time::Max(),
base::Bind(&OnClearStorageDataDone, callback));
}

void Session::FlushStorageData() {
Expand Down Expand Up @@ -805,8 +804,12 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("Session", Session::GetConstructor(isolate)->GetFunction());
dict.Set("Cookies", Cookies::GetConstructor(isolate)->GetFunction());
dict.Set(
"Session",
Session::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
dict.Set(
"Cookies",
Cookies::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
dict.SetMethod("fromPartition", &FromPartition);
}

Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_system_preferences.cc
Expand Up @@ -121,8 +121,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("systemPreferences", SystemPreferences::Create(isolate));
dict.Set("SystemPreferences",
SystemPreferences::GetConstructor(isolate)->GetFunction());
dict.Set("SystemPreferences", SystemPreferences::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
}

} // namespace
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_top_level_window.cc
Expand Up @@ -1179,8 +1179,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
TopLevelWindow::SetConstructor(isolate, base::Bind(&TopLevelWindow::New));

mate::Dictionary constructor(
isolate, TopLevelWindow::GetConstructor(isolate)->GetFunction());
mate::Dictionary constructor(isolate, TopLevelWindow::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
constructor.SetMethod("fromId",
&mate::TrackableObject<TopLevelWindow>::FromWeakMapID);
constructor.SetMethod("getAllWindows",
Expand Down
4 changes: 3 additions & 1 deletion atom/browser/api/atom_api_tray.cc
Expand Up @@ -254,7 +254,9 @@ void Initialize(v8::Local<v8::Object> exports,
Tray::SetConstructor(isolate, base::Bind(&Tray::New));

mate::Dictionary dict(isolate, exports);
dict.Set("Tray", Tray::GetConstructor(isolate)->GetFunction());
dict.Set(
"Tray",
Tray::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
}

} // namespace
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/api/atom_api_view.cc
Expand Up @@ -76,8 +76,9 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Isolate* isolate = context->GetIsolate();
View::SetConstructor(isolate, base::Bind(&View::New));

mate::Dictionary constructor(isolate,
View::GetConstructor(isolate)->GetFunction());
mate::Dictionary constructor(
isolate,
View::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());

mate::Dictionary dict(isolate, exports);
dict.Set("View", constructor);
Expand Down

0 comments on commit 1918e76

Please sign in to comment.