Skip to content

Commit

Permalink
Merge pull request #13756 from electron/chromium-upgrade/67
Browse files Browse the repository at this point in the history
chore: Chromium 67
  • Loading branch information
nornagon committed Sep 11, 2018
2 parents 2470bd4 + f76a8c7 commit f8828aa
Show file tree
Hide file tree
Showing 95 changed files with 511 additions and 495 deletions.
12 changes: 5 additions & 7 deletions BUILD.gn
Expand Up @@ -232,7 +232,7 @@ static_library("electron_lib") {
"//ppapi/shared_impl",
"//printing",
"//skia",
"//third_party/WebKit/public:blink",
"//third_party/blink/public:blink",
"//third_party/boringssl",
"//third_party/electron_node:node_lib",
"//third_party/leveldatabase",
Expand All @@ -258,7 +258,7 @@ static_library("electron_lib") {

# TODO(nornagon): replace usage of SchemeRegistry by an actually exported
# API of blink, then remove this from the include_dirs.
"//third_party/WebKit/Source",
"//third_party/blink/renderer",
]

defines = []
Expand Down Expand Up @@ -400,6 +400,7 @@ static_library("electron_lib") {
]
deps += [
"//components/viz/service",
"//services/viz/public/interfaces",
"//ui/compositor",
]
}
Expand Down Expand Up @@ -437,8 +438,6 @@ static_library("electron_lib") {

if (enable_widevine) {
sources += [
"//chrome/common/widevine_cdm_constants.cc",
"//chrome/common/widevine_cdm_constants.h",
"//chrome/renderer/media/chrome_key_systems.cc",
"//chrome/renderer/media/chrome_key_systems.h",
"//chrome/renderer/media/chrome_key_systems_provider.cc",
Expand Down Expand Up @@ -763,8 +762,8 @@ group("blink_unittests") {
testonly = true

deps = [
"//third_party/WebKit/public:all_blink",
"//third_party/WebKit/public:test_support",
"//third_party/blink/public:all_blink",
"//third_party/blink/public:test_support",
]
}

Expand All @@ -780,7 +779,6 @@ group("chromium_unittests") {
"//device:device_unittests",
"//gin:gin_unittests",
"//gpu:gpu_unittests",
"//gpu/ipc/service:gpu_ipc_service_unittests",
"//ipc:ipc_tests",
"//media:media_unittests",
"//media/capture:capture_unittests",
Expand Down
6 changes: 3 additions & 3 deletions DEPS
@@ -1,10 +1,10 @@
vars = {
'chromium_version':
'66.0.3359.181',
'67.0.3396.99',
'libchromiumcontent_revision':
'f3a3f588281aba034a0f1f85ca3c65eb5a3f7b66',
'5db6529f9663a48ee3e6f4265a6abe7806f1dfbf',
'node_version':
'6d1bdd3ebf860ff878a1b5db4fd26fdda3932e21',
'95bb1b1046a648994dfe85340aca21fee0179855',

'chromium_git':
'https://chromium.googlesource.com',
Expand Down
2 changes: 1 addition & 1 deletion appveyor-gn.yml
@@ -1,6 +1,6 @@
version: 1.0.{build}
build_cloud: libcc-20
image: libcc-20-vs2017-15.4.5
image: libcc-20-vs2017-15.7.4
environment:
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
DISABLE_CRASH_REPORTER_TESTS: true
Expand Down
75 changes: 18 additions & 57 deletions atom/app/atom_content_client.cc
Expand Up @@ -18,7 +18,6 @@
#include "content/public/common/content_constants.h"
#include "content/public/common/pepper_plugin_info.h"
#include "content/public/common/user_agent.h"
#include "media/media_features.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/url_constants.h"
Expand All @@ -27,8 +26,6 @@

#if defined(WIDEVINE_CDM_AVAILABLE)
#include "base/native_library.h"
#include "base/strings/stringprintf.h"
#include "chrome/common/widevine_cdm_constants.h"
#include "content/public/common/cdm_info.h"
#include "media/base/video_codecs.h"
#endif // defined(WIDEVINE_CDM_AVAILABLE)
Expand All @@ -43,69 +40,38 @@ namespace atom {
namespace {

#if defined(WIDEVINE_CDM_AVAILABLE)
bool IsWidevineAvailable(base::FilePath* adapter_path,
base::FilePath* cdm_path,
bool IsWidevineAvailable(base::FilePath* cdm_path,
std::vector<media::VideoCodec>* codecs_supported) {
static enum {
NOT_CHECKED,
FOUND,
NOT_FOUND,
} widevine_cdm_file_check = NOT_CHECKED;

base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
*adapter_path = command_line->GetSwitchValuePath(switches::kWidevineCdmPath);
if (!adapter_path->empty()) {
*cdm_path = adapter_path->DirName().AppendASCII(
base::GetNativeLibraryName(kWidevineCdmLibraryName));
if (widevine_cdm_file_check == NOT_CHECKED) {
widevine_cdm_file_check =
(base::PathExists(*adapter_path) && base::PathExists(*cdm_path))
? FOUND
: NOT_FOUND;
if (widevine_cdm_file_check == NOT_CHECKED) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
*cdm_path = command_line->GetSwitchValuePath(switches::kWidevineCdmPath);
if (!cdm_path->empty()) {
*cdm_path = cdm_path->AppendASCII(
base::GetNativeLibraryName(kWidevineCdmLibraryName));
widevine_cdm_file_check = base::PathExists(*cdm_path) ? FOUND : NOT_FOUND;
}
if (widevine_cdm_file_check == FOUND) {
// Add the supported codecs as if they came from the component manifest.
// This list must match the CDM that is being bundled with Chrome.
codecs_supported->push_back(media::VideoCodec::kCodecVP8);
codecs_supported->push_back(media::VideoCodec::kCodecVP9);
}

if (widevine_cdm_file_check == FOUND) {
// Add the supported codecs as if they came from the component manifest.
// This list must match the CDM that is being bundled with Chrome.
codecs_supported->push_back(media::VideoCodec::kCodecVP8);
codecs_supported->push_back(media::VideoCodec::kCodecVP9);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
codecs_supported->push_back(media::VideoCodec::kCodecH264);
codecs_supported->push_back(media::VideoCodec::kCodecH264);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)

return true;
}
return true;
}

return false;
}

void AddWidevineAdapterFromCommandLine(
base::CommandLine* command_line,
std::vector<content::PepperPluginInfo>* plugins) {
base::FilePath adapter_path;
base::FilePath cdm_path;
std::vector<media::VideoCodec> video_codecs_supported;
if (IsWidevineAvailable(&adapter_path, &cdm_path, &video_codecs_supported)) {
auto cdm_version_string =
command_line->GetSwitchValueASCII(switches::kWidevineCdmVersion);
content::PepperPluginInfo info;
info.is_out_of_process = true;
info.path = adapter_path;
info.name = kWidevineCdmDisplayName;
info.description =
base::StringPrintf("%s (version: %s)", kWidevineCdmDescription,
cdm_version_string.c_str());
info.version = cdm_version_string;
info.permissions = kWidevineCdmPluginPermissions;

content::WebPluginMimeType mime_type(kWidevineCdmPluginMimeType,
kWidevineCdmPluginExtension,
kWidevineCdmPluginMimeTypeDescription);
info.mime_types.push_back(mime_type);

plugins->push_back(info);
}
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)

#if defined(ENABLE_PEPPER_FLASH)
Expand Down Expand Up @@ -235,9 +201,6 @@ void AtomContentClient::AddPepperPlugins(
#if defined(ENABLE_PEPPER_FLASH)
AddPepperFlashFromCommandLine(command_line, plugins);
#endif // defined(ENABLE_PEPPER_FLASH)
#if defined(WIDEVINE_CDM_AVAILABLE)
AddWidevineAdapterFromCommandLine(command_line, plugins);
#endif // defined(WIDEVINE_CDM_AVAILABLE)
ComputeBuiltInPlugins(plugins);
}

Expand All @@ -246,12 +209,10 @@ void AtomContentClient::AddContentDecryptionModules(
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) {
if (cdms) {
#if defined(WIDEVINE_CDM_AVAILABLE)
base::FilePath adapter_path;
base::FilePath cdm_path;
std::vector<media::VideoCodec> video_codecs_supported;
bool supports_persistent_license = false;
if (IsWidevineAvailable(&adapter_path, &cdm_path,
&video_codecs_supported)) {
if (IsWidevineAvailable(&cdm_path, &video_codecs_supported)) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
auto cdm_version_string =
command_line->GetSwitchValueASCII(switches::kWidevineCdmVersion);
Expand Down
2 changes: 1 addition & 1 deletion atom/app/atom_main_delegate.cc
Expand Up @@ -21,7 +21,7 @@
#include "base/logging.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/common/content_switches.h"
#include "ipc/ipc_features.h"
#include "ipc/ipc_buildflags.h"
#include "services/service_manager/sandbox/switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
Expand Down
2 changes: 1 addition & 1 deletion atom/app/node_main.cc
Expand Up @@ -65,7 +65,7 @@ int NodeMain(int argc, char* argv[]) {

// Enable support for v8 inspector.
NodeDebugger node_debugger(env);
node_debugger.Start(gin_env.platform());
node_debugger.Start();

mate::Dictionary process(gin_env.isolate(), env->process_object());
#if defined(OS_WIN)
Expand Down
19 changes: 0 additions & 19 deletions atom/browser/api/atom_api_app.cc
Expand Up @@ -1112,30 +1112,11 @@ std::vector<mate::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {

for (const auto& process_metric : app_metrics_) {
mate::Dictionary pid_dict = mate::Dictionary::CreateEmpty(isolate);
mate::Dictionary memory_dict = mate::Dictionary::CreateEmpty(isolate);
mate::Dictionary cpu_dict = mate::Dictionary::CreateEmpty(isolate);

pid_dict.SetHidden("simple", true);
memory_dict.SetHidden("simple", true);
cpu_dict.SetHidden("simple", true);

memory_dict.Set(
"workingSetSize",
static_cast<double>(
process_metric.second->metrics->GetWorkingSetSize() >> 10));
memory_dict.Set(
"peakWorkingSetSize",
static_cast<double>(
process_metric.second->metrics->GetPeakWorkingSetSize() >> 10));

size_t private_bytes, shared_bytes;
if (process_metric.second->metrics->GetMemoryBytes(&private_bytes,
&shared_bytes)) {
memory_dict.Set("privateBytes", static_cast<double>(private_bytes >> 10));
memory_dict.Set("sharedBytes", static_cast<double>(shared_bytes >> 10));
}

pid_dict.Set("memory", memory_dict);
cpu_dict.Set(
"percentCPUUsage",
process_metric.second->metrics->GetPlatformIndependentCPUUsage() /
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_protocol.cc
Expand Up @@ -50,7 +50,7 @@ void RegisterStandardSchemes(const std::vector<std::string>& schemes,
// Dynamically register the schemes.
auto* policy = content::ChildProcessSecurityPolicy::GetInstance();
for (const std::string& scheme : schemes) {
url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITHOUT_PORT);
url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITH_HOST);
if (secure) {
url::AddSecureScheme(scheme.c_str());
}
Expand Down
7 changes: 5 additions & 2 deletions atom/browser/api/atom_api_session.cc
Expand Up @@ -47,7 +47,9 @@
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_auth_preferences.h"
#include "net/proxy_resolution/proxy_config_service_fixed.h"
#include "net/proxy_resolution/proxy_service.h"
#include "net/proxy_resolution/proxy_config_with_annotation.h"
#include "net/proxy_resolution/proxy_resolution_service.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
Expand Down Expand Up @@ -349,7 +351,8 @@ void SetProxyInIO(scoped_refptr<net::URLRequestContextGetter> getter,
auto* proxy_service =
getter->GetURLRequestContext()->proxy_resolution_service();
proxy_service->ResetConfigService(
base::WrapUnique(new net::ProxyConfigServiceFixed(config)));
base::WrapUnique(new net::ProxyConfigServiceFixed(
net::ProxyConfigWithAnnotation(config, NO_TRAFFIC_ANNOTATION_YET))));
// Refetches and applies the new pac script if provided.
proxy_service->ForceReloadProxyConfig();
RunCallbackInUI(callback);
Expand Down
23 changes: 14 additions & 9 deletions atom/browser/api/atom_api_web_contents.cc
Expand Up @@ -92,8 +92,8 @@
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "net/url_request/url_request_context.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include "third_party/blink/public/platform/web_input_event.h"
#include "third_party/blink/public/web/web_find_options.h"
#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"

Expand Down Expand Up @@ -315,7 +315,8 @@ WebContents::WebContents(v8::Isolate* isolate,
: content::WebContentsObserver(web_contents), type_(type) {
const mate::Dictionary options = mate::Dictionary::CreateEmpty(isolate);
if (type == REMOTE) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent(),
false);
Init(isolate);
AttachAsUserData(web_contents);
InitZoomController(web_contents, options);
Expand Down Expand Up @@ -456,7 +457,8 @@ void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
// Initialize zoom controller.
InitZoomController(web_contents, options);

web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent(),
false);

if (IsGuest()) {
NativeWindow* owner_window = nullptr;
Expand Down Expand Up @@ -718,9 +720,12 @@ void WebContents::FindReply(content::WebContents* web_contents,
Emit("found-in-page", result);
}

bool WebContents::CheckMediaAccessPermission(content::WebContents* web_contents,
const GURL& security_origin,
content::MediaStreamType type) {
bool WebContents::CheckMediaAccessPermission(
content::RenderFrameHost* render_frame_host,
const GURL& security_origin,
content::MediaStreamType type) {
auto* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents);
return permission_helper->CheckMediaAccessPermission(security_origin, type);
Expand Down Expand Up @@ -1123,7 +1128,7 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {

std::string user_agent;
if (options.Get("userAgent", &user_agent))
web_contents()->SetUserAgentOverride(user_agent);
web_contents()->SetUserAgentOverride(user_agent, false);

std::string extra_headers;
if (options.Get("extraHeaders", &extra_headers))
Expand Down Expand Up @@ -1233,7 +1238,7 @@ bool WebContents::IsCrashed() const {

void WebContents::SetUserAgent(const std::string& user_agent,
mate::Arguments* args) {
web_contents()->SetUserAgentOverride(user_agent);
web_contents()->SetUserAgentOverride(user_agent, false);
}

std::string WebContents::GetUserAgent() {
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_web_contents.h
Expand Up @@ -330,7 +330,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) override;
bool CheckMediaAccessPermission(content::WebContents* web_contents,
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
const GURL& security_origin,
content::MediaStreamType type) override;
void RequestMediaAccessPermission(
Expand Down

0 comments on commit f8828aa

Please sign in to comment.