Skip to content
This repository was archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #286 from brave/chromium61.0.3163.71
Browse files Browse the repository at this point in the history
Update to Chromium 61.0.3163.71
  • Loading branch information
bridiver authored Sep 2, 2017
2 parents f301e6d + 12e2298 commit 602f560
Show file tree
Hide file tree
Showing 86 changed files with 769 additions and 565 deletions.
2 changes: 1 addition & 1 deletion app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ executable("electron_app") {
"//electron:electron_framework_resources",
"//electron:electron_app_resources",
"//build/config:exe_and_shlib_deps",
"//build/linux:fontconfig",
"//third_party/fontconfig",
"//chrome/common:version_header",
"//components/crash/content/app",
"//components/policy:generated",
Expand Down
1 change: 0 additions & 1 deletion atom/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ source_set("app") {
}

deps = [
"//content/public/common:interfaces",
"//content/public/common",
"//components/rappor/public/interfaces",
"//third_party/widevine/cdm:headers",
Expand Down
16 changes: 12 additions & 4 deletions atom/browser/api/atom_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "extensions/features/features.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
Expand Down Expand Up @@ -461,7 +462,7 @@ void OnClientCertificateSelected(
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
if (certs.size() > 0)
delegate->ContinueWithCertificate(certs[0].get());
delegate->ContinueWithCertificate(std::move(certs[0]), nullptr);
}

void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
Expand Down Expand Up @@ -637,7 +638,7 @@ void App::AllowCertificateError(
void App::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::CertificateList client_certs,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
std::shared_ptr<content::ClientCertificateDelegate>
shared_delegate(delegate.release());
Expand All @@ -648,8 +649,15 @@ void App::SelectClientCertificate(
base::Bind(&OnClientCertificateSelected, isolate(), shared_delegate));

// Default to first certificate from the platform store.
if (!prevent_default)
shared_delegate->ContinueWithCertificate(client_certs[0].get());
// The callback will own |client_certs[0]| and |shared_delegate|, keeping
// them alive until after ContinueWithCertificate is called.
if (!prevent_default) {
scoped_refptr<net::X509Certificate> cert = client_certs[0]->certificate();
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move(client_certs[0]),
base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
base::Passed(&shared_delegate), std::move(cert)));
}
}

void App::OnMaxBandwidthChanged(
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class App : public AtomBrowserClient::Delegate,
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::CertificateList client_certs,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;

// net::NetworkChangeNotifier::MaxBandwidthObserver:
Expand Down
3 changes: 2 additions & 1 deletion atom/browser/api/atom_api_debugger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "atom/common/native_mate_converters/value_converter.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/web_contents.h"
#include "native_mate/dictionary.h"
Expand Down Expand Up @@ -134,7 +135,7 @@ void Debugger::SendCommand(mate::Arguments* args) {
request.SetInteger("id", request_id);
request.SetString("method", method);
if (!command_params.empty())
request.Set("params", command_params.DeepCopy());
request.Set("params", base::MakeUnique<base::Value>(command_params));

std::string json_args;
base::JSONWriter::Write(request, &json_args);
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_power_save_blocker.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <memory>

#include "atom/browser/api/trackable_object.h"
#include "device/power_save_blocker/power_save_blocker.h"
#include "native_mate/handle.h"
#include "services/device/wake_lock/power_save_blocker/power_save_blocker.h"

namespace mate {
class Dictionary;
Expand Down
20 changes: 12 additions & 8 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "chrome/browser/printing/print_preview_message_handler.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/printing/print_view_manager_common.h"
#include "chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.h"
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "chrome/browser/ssl/security_state_tab_helper.h"
Expand Down Expand Up @@ -487,6 +488,10 @@ void WebContents::CompleteInit(v8::Isolate* isolate,
memory_pressure_listener_.reset(new base::MemoryPressureListener(
base::Bind(&WebContents::OnMemoryPressure, base::Unretained(this))));
}

if (ResourceCoordinatorWebContentsObserver::IsEnabled())
ResourceCoordinatorWebContentsObserver::CreateForWebContents(
web_contents);
}

Init(isolate);
Expand Down Expand Up @@ -579,6 +584,7 @@ bool WebContents::DidAddMessageToConsole(content::WebContents* source,

bool WebContents::ShouldCreateWebContents(
content::WebContents* web_contents,
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
Expand Down Expand Up @@ -627,12 +633,11 @@ void WebContents::WebContentsCreated(
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents,
const base::Optional<content::WebContents::CreateParams>& create_params) {
content::WebContents* new_contents) {
if (guest_delegate_) {
guest_delegate_->WebContentsCreated(
source_contents, opener_render_process_id, opener_render_frame_id,
frame_name, target_url, new_contents, create_params);
frame_name, target_url, new_contents);
}
}

Expand Down Expand Up @@ -1336,7 +1341,7 @@ void WebContents::DidUpdateFaviconURL(
const std::vector<content::FaviconURL>& urls) {
std::set<GURL> unique_urls;
for (const auto& iter : urls) {
if (iter.icon_type != content::FaviconURL::FAVICON)
if (iter.icon_type != content::FaviconURL::IconType::kFavicon)
continue;
const GURL& url = iter.icon_url;
if (url.is_valid())
Expand Down Expand Up @@ -1586,7 +1591,7 @@ void WebContents::DownloadURL(const GURL& url,
content::BrowserContext::GetDownloadManager(browser_context);

auto params = content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents(), url);
web_contents(), url, NO_TRAFFIC_ANNOTATION_YET);
if (prompt_for_location)
params->set_prompt(prompt_for_location);

Expand Down Expand Up @@ -2353,9 +2358,8 @@ v8::Local<v8::Value> WebContents::TabValue() {
std::unique_ptr<base::DictionaryValue> value(
ExtensionTabUtil::CreateTabObject(web_contents())->ToValue().release());

std::unique_ptr<content::V8ValueConverter>
converter(content::V8ValueConverter::create());
return converter->ToV8Value(value.get(), isolate()->GetCurrentContext());
return content::V8ValueConverter::Create()->ToV8Value(
value.get(), isolate()->GetCurrentContext());
}

int32_t WebContents::ID() const {
Expand Down
4 changes: 2 additions & 2 deletions atom/browser/api/atom_api_web_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
const base::string16& source_id) override;
bool ShouldCreateWebContents(
content::WebContents* web_contents,
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
Expand All @@ -389,8 +390,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents,
const base::Optional<content::WebContents::CreateParams>& create_params)
content::WebContents* new_contents)
override;
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
Expand Down
7 changes: 5 additions & 2 deletions atom/browser/atom_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
Expand All @@ -38,6 +39,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/web_preferences.h"
#include "extensions/features/features.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "ui/base/l10n/l10n_util.h"
Expand Down Expand Up @@ -232,11 +234,12 @@ void AtomBrowserClient::AllowCertificateError(
void AtomBrowserClient::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::CertificateList client_certs,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
if (!client_certs.empty() && delegate_) {
delegate_->SelectClientCertificate(web_contents, cert_request_info,
client_certs, std::move(delegate));
std::move(client_certs),
std::move(delegate));
}
}

Expand Down
7 changes: 6 additions & 1 deletion atom/browser/atom_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@

#include "brightray/browser/browser_client.h"
#include "content/public/browser/render_process_host_observer.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_private_key.h"


namespace content {
class QuotaPermissionContext;
class ClientCertificateDelegate;
}

namespace net {
class ClientCertIdentity;
using ClientCertIdentityList = std::vector<std::unique_ptr<ClientCertIdentity>>;
class SSLCertRequestInfo;
}

Expand Down Expand Up @@ -67,7 +72,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::CertificateList client_certs,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
void ResourceDispatcherHostCreated() override;
void GetAdditionalAllowedSchemesForFileSystem(
Expand Down
30 changes: 28 additions & 2 deletions atom/browser/atom_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#include <utility>

#include "atom/browser/atom_browser_main_parts.h"

#include "atom/browser/api/trackable_object.h"
Expand Down Expand Up @@ -39,6 +41,15 @@
#include "v8/include/v8.h"
#include "v8/include/v8-debug.h"

#if defined(OS_LINUX)
#include "brave/grit/brave_strings.h" // NOLINT: This file is generated
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "components/os_crypt/key_storage_config_linux.h"
#include "components/os_crypt/os_crypt.h"
#include "ui/base/l10n/l10n_util.h"
#endif

#if defined(USE_X11)
#include "chrome/browser/ui/libgtkui/gtk_util.h"
#include "ui/events/devices/x11/touch_factory_x11.h"
Expand Down Expand Up @@ -205,6 +216,23 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() {

// PreProfileInit
EnsureBrowserContextKeyedServiceFactoriesBuilt();
auto command_line = base::CommandLine::ForCurrentProcess();
#if defined(OS_LINUX)
std::unique_ptr<os_crypt::Config> config(new os_crypt::Config());
// Forward to os_crypt the flag to use a specific password store.
config->store =
command_line->GetSwitchValueASCII(switches::kPasswordStore);
// Forward the product name
config->product_name = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
// OSCrypt may target keyring, which requires calls from the main thread.
config->main_thread_runner = content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI);
// OSCrypt can be disabled in a special settings file.
config->should_use_preference =
command_line->HasSwitch(switches::kEnableEncryptionSelection);
chrome::GetDefaultUserDataDirectory(&config->user_data_path);
OSCrypt::SetConfig(std::move(config));
#endif

browser_context_ = ProfileManager::GetActiveUserProfile();
brightray::BrowserMainParts::PreMainMessageLoopRun();
Expand All @@ -224,8 +252,6 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() {
Browser::Get()->DidFinishLaunching(*empty_info);
#endif

// we want to allow the app to override the command line before running this
auto command_line = base::CommandLine::ForCurrentProcess();
// auto feature_list = base::FeatureList::GetInstance();
base::FeatureList::InitializeInstance(
command_line->GetSwitchValueASCII(switches::kEnableFeatures),
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/atom_speech_recognition_manager_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "atom/browser/atom_speech_recognition_manager_delegate.h"

#include <string>
#include <utility>

#include "base/callback.h"

Expand Down Expand Up @@ -52,8 +53,8 @@ void AtomSpeechRecognitionManagerDelegate::OnAudioLevelsChange(

void AtomSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) {
callback.Run(true, true);
base::OnceCallback<void(bool ask_user, bool is_allowed)> callback) {
std::move(callback).Run(true, true);
}

content::SpeechRecognitionEventListener*
Expand Down
3 changes: 2 additions & 1 deletion atom/browser/atom_speech_recognition_manager_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class AtomSpeechRecognitionManagerDelegate
// content::SpeechRecognitionManagerDelegate:
void CheckRecognitionIsAllowed(
int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) override;
base::OnceCallback<void(bool ask_user,
bool is_allowed)> callback) override;
content::SpeechRecognitionEventListener* GetEventListener() override;
bool FilterProfanities(int render_process_id) override;

Expand Down
2 changes: 1 addition & 1 deletion atom/browser/autofill/atom_autofill_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class AtomAutofillClient
bool ShouldShowSigninPromo() override { return false; };
void StartSigninFlow() override {};
void ShowHttpNotSecureExplanation() override {};

bool IsAutofillSupported() override { return true; }

// content::WebContentsObserver implementation.
void WebContentsDestroyed() override;
Expand Down
8 changes: 1 addition & 7 deletions atom/browser/extensions/atom_extension_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ void AtomExtensionSystem::Shared::EnableExtension(
registry_->RemoveDisabled(extension->id());

NotifyExtensionLoaded(extension);

// Notify listeners that the extension was enabled.
content::NotificationService::current()->Notify(
extensions::NOTIFICATION_EXTENSION_ENABLED,
content::Source<content::BrowserContext>(browser_context_),
content::Details<const Extension>(extension));
}

void AtomExtensionSystem::Shared::DisableExtension(
Expand Down Expand Up @@ -567,7 +561,7 @@ void AtomExtensionSystem::RegisterExtensionWithRequestContexts(
BrowserThread::PostTaskAndReply(
BrowserThread::IO, FROM_HERE,
base::Bind(&InfoMap::AddExtension, info_map(),
extension, install_time, incognito_enabled,
base::RetainedRef(extension), install_time, incognito_enabled,
notifications_disabled),
callback);
}
Expand Down
5 changes: 5 additions & 0 deletions atom/browser/extensions/atom_extensions_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,9 @@ void AtomExtensionsBrowserClient::AttachExtensionTaskManagerTag(
ViewType view_type) {
}

bool AtomExtensionsBrowserClient::IsLockScreenContext(
content::BrowserContext* context) {
return false;
}

} // namespace extensions
1 change: 1 addition & 0 deletions atom/browser/extensions/atom_extensions_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class AtomExtensionsBrowserClient : public ExtensionsBrowserClient {
std::unique_ptr<ExtensionApiFrameIdMapHelper>
CreateExtensionApiFrameIdMapHelper(
ExtensionApiFrameIdMap* map) override;
bool IsLockScreenContext(content::BrowserContext* context) override;

private:
friend struct base::LazyInstanceTraitsBase<AtomExtensionsBrowserClient>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int AtomExtensionsNetworkDelegate::OnHeadersReceived(
base::Bind(&AtomExtensionsNetworkDelegate::OnHeadersReceivedInternal,
base::Unretained(this),
request,
original_response_headers,
base::RetainedRef(original_response_headers),
override_response_headers,
allowed_unsafe_redirect_url);

Expand Down
Loading

0 comments on commit 602f560

Please sign in to comment.