Skip to content

Commit

Permalink
Merge pull request #14964 from electron/chromium-upgrade/68
Browse files Browse the repository at this point in the history
feat: upgrade to Chromium 68.0.3440.128 and Node 10.11.0
  • Loading branch information
MarshallOfSound committed Oct 4, 2018
2 parents b59e01b + a78fff0 commit 03e6113
Show file tree
Hide file tree
Showing 155 changed files with 9,131 additions and 8,352 deletions.
8 changes: 6 additions & 2 deletions BUILD.gn
Expand Up @@ -248,6 +248,12 @@ static_library("electron_lib") {
"*\bwin_*.cc",
]
}
if (!is_posix) {
extra_source_filters += [
"*_posix.cc",
"*_posix.h",
]
}
if (is_mac) {
extra_source_filters += [
"*_views.cc",
Expand Down Expand Up @@ -744,7 +750,6 @@ group("chromium_unittests") {
deps = [
"//base:base_unittests",
"//cc:cc_unittests",
"//cc/blink:cc_blink_unittests",
"//content/test:content_unittests",
"//crypto:crypto_unittests",
"//device:device_unittests",
Expand All @@ -756,7 +761,6 @@ group("chromium_unittests") {
"//media/midi:midi_unittests",
"//media/mojo:media_mojo_unittests",
"//mojo:mojo_unittests",
"//mojo/common:mojo_common_unittests",
"//net:net_unittests",
"//ppapi:ppapi_unittests",
"//printing:printing_unittests",
Expand Down
4 changes: 2 additions & 2 deletions DEPS
@@ -1,8 +1,8 @@
vars = {
'chromium_version':
'67.0.3396.99',
'68.0.3440.128',
'node_version':
'7295c611497c5e70d292e96e98f1180822b907a6',
'18a9880b70039f5d41ee860a95fe84e5ef928973',

'pyyaml_version':
'3.12',
Expand Down
25 changes: 21 additions & 4 deletions atom/app/atom_content_client.cc
Expand Up @@ -41,8 +41,11 @@ namespace atom {
namespace {

#if defined(WIDEVINE_CDM_AVAILABLE)
bool IsWidevineAvailable(base::FilePath* cdm_path,
std::vector<media::VideoCodec>* codecs_supported) {
bool IsWidevineAvailable(
base::FilePath* cdm_path,
std::vector<media::VideoCodec>* codecs_supported,
bool* supports_persistent_license,
base::flat_set<media::EncryptionMode>* modes_supported) {
static enum {
NOT_CHECKED,
FOUND,
Expand All @@ -68,6 +71,16 @@ bool IsWidevineAvailable(base::FilePath* cdm_path,
codecs_supported->push_back(media::VideoCodec::kCodecH264);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)

// TODO(crbug.com/767941): Push persistent-license support info here once
// we check in a new CDM that supports it on Linux.
#if defined(OS_CHROMEOS)
*supports_persistent_license = true;
#else
*supports_persistent_license = false;
#endif // defined(OS_CHROMEOS)

modes_supported->insert(media::EncryptionMode::kCenc);

return true;
}

Expand Down Expand Up @@ -213,7 +226,10 @@ void AtomContentClient::AddContentDecryptionModules(
base::FilePath cdm_path;
std::vector<media::VideoCodec> video_codecs_supported;
bool supports_persistent_license = false;
if (IsWidevineAvailable(&cdm_path, &video_codecs_supported)) {
base::flat_set<media::EncryptionMode> encryption_modes_supported;
if (IsWidevineAvailable(&cdm_path, &video_codecs_supported,
&supports_persistent_license,
&encryption_modes_supported)) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
auto cdm_version_string =
command_line->GetSwitchValueASCII(switches::kWidevineCdmVersion);
Expand All @@ -226,7 +242,8 @@ void AtomContentClient::AddContentDecryptionModules(
cdms->push_back(content::CdmInfo(
kWidevineCdmDisplayName, kWidevineCdmGuid, version, cdm_path,
kWidevineCdmFileSystemId, video_codecs_supported,
supports_persistent_license, kWidevineKeySystem, false));
supports_persistent_license, encryption_modes_supported,
kWidevineKeySystem, false));
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)
}
Expand Down
4 changes: 2 additions & 2 deletions atom/app/atom_main_delegate.cc
Expand Up @@ -145,7 +145,7 @@ void AtomMainDelegate::PreSandboxStartup() {
service_manager::switches::kDisableSetuidSandbox);
} else {
// Disable renderer sandbox for most of node's functions.
command_line->AppendSwitch(::switches::kNoSandbox);
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
}
}

Expand All @@ -168,7 +168,7 @@ AtomMainDelegate::CreateContentRendererClient() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableSandbox) ||
!base::CommandLine::ForCurrentProcess()->HasSwitch(
::switches::kNoSandbox)) {
service_manager::switches::kNoSandbox)) {
renderer_client_.reset(new AtomSandboxedRendererClient);
} else {
renderer_client_.reset(new AtomRendererClient);
Expand Down
2 changes: 1 addition & 1 deletion atom/app/atom_main_delegate_mac.mm
Expand Up @@ -49,7 +49,7 @@
GetHelperAppPath(frameworks_path, brightray::GetApplicationName());
if (!base::PathExists(helper_path))
LOG(FATAL) << "Unable to find helper app";
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
base::PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
}

void AtomMainDelegate::SetUpBundleOverrides() {
Expand Down
4 changes: 2 additions & 2 deletions atom/app/node_main.cc
Expand Up @@ -84,7 +84,7 @@ int NodeMain(int argc, char* argv[]) {
bool more;
do {
more = uv_run(env->event_loop(), UV_RUN_ONCE);
gin_env.platform()->DrainBackgroundTasks(env->isolate());
gin_env.platform()->DrainTasks(env->isolate());
if (more == false) {
node::EmitBeforeExit(env);

Expand All @@ -98,7 +98,7 @@ int NodeMain(int argc, char* argv[]) {

exit_code = node::EmitExit(env);
node::RunAtExit(env);
gin_env.platform()->DrainBackgroundTasks(env->isolate());
gin_env.platform()->DrainTasks(env->isolate());
gin_env.platform()->CancelPendingDelayedTasks(env->isolate());

node::FreeEnvironment(env);
Expand Down
27 changes: 16 additions & 11 deletions atom/browser/api/atom_api_app.cc
Expand Up @@ -50,6 +50,7 @@
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/service_manager/sandbox/switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"

Expand Down Expand Up @@ -481,7 +482,7 @@ void OnClientCertificateSelected(
if (!certs.empty()) {
scoped_refptr<net::X509Certificate> cert(certs[0].get());
for (size_t i = 0; i < identities->size(); ++i) {
if (cert->Equals((*identities)[i]->certificate())) {
if (cert->EqualsExcludingChain((*identities)[i]->certificate())) {
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move((*identities)[i]),
base::Bind(&GotPrivateKey, delegate, std::move(cert)));
Expand Down Expand Up @@ -786,18 +787,21 @@ void App::BrowserChildProcessHostDisconnected(
ChildProcessDisconnected(base::GetProcId(data.handle));
}

void App::BrowserChildProcessCrashed(const content::ChildProcessData& data,
int exit_code) {
void App::BrowserChildProcessCrashed(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) {
ChildProcessDisconnected(base::GetProcId(data.handle));
}

void App::BrowserChildProcessKilled(const content::ChildProcessData& data,
int exit_code) {
void App::BrowserChildProcessKilled(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) {
ChildProcessDisconnected(base::GetProcId(data.handle));
}

void App::RenderProcessReady(content::RenderProcessHost* host) {
ChildProcessLaunched(content::PROCESS_TYPE_RENDERER, host->GetHandle());
ChildProcessLaunched(content::PROCESS_TYPE_RENDERER,
host->GetProcess().Handle());
}

void App::RenderProcessDisconnected(base::ProcessId host_pid) {
Expand Down Expand Up @@ -836,7 +840,7 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
base::FilePath path;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::Get(key, &path);
succeed = base::PathService::Get(key, &path);
if (!succeed)
args->ThrowError("Failed to get '" + name + "' path");
return path;
Expand All @@ -853,7 +857,8 @@ void App::SetPath(mate::Arguments* args,
bool succeed = false;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::OverrideAndCreateIfNeeded(key, path, true, false);
succeed =
base::PathService::OverrideAndCreateIfNeeded(key, path, true, false);
if (!succeed)
args->ThrowError("Failed to set path");
}
Expand Down Expand Up @@ -885,7 +890,7 @@ bool App::RequestSingleInstanceLock() {
return true;

base::FilePath user_dir;
PathService::Get(brightray::DIR_USER_DATA, &user_dir);
base::PathService::Get(brightray::DIR_USER_DATA, &user_dir);

auto cb = base::Bind(&App::OnSecondInstance, base::Unretained(this));

Expand Down Expand Up @@ -934,7 +939,7 @@ bool App::Relaunch(mate::Arguments* js_args) {

if (exec_path.empty()) {
base::FilePath current_exe_path;
PathService::Get(base::FILE_EXE, &current_exe_path);
base::PathService::Get(base::FILE_EXE, &current_exe_path);
argv.push_back(current_exe_path.value());
} else {
argv.push_back(exec_path.value());
Expand Down Expand Up @@ -1188,7 +1193,7 @@ void App::EnableMixedSandbox(mate::Arguments* args) {
}

auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(::switches::kNoSandbox)) {
if (command_line->HasSwitch(service_manager::switches::kNoSandbox)) {
#if defined(OS_WIN)
const base::CommandLine::CharType* noSandboxArg = L"--no-sandbox";
#else
Expand Down
10 changes: 6 additions & 4 deletions atom/browser/api/atom_api_app.h
Expand Up @@ -162,10 +162,12 @@ class App : public AtomBrowserClient::Delegate,
const content::ChildProcessData& data) override;
void BrowserChildProcessHostDisconnected(
const content::ChildProcessData& data) override;
void BrowserChildProcessCrashed(const content::ChildProcessData& data,
int exit_code) override;
void BrowserChildProcessKilled(const content::ChildProcessData& data,
int exit_code) override;
void BrowserChildProcessCrashed(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) override;
void BrowserChildProcessKilled(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) override;

private:
void SetAppPath(const base::FilePath& app_path);
Expand Down
3 changes: 1 addition & 2 deletions atom/browser/api/atom_api_menu_mac.mm
Expand Up @@ -97,8 +97,7 @@

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

// One of the events that could be pumped is |window.close()|.
// User-initiated event-tracking loops protect against this by
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_session.cc
Expand Up @@ -396,7 +396,7 @@ void ClearAuthCacheInIO(
options.origin, options.realm, options.auth_scheme,
net::AuthCredentials(options.username, options.password));
} else {
auth_cache->ClearEntriesAddedWithin(base::TimeDelta::Max());
auth_cache->ClearAllEntries();
}
} else if (options.type == "clientCertificate") {
auto* client_auth_cache = network_session->ssl_client_auth_cache();
Expand Down
47 changes: 25 additions & 22 deletions atom/browser/api/atom_api_web_contents.cc
Expand Up @@ -362,7 +362,7 @@ WebContents::WebContents(v8::Isolate* isolate,
}
session_.Reset(isolate, session.ToV8());

content::WebContents* web_contents;
std::unique_ptr<content::WebContents> web_contents;
if (IsGuest()) {
scoped_refptr<content::SiteInstance> site_instance =
content::SiteInstance::CreateForURL(session->browser_context(),
Expand Down Expand Up @@ -405,7 +405,7 @@ WebContents::WebContents(v8::Isolate* isolate,
web_contents = content::WebContents::Create(params);
}

InitWithSessionAndOptions(isolate, web_contents, session, options);
InitWithSessionAndOptions(isolate, web_contents.release(), session, options);
}

void WebContents::InitZoomController(content::WebContents* web_contents,
Expand Down Expand Up @@ -537,16 +537,17 @@ void WebContents::WebContentsCreated(content::WebContents* source_contents,
Emit("-web-contents-created", api_web_contents, target_url, frame_name);
}

void WebContents::AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
new ChildWebContentsTracker(new_contents);
void WebContents::AddNewContents(
content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
new ChildWebContentsTracker(new_contents.get());
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents);
auto api_web_contents = CreateFrom(isolate(), new_contents.release());
if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
initial_rect.x(), initial_rect.y(), initial_rect.width(),
initial_rect.height())) {
Expand Down Expand Up @@ -641,21 +642,25 @@ content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent(
return content::KeyboardEventProcessingResult::NOT_HANDLED;
}

void WebContents::EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) {
void WebContents::EnterFullscreenModeForTab(
content::WebContents* source,
const GURL& origin,
const blink::WebFullscreenOptions& options) {
auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(source);
auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab,
base::Unretained(this), source, origin);
base::Unretained(this), source, origin, options);
permission_helper->RequestFullscreenPermission(callback);
}

void WebContents::OnEnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin,
bool allowed) {
void WebContents::OnEnterFullscreenModeForTab(
content::WebContents* source,
const GURL& origin,
const blink::WebFullscreenOptions& options,
bool allowed) {
if (!allowed)
return;
CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin);
CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin, options);
Emit("enter-html-full-screen");
}

Expand Down Expand Up @@ -757,8 +762,7 @@ content::JavaScriptDialogManager* WebContents::GetJavaScriptDialogManager(
return dialog_manager_.get();
}

void WebContents::OnAudioStateChanged(content::WebContents* web_contents,
bool audible) {
void WebContents::OnAudioStateChanged(bool audible) {
Emit("-audio-state-changed", audible);
}

Expand Down Expand Up @@ -1103,7 +1107,7 @@ int WebContents::GetProcessID() const {

base::ProcessId WebContents::GetOSProcessID() const {
base::ProcessHandle process_handle =
web_contents()->GetMainFrame()->GetProcess()->GetHandle();
web_contents()->GetMainFrame()->GetProcess()->GetProcess().Handle();
return base::GetProcId(process_handle);
}

Expand Down Expand Up @@ -1688,8 +1692,7 @@ void WebContents::StartDrag(const mate::Dictionary& item,

// Start dragging.
if (!files.empty()) {
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
base::MessageLoop::ScopedNestableTaskAllower allow;
DragFileItems(files, icon->image(), web_contents()->GetNativeView());
} else {
args->ThrowError("Must specify either 'file' or 'files' option");
Expand Down

0 comments on commit 03e6113

Please sign in to comment.