Update to Chromium version 81.0.4044.0 (#737173)

This commit is contained in:
Marshall Greenblatt 2020-03-03 19:29:39 -05:00
parent a22b670a00
commit 9d9ee8b45f
135 changed files with 2602 additions and 1329 deletions

View File

@ -772,9 +772,9 @@ static_library("libcef_static") {
"//components/printing/common",
"//components/printing/renderer",
"//components/proxy_config",
"//components/safe_browsing/db:test_database_manager",
"//components/services/pdf_compositor/public/cpp",
"//components/services/pdf_compositor/public/mojom",
"//components/safe_browsing/core/db:test_database_manager",
"//components/services/print_compositor/public/cpp",
"//components/services/print_compositor/public/mojom",
"//components/tracing",
"//components/update_client",
"//components/url_formatter",
@ -1377,13 +1377,16 @@ repack("pak") {
# Add associated .h files in the make_pack_header("resources") target.
sources = [
"$root_gen_dir/chrome/browser_resources.pak",
"$root_gen_dir/chrome/dev_ui_browser_resources.pak",
"$root_gen_dir/chrome/net_internals_resources.pak",
"$root_gen_dir/chrome/print_preview_resources.pak",
"$root_gen_dir/chrome/common_resources.pak",
"$root_gen_dir/components/components_resources.pak",
"$root_gen_dir/components/dev_ui_components_resources.pak",
"$root_gen_dir/cef/cef_resources.pak",
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/content/dev_ui_content_resources.pak",
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
]
@ -1392,14 +1395,17 @@ repack("pak") {
# the libcef_static target. Grit deps that generate .cc files must be
# listed both here and in the libcef_static target.
public_deps = [
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser:resources",
"//chrome/browser/resources/net_internals:net_internals_resources",
"//chrome/browser/resources:print_preview_resources",
"//chrome/common:resources",
"//components/resources:components_resources",
"//components/resources:dev_ui_components_resources",
":cef_resources",
"//content/browser/tracing:resources",
"//content:resources",
"//content:content_resources",
"//content:dev_ui_content_resources",
"//net:net_resources",
"//third_party/blink/public:resources",
]
@ -1442,12 +1448,15 @@ make_pack_header("resources") {
"$root_gen_dir/chrome/grit/browser_resources.h",
"$root_gen_dir/chrome/grit/common_resources.h",
"$root_gen_dir/chrome/grit/component_extension_resources.h",
"$root_gen_dir/chrome/grit/dev_ui_browser_resources.h",
"$root_gen_dir/chrome/grit/net_internals_resources.h",
"$root_gen_dir/chrome/grit/renderer_resources.h",
"$root_gen_dir/components/grit/components_resources.h",
"$root_gen_dir/components/grit/dev_ui_components_resources.h",
"$root_gen_dir/content/browser/devtools/grit/devtools_resources.h",
"$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
"$root_gen_dir/content/grit/content_resources.h",
"$root_gen_dir/content/grit/dev_ui_content_resources.h",
"$root_gen_dir/extensions/grit/extensions_browser_resources.h",
"$root_gen_dir/extensions/grit/extensions_renderer_resources.h",
"$root_gen_dir/extensions/grit/extensions_resources.h",

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/80.0.3987.0'
'chromium_checkout': 'refs/tags/81.0.4044.0'
}

View File

@ -2926,6 +2926,16 @@ typedef enum {
CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED,
} cef_cdm_registration_error_t;
///
// Composition underline style.
///
typedef enum {
CEF_CUS_SOLID,
CEF_CUS_DOT,
CEF_CUS_DASH,
CEF_CUS_NONE,
} cef_composition_underline_style_t;
///
// Structure representing IME composition underline information. This is a thin
// wrapper around Blink's WebCompositionUnderline class and should be kept in
@ -2951,6 +2961,11 @@ typedef struct _cef_composition_underline_t {
// Set to true (1) for thick underline.
///
int thick;
///
// Style.
///
cef_composition_underline_style_t style;
} cef_composition_underline_t;
#ifdef __cplusplus

View File

@ -866,10 +866,7 @@ struct CefCursorInfoTraits {
static inline void set(const struct_type* src,
struct_type* target,
bool copy) {
target->hotspot = src->hotspot;
target->image_scale_factor = src->image_scale_factor;
target->buffer = src->buffer;
target->size = src->size;
*target = *src;
}
};
@ -942,23 +939,14 @@ typedef CefStructBase<CefBoxLayoutSettingsTraits> CefBoxLayoutSettings;
struct CefCompositionUnderlineTraits {
typedef cef_composition_underline_t struct_type;
static inline void init(struct_type* s) {
s->range.from = 0;
s->range.to = 0;
s->color = 0;
s->background_color = 0;
s->thick = 0;
}
static inline void init(struct_type* s) {}
static inline void clear(struct_type* s) {}
static inline void set(const struct_type* src,
struct_type* target,
bool copy) {
target->range = src->range;
target->color = src->color;
target->background_color = src->background_color;
target->thick = src->thick;
*target = *src;
}
};

View File

@ -1708,9 +1708,9 @@ void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
void CefBrowserHostImpl::RunFileChooser(
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback) {
CefFileDialogRunner::RunFileChooserCallback callback) {
EnsureFileDialogManager();
file_dialog_manager_->RunFileChooser(params, callback);
file_dialog_manager_->RunFileChooser(params, std::move(callback));
}
bool CefBrowserHostImpl::EmbedsFullscreenWidget() {
@ -2467,9 +2467,9 @@ bool CefBrowserHostImpl::CheckMediaAccessPermission(
return command_line->HasSwitch(switches::kEnableMediaStream);
}
bool CefBrowserHostImpl::IsNeverVisible(content::WebContents* web_contents) {
bool CefBrowserHostImpl::IsNeverComposited(content::WebContents* web_contents) {
if (extension_host_)
return extension_host_->IsNeverVisible(web_contents);
return extension_host_->IsNeverComposited(web_contents);
return false;
}
@ -2651,8 +2651,7 @@ void CefBrowserHostImpl::DocumentAvailableInMainFrame() {
void CefBrowserHostImpl::DidFailLoad(
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) {
int error_code) {
// The navigation failed after commit. OnLoadStart was called so we also call
// OnLoadEnd.
auto frame = browser_info_->GetFrameForHost(render_frame_host);

View File

@ -351,9 +351,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
// Run the file chooser dialog specified by |params|. Only a single dialog may
// be pending at any given time. |callback| will be executed asynchronously
// after the dialog is dismissed or if another dialog is already pending.
void RunFileChooser(
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback);
void RunFileChooser(const CefFileDialogRunner::FileChooserParams& params,
CefFileDialogRunner::RunFileChooserCallback callback);
bool HandleContextMenu(content::WebContents* web_contents,
const content::ContextMenuParams& params);
@ -458,7 +457,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
const GURL& security_origin,
blink::mojom::MediaStreamType type) override;
bool IsNeverVisible(content::WebContents* web_contents) override;
bool IsNeverComposited(content::WebContents* web_contents) override;
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
@ -481,8 +480,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
void DocumentAvailableInMainFrame() override;
void DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) override;
int error_code) override;
void TitleWasSet(content::NavigationEntry* entry) override;
void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) override;

View File

@ -50,6 +50,7 @@
#include "ui/wm/core/wm_state.h"
#if defined(OS_WIN)
#include "components/os_crypt/os_crypt.h"
#include "ui/base/cursor/cursor_loader_win.h"
#endif
#endif // defined(USE_AURA)
@ -71,11 +72,6 @@
#include "libcef/browser/printing/print_dialog_linux.h"
#endif
#if defined(OS_MACOSX) || defined(OS_WIN)
#include "chrome/browser/browser_process.h"
#include "components/os_crypt/os_crypt.h"
#endif
CefBrowserMainParts::CefBrowserMainParts(
const content::MainFunctionParams& parameters)
: BrowserMainParts(), devtools_delegate_(nullptr) {}
@ -122,11 +118,12 @@ void CefBrowserMainParts::PreMainMessageLoopStart() {
ui::TouchFactory::SetTouchDeviceListFromCommandLine();
#endif
#if defined(OS_MACOSX) || defined(OS_WIN)
#if defined(OS_WIN)
// Initialize the OSCrypt.
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
OSCrypt::Init(local_state);
bool os_crypt_init = OSCrypt::Init(local_state);
DCHECK(os_crypt_init);
#endif
}

View File

@ -136,7 +136,6 @@
#if defined(OS_MACOSX)
#include "net/ssl/client_cert_store_mac.h"
#include "services/audio/public/mojom/constants.mojom.h"
#include "services/video_capture/public/mojom/constants.mojom.h"
#endif
@ -157,18 +156,19 @@ namespace {
class CefQuotaCallbackImpl : public CefRequestCallback {
public:
explicit CefQuotaCallbackImpl(
const content::QuotaPermissionContext::PermissionCallback& callback)
: callback_(callback) {}
using CallbackType = content::QuotaPermissionContext::PermissionCallback;
explicit CefQuotaCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {}
~CefQuotaCallbackImpl() {
if (!callback_.is_null()) {
// The callback is still pending. Cancel it now.
if (CEF_CURRENTLY_ON_IOT()) {
RunNow(callback_, false);
RunNow(std::move(callback_), false);
} else {
CEF_POST_TASK(CEF_IOT, base::Bind(&CefQuotaCallbackImpl::RunNow,
callback_, false));
CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefQuotaCallbackImpl::RunNow,
std::move(callback_), false));
}
}
}
@ -176,31 +176,28 @@ class CefQuotaCallbackImpl : public CefRequestCallback {
void Continue(bool allow) override {
if (CEF_CURRENTLY_ON_IOT()) {
if (!callback_.is_null()) {
RunNow(callback_, allow);
callback_.Reset();
RunNow(std::move(callback_), allow);
}
} else {
CEF_POST_TASK(CEF_IOT,
base::Bind(&CefQuotaCallbackImpl::Continue, this, allow));
CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefQuotaCallbackImpl::Continue,
this, allow));
}
}
void Cancel() override { Continue(false); }
void Disconnect() { callback_.Reset(); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
private:
static void RunNow(
const content::QuotaPermissionContext::PermissionCallback& callback,
bool allow) {
static void RunNow(CallbackType callback, bool allow) {
CEF_REQUIRE_IOT();
callback.Run(
std::move(callback).Run(
allow ? content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW
: content::QuotaPermissionContext::
QUOTA_PERMISSION_RESPONSE_DISALLOW);
}
content::QuotaPermissionContext::PermissionCallback callback_;
CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefQuotaCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefQuotaCallbackImpl);
@ -282,9 +279,10 @@ class CefSelectClientCertificateCallbackImpl
if (CEF_CURRENTLY_ON_UIT()) {
RunNow(std::move(delegate_), cert);
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefSelectClientCertificateCallbackImpl::RunNow,
base::Passed(std::move(delegate_)), cert));
CEF_POST_TASK(
CEF_UIT,
base::BindOnce(&CefSelectClientCertificateCallbackImpl::RunNow,
std::move(delegate_), cert));
}
}
@ -296,9 +294,9 @@ class CefSelectClientCertificateCallbackImpl
if (cert) {
CefX509CertificateImpl* certImpl =
static_cast<CefX509CertificateImpl*>(cert.get());
certImpl->AcquirePrivateKey(
base::Bind(&CefSelectClientCertificateCallbackImpl::RunWithPrivateKey,
base::Passed(std::move(delegate)), cert));
certImpl->AcquirePrivateKey(base::BindOnce(
&CefSelectClientCertificateCallbackImpl::RunWithPrivateKey,
std::move(delegate), cert));
return;
}
@ -334,11 +332,11 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
// The callback will be dispatched on the IO thread.
void RequestQuotaPermission(const content::StorageQuotaParams& params,
int render_process_id,
const PermissionCallback& callback) override {
PermissionCallback callback) override {
if (params.storage_type != blink::mojom::StorageType::kPersistent) {
// To match Chrome behavior we only support requesting quota with this
// interface for Persistent storage type.
callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
std::move(callback).Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
return;
}
@ -353,19 +351,22 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
CefRefPtr<CefRequestHandler> handler = client->GetRequestHandler();
if (handler.get()) {
CefRefPtr<CefQuotaCallbackImpl> callbackImpl(
new CefQuotaCallbackImpl(callback));
new CefQuotaCallbackImpl(std::move(callback)));
handled = handler->OnQuotaRequest(
browser.get(), params.origin_url.spec(), params.requested_size,
callbackImpl.get());
if (!handled)
callbackImpl->Disconnect();
if (!handled) {
// May return nullptr if the client has already executed the
// callback.
callback = callbackImpl->Disconnect();
}
}
}
}
if (!handled) {
if (!handled && !callback.is_null()) {
// Disallow the request by default.
callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
std::move(callback).Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
}
}
@ -843,18 +844,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
}
}
void CefContentBrowserClient::AdjustUtilityServiceProcessCommandLine(
const service_manager::Identity& identity,
base::CommandLine* command_line) {
#if defined(OS_MACOSX)
// On Mac, the video-capture and audio services require a CFRunLoop, provided
// by a UI message loop, to run AVFoundation and CoreAudio code.
// See https://crbug.com/834581
if (identity.name() == audio::mojom::kServiceName)
command_line->AppendSwitch(switches::kMessageLoopTypeUi);
#endif
}
std::string CefContentBrowserClient::GetApplicationLocale() {
return g_browser_process->GetApplicationLocale();
}
@ -884,16 +873,6 @@ CefContentBrowserClient::CreateQuotaPermissionContext() {
return new CefQuotaPermissionContext();
}
void CefContentBrowserClient::GetQuotaSettings(
content::BrowserContext* context,
content::StoragePartition* partition,
base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback) {
const base::FilePath& cache_path = partition->GetPath();
storage::GetNominalDynamicSettings(
cache_path, cache_path.empty() /* is_incognito */,
storage::GetDefaultDeviceInfoHelper(), std::move(callback));
}
content::MediaObserver* CefContentBrowserClient::GetMediaObserver() {
return CefMediaCaptureDevicesDispatcher::GetInstance();
}
@ -1274,6 +1253,7 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,
bool* bypass_redirect_checks,
bool* disable_secure_dns,
network::mojom::URLLoaderFactoryOverridePtr* factory_override) {
auto request_handler = net_service::CreateInterceptedRequestHandler(
browser_context, frame, render_process_id,

View File

@ -63,20 +63,12 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
base::StringPiece name) override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
void AdjustUtilityServiceProcessCommandLine(
const service_manager::Identity& identity,
base::CommandLine* command_line) override;
std::string GetApplicationLocale() override;
scoped_refptr<network::SharedURLLoaderFactory>
GetSystemSharedURLLoaderFactory() override;
network::mojom::NetworkContext* GetSystemNetworkContext() override;
scoped_refptr<content::QuotaPermissionContext> CreateQuotaPermissionContext()
override;
void GetQuotaSettings(
content::BrowserContext* context,
content::StoragePartition* partition,
base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback)
override;
content::MediaObserver* GetMediaObserver() override;
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
@ -172,6 +164,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,
bool* bypass_redirect_checks,
bool* disable_secure_dns,
network::mojom::URLLoaderFactoryOverridePtr* factory_override) override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;

View File

@ -45,7 +45,6 @@
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/cpp/simple_url_loader_stream_consumer.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
@ -59,9 +58,20 @@ static std::string GetFrontendURL() {
}
std::unique_ptr<base::DictionaryValue> BuildObjectForResponse(
const net::HttpResponseHeaders* rh) {
const net::HttpResponseHeaders* rh,
bool success,
int net_error) {
auto response = std::make_unique<base::DictionaryValue>();
response->SetInteger("statusCode", rh ? rh->response_code() : 200);
int responseCode = 200;
if (rh) {
responseCode = rh->response_code();
} else if (!success) {
// In case of no headers, assume file:// URL and failed to load
responseCode = 404;
}
response->SetInteger("statusCode", responseCode);
response->SetInteger("netError", net_error);
response->SetString("netErrorName", net::ErrorToString(net_error));
auto headers = std::make_unique<base::DictionaryValue>();
size_t iterator = 0;
@ -122,7 +132,8 @@ class CefDevToolsFrontend::NetworkResourceLoader
}
void OnComplete(bool success) override {
auto response = BuildObjectForResponse(response_headers_.get());
auto response = BuildObjectForResponse(response_headers_.get(), success,
loader_->NetError());
bindings_->SendMessageAck(request_id_, response.get());
bindings_->loaders_.erase(bindings_->loaders_.find(this));
@ -289,7 +300,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
std::string protocol_message;
if (!agent_host_ || !params->GetString(0, &protocol_message))
return;
agent_host_->DispatchProtocolMessage(this, protocol_message);
agent_host_->DispatchProtocolMessage(
this, base::as_bytes(base::make_span(protocol_message)));
} else if (method == "loadCompleted") {
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"),
@ -308,6 +320,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
if (!gurl.is_valid()) {
base::DictionaryValue response;
response.SetInteger("statusCode", 404);
response.SetBoolean("urlValid", false);
SendMessageAck(request_id, &response);
return;
}
@ -344,7 +357,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
// TODO(caseq): this preserves behavior of URLFetcher-based
// implementation. We really need to pass proper first party origin from
// the front-end.
resource_request->site_for_cookies = gurl;
resource_request->site_for_cookies = net::SiteForCookies::FromUrl(gurl);
resource_request->headers.AddHeadersFromString(headers);
std::unique_ptr<network::mojom::URLLoaderFactory> file_url_loader_factory;
@ -435,10 +448,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
void CefDevToolsFrontend::DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host,
const std::string& message) {
if (message.length() < kMaxMessageChunkSize) {
base::span<const uint8_t> message) {
base::StringPiece str_message(reinterpret_cast<const char*>(message.data()),
message.size());
if (str_message.length() < kMaxMessageChunkSize) {
std::string param;
base::EscapeJSONString(message, true, &param);
base::EscapeJSONString(str_message, true, &param);
std::string code = "DevToolsAPI.dispatchMessage(" + param + ");";
base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
@ -446,10 +461,11 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
return;
}
size_t total_size = message.length();
for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
size_t total_size = str_message.length();
for (size_t pos = 0; pos < str_message.length();
pos += kMaxMessageChunkSize) {
std::string param;
base::EscapeJSONString(message.substr(pos, kMaxMessageChunkSize), true,
base::EscapeJSONString(str_message.substr(pos, kMaxMessageChunkSize), true,
&param);
std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," +
std::to_string(pos ? 0 : total_size) + ");";

View File

@ -66,7 +66,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
// content::DevToolsAgentHostClient implementation.
void AgentHostClosed(content::DevToolsAgentHost* agent_host) override;
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
const std::string& message) override;
base::span<const uint8_t> message) override;
void HandleMessageFromDevToolsFrontend(const std::string& message);
private:

View File

@ -43,11 +43,11 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
CefBeforeDownloadCallbackImpl(const base::WeakPtr<DownloadManager>& manager,
uint32 download_id,
const base::FilePath& suggested_name,
const content::DownloadTargetCallback& callback)
content::DownloadTargetCallback callback)
: manager_(manager),
download_id_(download_id),
suggested_name_(suggested_name),
callback_(callback) {}
callback_(std::move(callback)) {}
void Continue(const CefString& download_path, bool show_dialog) override {
if (CEF_CURRENTLY_ON_UIT()) {
@ -56,28 +56,27 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
if (manager_) {
base::FilePath path = base::FilePath(download_path);
CEF_POST_USER_VISIBLE_TASK(base::Bind(
&CefBeforeDownloadCallbackImpl::GenerateFilename, manager_,
download_id_, suggested_name_, path, show_dialog, callback_));
CEF_POST_USER_VISIBLE_TASK(
base::BindOnce(&CefBeforeDownloadCallbackImpl::GenerateFilename,
manager_, download_id_, suggested_name_, path,
show_dialog, std::move(callback_)));
}
download_id_ = 0;
callback_.Reset();
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBeforeDownloadCallbackImpl::Continue, this,
download_path, show_dialog));
base::BindOnce(&CefBeforeDownloadCallbackImpl::Continue,
this, download_path, show_dialog));
}
}
private:
static void GenerateFilename(
base::WeakPtr<DownloadManager> manager,
uint32 download_id,
const base::FilePath& suggested_name,
const base::FilePath& download_path,
bool show_dialog,
const content::DownloadTargetCallback& callback) {
static void GenerateFilename(base::WeakPtr<DownloadManager> manager,
uint32 download_id,
const base::FilePath& suggested_name,
const base::FilePath& download_path,
bool show_dialog,
content::DownloadTargetCallback callback) {
CEF_REQUIRE_BLOCKING();
base::FilePath suggested_path = download_path;
@ -103,16 +102,16 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
CEF_POST_TASK(
CEF_UIT,
base::Bind(&CefBeforeDownloadCallbackImpl::ChooseDownloadPath, manager,
download_id, suggested_path, show_dialog, callback));
base::BindOnce(&CefBeforeDownloadCallbackImpl::ChooseDownloadPath,
manager, download_id, suggested_path, show_dialog,
std::move(callback)));
}
static void ChooseDownloadPath(
base::WeakPtr<DownloadManager> manager,
uint32 download_id,
const base::FilePath& suggested_path,
bool show_dialog,
const content::DownloadTargetCallback& callback) {
static void ChooseDownloadPath(base::WeakPtr<DownloadManager> manager,
uint32 download_id,
const base::FilePath& suggested_path,
bool show_dialog,
content::DownloadTargetCallback callback) {
if (!manager)
return;
@ -142,21 +141,23 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
browser->RunFileChooser(
params,
base::Bind(
base::BindOnce(
&CefBeforeDownloadCallbackImpl::ChooseDownloadPathCallback,
callback));
std::move(callback)));
}
}
if (!handled) {
callback.Run(suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, suggested_path,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
std::move(callback).Run(
suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::MixedContentStatus::UNKNOWN, suggested_path,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
}
}
static void ChooseDownloadPathCallback(
const content::DownloadTargetCallback& callback,
content::DownloadTargetCallback callback,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths) {
DCHECK_LE(file_paths.size(), (size_t)1);
@ -166,9 +167,10 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
path = file_paths.front();
// The download will be cancelled if |path| is empty.
callback.Run(path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, path,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
std::move(callback).Run(path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::MixedContentStatus::UNKNOWN,
path, download::DOWNLOAD_INTERRUPT_REASON_NONE);
}
base::WeakPtr<DownloadManager> manager_;
@ -347,12 +349,13 @@ void CefDownloadManagerDelegate::ManagerGoingDown(DownloadManager* manager) {
bool CefDownloadManagerDelegate::DetermineDownloadTarget(
DownloadItem* item,
const content::DownloadTargetCallback& callback) {
content::DownloadTargetCallback* callback) {
if (!item->GetForcedFilePath().empty()) {
callback.Run(
std::move(*callback).Run(
item->GetForcedFilePath(), DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, item->GetForcedFilePath(),
download::DOWNLOAD_INTERRUPT_REASON_NONE);
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::MixedContentStatus::UNKNOWN,
item->GetForcedFilePath(), download::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;
}
@ -372,7 +375,7 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
CefRefPtr<CefBeforeDownloadCallback> callbackObj(
new CefBeforeDownloadCallbackImpl(manager_ptr_factory_.GetWeakPtr(),
item->GetId(), suggested_name,
callback));
std::move(*callback)));
handler->OnBeforeDownload(browser.get(), download_item.get(),
suggested_name.value(), callbackObj);
@ -384,9 +387,9 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
}
void CefDownloadManagerDelegate::GetNextId(
const content::DownloadIdCallback& callback) {
content::DownloadIdCallback callback) {
static uint32 next_id = DownloadItem::kInvalidId + 1;
callback.Run(next_id++);
std::move(callback).Run(next_id++);
}
std::string CefDownloadManagerDelegate::ApplicationClientIdForFileScanning() {

View File

@ -37,8 +37,8 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
// DownloadManagerDelegate methods.
bool DetermineDownloadTarget(
download::DownloadItem* item,
const content::DownloadTargetCallback& callback) override;
void GetNextId(const content::DownloadIdCallback& callback) override;
content::DownloadTargetCallback* callback) override;
void GetNextId(content::DownloadIdCallback callback) override;
std::string ApplicationClientIdForFileScanning() override;
// CefBrowserHostImpl::Observer methods.

View File

@ -44,10 +44,9 @@ class CefGetExtensionLoadFileCallbackImpl
if (CEF_CURRENTLY_ON_UIT()) {
RunNow(file_, std::move(callback_), nullptr);
} else {
CEF_POST_TASK(
CEF_UIT,
base::BindOnce(&CefGetExtensionLoadFileCallbackImpl::RunNow, file_,
base::Passed(std::move(callback_)), nullptr));
CEF_POST_TASK(CEF_UIT, base::BindOnce(
&CefGetExtensionLoadFileCallbackImpl::RunNow,
file_, std::move(callback_), nullptr));
}
}
}
@ -56,10 +55,9 @@ class CefGetExtensionLoadFileCallbackImpl
if (CEF_CURRENTLY_ON_UIT()) {
if (!callback_.is_null()) {
// Always continue asynchronously.
CEF_POST_TASK(
CEF_UIT,
base::BindOnce(&CefGetExtensionLoadFileCallbackImpl::RunNow, file_,
base::Passed(std::move(callback_)), stream));
CEF_POST_TASK(CEF_UIT, base::BindOnce(
&CefGetExtensionLoadFileCallbackImpl::RunNow,
file_, std::move(callback_), stream));
}
} else {
CEF_POST_TASK(CEF_UIT, base::BindOnce(

View File

@ -44,6 +44,7 @@
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/service_worker_manager.h"
#include "extensions/browser/state_store.h"
#include "extensions/browser/unloaded_extension_reason.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/file_util.h"
@ -96,9 +97,8 @@ void LoadExtensionOnUIThread(base::WeakPtr<CefExtensionSystem> context,
CefRefPtr<CefExtensionHandler> handler) {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT, base::BindOnce(LoadExtensionOnUIThread, context,
base::Passed(std::move(manifest)),
root_directory, internal,
loader_context, handler));
std::move(manifest), root_directory,
internal, loader_context, handler));
return;
}
@ -447,7 +447,7 @@ AppSorting* CefExtensionSystem::app_sorting() {
// ExtensionSystemImpl::RegisterExtensionWithRequestContexts.
void CefExtensionSystem::RegisterExtensionWithRequestContexts(
const Extension* extension,
const base::Closure& callback) {
base::OnceClosure callback) {
// TODO(extensions): The |incognito_enabled| value should be set based on
// manifest settings.
base::PostTaskAndReply(
@ -456,7 +456,7 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
base::RetainedRef(extension), base::Time::Now(),
true, // incognito_enabled
false), // notifications_disabled
callback);
std::move(callback));
}
// Implementation based on

View File

@ -102,7 +102,7 @@ class CefExtensionSystem : public ExtensionSystem {
AppSorting* app_sorting() override;
void RegisterExtensionWithRequestContexts(
const Extension* extension,
const base::Closure& callback) override;
base::OnceClosure callback) override;
void UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionReason reason) override;

View File

@ -12,7 +12,7 @@
#include "extensions/browser/extension_system.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/runtime_data.h"
#include "third_party/blink/public/platform/web_gesture_event.h"
#include "third_party/blink/public/common/input/web_gesture_event.h"
using content::NativeWebKeyboardEvent;
using content::OpenURLParams;

View File

@ -32,7 +32,6 @@
#include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/extensions_browser_interface_binders.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
#include "extensions/browser/mojo/interface_registration.h"
#include "extensions/browser/url_request_util.h"
#include "extensions/common/api/mime_handler.mojom.h"
#include "extensions/common/constants.h"
@ -307,14 +306,6 @@ void CefExtensionsBrowserClient::RegisterBrowserInterfaceBindersForFrame(
base::BindRepeating(&BindBeforeUnloadControl));
}
void CefExtensionsBrowserClient::RegisterExtensionInterfaces(
service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>*
registry,
content::RenderFrameHost* render_frame_host,
const Extension* extension) const {
RegisterInterfacesForExtension(registry, render_frame_host, extension);
}
std::unique_ptr<RuntimeAPIDelegate>
CefExtensionsBrowserClient::CreateRuntimeAPIDelegate(
content::BrowserContext* context) const {

View File

@ -86,10 +86,6 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
binder_map,
content::RenderFrameHost* render_frame_host,
const Extension* extension) const override;
void RegisterExtensionInterfaces(service_manager::BinderRegistryWithArgs<
content::RenderFrameHost*>* registry,
content::RenderFrameHost* render_frame_host,
const Extension* extension) const override;
std::unique_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
content::BrowserContext* context) const override;
const ComponentExtensionResourceManager*

View File

@ -20,17 +20,20 @@ namespace {
class CefFileDialogCallbackImpl : public CefFileDialogCallback {
public:
explicit CefFileDialogCallbackImpl(
const CefFileDialogRunner::RunFileChooserCallback& callback)
: callback_(callback) {}
using CallbackType = CefFileDialogRunner::RunFileChooserCallback;
explicit CefFileDialogCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {}
~CefFileDialogCallbackImpl() override {
if (!callback_.is_null()) {
// The callback is still pending. Cancel it now.
if (CEF_CURRENTLY_ON_UIT()) {
CancelNow(callback_);
CancelNow(std::move(callback_));
} else {
CEF_POST_TASK(CEF_UIT, base::Bind(&CefFileDialogCallbackImpl::CancelNow,
callback_));
CEF_POST_TASK(CEF_UIT,
base::BindOnce(&CefFileDialogCallbackImpl::CancelNow,
std::move(callback_)));
}
}
}
@ -45,41 +48,36 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback {
for (; it != file_paths.end(); ++it)
vec.push_back(base::FilePath(*it));
}
callback_.Run(selected_accept_filter, vec);
callback_.Reset();
std::move(callback_).Run(selected_accept_filter, vec);
}
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefFileDialogCallbackImpl::Continue, this,
selected_accept_filter, file_paths));
base::BindOnce(&CefFileDialogCallbackImpl::Continue, this,
selected_accept_filter, file_paths));
}
}
void Cancel() override {
if (CEF_CURRENTLY_ON_UIT()) {
if (!callback_.is_null()) {
CancelNow(callback_);
callback_.Reset();
CancelNow(std::move(callback_));
}
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefFileDialogCallbackImpl::Cancel, this));
base::BindOnce(&CefFileDialogCallbackImpl::Cancel, this));
}
}
bool IsConnected() { return !callback_.is_null(); }
void Disconnect() { callback_.Reset(); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
private:
static void CancelNow(
const CefFileDialogRunner::RunFileChooserCallback& callback) {
static void CancelNow(CallbackType callback) {
CEF_REQUIRE_UIT();
std::vector<base::FilePath> file_paths;
callback.Run(0, file_paths);
std::move(callback).Run(0, file_paths);
}
CefFileDialogRunner::RunFileChooserCallback callback_;
CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefFileDialogCallbackImpl);
};
@ -99,16 +97,16 @@ class UploadFolderHelper
: public net::DirectoryLister::DirectoryListerDelegate {
public:
explicit UploadFolderHelper(
const CefFileDialogRunner::RunFileChooserCallback& callback)
: callback_(callback) {}
CefFileDialogRunner::RunFileChooserCallback callback)
: callback_(std::move(callback)) {}
~UploadFolderHelper() override {
if (!callback_.is_null()) {
if (CEF_CURRENTLY_ON_UIT()) {
CancelNow(callback_);
CancelNow(std::move(callback_));
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&UploadFolderHelper::CancelNow, callback_));
CEF_POST_TASK(CEF_UIT, base::BindOnce(&UploadFolderHelper::CancelNow,
std::move(callback_)));
}
}
}
@ -123,17 +121,15 @@ class UploadFolderHelper
void OnListDone(int error) override {
CEF_REQUIRE_UIT();
if (!callback_.is_null()) {
callback_.Run(0, select_files_);
callback_.Reset();
std::move(callback_).Run(0, select_files_);
}
}
private:
static void CancelNow(
const CefFileDialogRunner::RunFileChooserCallback& callback) {
static void CancelNow(CefFileDialogRunner::RunFileChooserCallback callback) {
CEF_REQUIRE_UIT();
std::vector<base::FilePath> file_paths;
callback.Run(0, file_paths);
std::move(callback).Run(0, file_paths);
}
CefFileDialogRunner::RunFileChooserCallback callback_;
@ -215,37 +211,35 @@ void CefFileDialogManager::RunFileChooser(
CefFileDialogRunner::RunFileChooserCallback callback;
if (params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
callback = base::Bind(
callback = base::BindOnce(
&CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode,
base::Passed(std::move(listener)));
weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener));
} else {
callback =
base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode,
base::Passed(std::move(listener)));
callback = base::BindOnce(
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener));
}
RunFileChooserInternal(cef_params, callback);
RunFileChooserInternal(cef_params, std::move(callback));
}
void CefFileDialogManager::RunFileChooser(
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback) {
const CefFileDialogRunner::RunFileChooserCallback& host_callback =
base::Bind(&CefFileDialogManager::OnRunFileChooserCallback,
weak_ptr_factory_.GetWeakPtr(), callback);
RunFileChooserInternal(params, host_callback);
CefFileDialogRunner::RunFileChooserCallback callback) {
CefFileDialogRunner::RunFileChooserCallback host_callback =
base::BindOnce(&CefFileDialogManager::OnRunFileChooserCallback,
weak_ptr_factory_.GetWeakPtr(), std::move(callback));
RunFileChooserInternal(params, std::move(host_callback));
}
void CefFileDialogManager::RunFileChooserInternal(
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback) {
CefFileDialogRunner::RunFileChooserCallback callback) {
CEF_REQUIRE_UIT();
if (file_chooser_pending_) {
// Dismiss the new dialog immediately.
callback.Run(0, std::vector<base::FilePath>());
std::move(callback).Run(0, std::vector<base::FilePath>());
return;
}
@ -289,35 +283,30 @@ void CefFileDialogManager::RunFileChooserInternal(
accept_filters.push_back(*it);
CefRefPtr<CefFileDialogCallbackImpl> callbackImpl(
new CefFileDialogCallbackImpl(callback));
new CefFileDialogCallbackImpl(std::move(callback)));
handled = handler->OnFileDialog(
browser_, static_cast<cef_file_dialog_mode_t>(mode), params.title,
params.default_file_name.value(), accept_filters,
params.selected_accept_filter, callbackImpl.get());
if (!handled) {
if (callbackImpl->IsConnected()) {
callbackImpl->Disconnect();
} else {
// User executed the callback even though they returned false.
NOTREACHED();
handled = true;
}
// May return nullptr if the client has already executed the callback.
callback = callbackImpl->Disconnect();
}
}
}
if (!handled) {
if (!handled && !callback.is_null()) {
if (runner_.get()) {
runner_->Run(browser_, params, callback);
runner_->Run(browser_, params, std::move(callback));
} else {
LOG(WARNING) << "No file dialog runner available for this platform";
callback.Run(0, std::vector<base::FilePath>());
std::move(callback).Run(0, std::vector<base::FilePath>());
}
}
}
void CefFileDialogManager::OnRunFileChooserCallback(
const CefFileDialogRunner::RunFileChooserCallback& callback,
CefFileDialogRunner::RunFileChooserCallback callback,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT();
@ -325,8 +314,8 @@ void CefFileDialogManager::OnRunFileChooserCallback(
Cleanup();
// Execute the callback asynchronously.
CEF_POST_TASK(CEF_UIT,
base::Bind(callback, selected_accept_filter, file_paths));
CEF_POST_TASK(CEF_UIT, base::BindOnce(std::move(callback),
selected_accept_filter, file_paths));
}
void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
@ -344,10 +333,9 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
} else {
lister_.reset(new net::DirectoryLister(
file_paths[0], net::DirectoryLister::NO_SORT_RECURSIVE,
new UploadFolderHelper(
base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), mode,
base::Passed(std::move(listener))))));
new UploadFolderHelper(base::BindOnce(
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), mode, std::move(listener)))));
lister_->Start();
}
}

View File

@ -52,19 +52,18 @@ class CefFileDialogManager {
// Run the file chooser dialog specified by |params|. Only a single dialog may
// be pending at any given time. |callback| will be executed asynchronously
// after the dialog is dismissed or if another dialog is already pending.
void RunFileChooser(
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback);
void RunFileChooser(const CefFileDialogRunner::FileChooserParams& params,
CefFileDialogRunner::RunFileChooserCallback callback);
private:
void RunFileChooserInternal(
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback);
CefFileDialogRunner::RunFileChooserCallback callback);
// Used with the RunFileChooser variant where the caller specifies a callback
// (no associated RenderFrameHost).
void OnRunFileChooserCallback(
const CefFileDialogRunner::RunFileChooserCallback& callback,
CefFileDialogRunner::RunFileChooserCallback callback,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths);

View File

@ -30,7 +30,7 @@ class CefFileDialogRunner {
};
// The argument vector will be empty if the dialog was canceled.
typedef base::Callback<void(int, const std::vector<base::FilePath>&)>
typedef base::OnceCallback<void(int, const std::vector<base::FilePath>&)>
RunFileChooserCallback;
// Display the file chooser dialog. Execute |callback| on completion.

View File

@ -19,17 +19,19 @@ namespace {
class CefJSDialogCallbackImpl : public CefJSDialogCallback {
public:
using Callback = content::JavaScriptDialogManager::DialogClosedCallback;
using CallbackType = content::JavaScriptDialogManager::DialogClosedCallback;
CefJSDialogCallbackImpl(Callback callback) : callback_(std::move(callback)) {}
CefJSDialogCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {}
~CefJSDialogCallbackImpl() override {
if (!callback_.is_null()) {
// The callback is still pending. Cancel it now.
if (CEF_CURRENTLY_ON_UIT()) {
CancelNow(std::move(callback_));
} else {
CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::CancelNow,
base::Passed(std::move(callback_))));
CEF_POST_TASK(CEF_UIT,
base::BindOnce(&CefJSDialogCallbackImpl::CancelNow,
std::move(callback_)));
}
}
}
@ -40,20 +42,20 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback {
std::move(callback_).Run(success, user_input);
}
} else {
CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::Continue,
this, success, user_input));
CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefJSDialogCallbackImpl::Continue,
this, success, user_input));
}
}
Callback Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
private:
static void CancelNow(Callback callback) {
static void CancelNow(CallbackType callback) {
CEF_REQUIRE_UIT();
std::move(callback).Run(false, base::string16());
}
Callback callback_;
CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefJSDialogCallbackImpl);
};
@ -130,11 +132,10 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog(
url_formatter::FormatUrlForSecurityDisplay(origin_url);
DCHECK(!callback.is_null());
runner_->Run(browser_, message_type, display_url, message_text,
default_prompt_text,
base::Bind(&CefJavaScriptDialogManager::DialogClosed,
weak_ptr_factory_.GetWeakPtr(),
base::Passed(std::move(callback))));
runner_->Run(
browser_, message_type, display_url, message_text, default_prompt_text,
base::BindOnce(&CefJavaScriptDialogManager::DialogClosed,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
@ -185,13 +186,13 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
dialog_running_ = true;
DCHECK(!callback.is_null());
runner_->Run(browser_, content::JAVASCRIPT_DIALOG_TYPE_CONFIRM,
base::string16(), // display_url
message_text,
base::string16(), // default_prompt_text
base::Bind(&CefJavaScriptDialogManager::DialogClosed,
weak_ptr_factory_.GetWeakPtr(),
base::Passed(std::move(callback))));
runner_->Run(
browser_, content::JAVASCRIPT_DIALOG_TYPE_CONFIRM,
base::string16(), // display_url
message_text,
base::string16(), // default_prompt_text
base::BindOnce(&CefJavaScriptDialogManager::DialogClosed,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void CefJavaScriptDialogManager::CancelDialogs(

View File

@ -15,8 +15,8 @@ class CefBrowserHostImpl;
class CefJavaScriptDialogRunner {
public:
typedef base::Callback<void(bool /* success */,
const base::string16& /* user_input */)>
typedef base::OnceCallback<void(bool /* success */,
const base::string16& /* user_input */)>
DialogClosedCallback;
// Run the dialog. Execute |callback| on completion.
@ -25,7 +25,7 @@ class CefJavaScriptDialogRunner {
const base::string16& display_url,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback) = 0;
DialogClosedCallback callback) = 0;
// Cancel a dialog mid-flight.
virtual void Cancel() = 0;

View File

@ -8,7 +8,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
CefBrowserPlatformDelegateNative::CefBrowserPlatformDelegateNative(
const CefWindowInfo& window_info,

View File

@ -21,9 +21,9 @@
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "third_party/blink/public/platform/web_input_event.h"
#include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#import "ui/base/cocoa/cocoa_base_utils.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/events/base_event_utils.h"

View File

@ -22,8 +22,8 @@
#include "base/win/registry.h"
#include "base/win/win_util.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#include "ui/aura/window.h"
#include "ui/base/win/shell.h"
#include "ui/display/display.h"

View File

@ -9,6 +9,10 @@
#include "libcef/browser/file_dialog_runner.h"
#include "base/memory/weak_ptr.h"
@class NSView;
class CefFileDialogRunnerMac : public CefFileDialogRunner {
public:
CefFileDialogRunnerMac();
@ -17,6 +21,21 @@ class CefFileDialogRunnerMac : public CefFileDialogRunner {
void Run(CefBrowserHostImpl* browser,
const FileChooserParams& params,
RunFileChooserCallback callback) override;
private:
static void RunOpenFileDialog(
base::WeakPtr<CefFileDialogRunnerMac> weak_this,
const CefFileDialogRunner::FileChooserParams& params,
NSView* view,
int filter_index);
static void RunSaveFileDialog(
base::WeakPtr<CefFileDialogRunnerMac> weak_this,
const CefFileDialogRunner::FileChooserParams& params,
NSView* view,
int filter_index);
CefFileDialogRunner::RunFileChooserCallback callback_;
base::WeakPtrFactory<CefFileDialogRunnerMac> weak_ptr_factory_;
};
#endif // CEF_LIBCEF_BROWSER_NATIVE_FILE_DIALOG_RUNNER_MAC_H_

View File

@ -229,12 +229,34 @@ void AddFilters(NSPopUpButton* button,
@end
namespace {
CefFileDialogRunnerMac::CefFileDialogRunnerMac() : weak_ptr_factory_(this) {}
void RunOpenFileDialog(const CefFileDialogRunner::FileChooserParams& params,
NSView* view,
int filter_index,
CefFileDialogRunner::RunFileChooserCallback callback) {
void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser,
const FileChooserParams& params,
RunFileChooserCallback callback) {
callback_ = std::move(callback);
int filter_index = params.selected_accept_filter;
NSView* owner = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(browser->GetWindowHandle());
auto weak_this = weak_ptr_factory_.GetWeakPtr();
if (params.mode == blink::mojom::FileChooserParams::Mode::kOpen ||
params.mode == blink::mojom::FileChooserParams::Mode::kOpenMultiple ||
params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
RunOpenFileDialog(weak_this, params, owner, filter_index);
} else if (params.mode == blink::mojom::FileChooserParams::Mode::kSave) {
RunSaveFileDialog(weak_this, params, owner, filter_index);
} else {
NOTIMPLEMENTED();
}
}
// static
void CefFileDialogRunnerMac::RunOpenFileDialog(
base::WeakPtr<CefFileDialogRunnerMac> weak_this,
const CefFileDialogRunner::FileChooserParams& params,
NSView* view,
int filter_index) {
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
base::string16 title;
@ -308,18 +330,21 @@ void RunOpenFileDialog(const CefFileDialogRunner::FileChooserParams& params,
if (url.isFileURL)
files.push_back(base::FilePath(url.path.UTF8String));
}
callback.Run(filter_index_to_use, files);
std::move(weak_this->callback_)
.Run(filter_index_to_use, files);
} else {
callback.Run(filter_index_to_use,
std::vector<base::FilePath>());
std::move(weak_this->callback_)
.Run(filter_index_to_use, std::vector<base::FilePath>());
}
}];
}
void RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params,
NSView* view,
int filter_index,
CefFileDialogRunner::RunFileChooserCallback callback) {
// static
void CefFileDialogRunnerMac::RunSaveFileDialog(
base::WeakPtr<CefFileDialogRunnerMac> weak_this,
const CefFileDialogRunner::FileChooserParams& params,
NSView* view,
int filter_index) {
NSSavePanel* savePanel = [NSSavePanel savePanel];
base::string16 title;
@ -371,31 +396,11 @@ void RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params,
NSURL* url = savePanel.URL;
const char* path = url.path.UTF8String;
std::vector<base::FilePath> files(1, base::FilePath(path));
callback.Run(filter_index_to_use, files);
std::move(weak_this->callback_)
.Run(filter_index_to_use, files);
} else {
callback.Run(filter_index_to_use,
std::vector<base::FilePath>());
std::move(weak_this->callback_)
.Run(filter_index_to_use, std::vector<base::FilePath>());
}
}];
}
} // namespace
CefFileDialogRunnerMac::CefFileDialogRunnerMac() {}
void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser,
const FileChooserParams& params,
RunFileChooserCallback callback) {
int filter_index = params.selected_accept_filter;
NSView* owner = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(browser->GetWindowHandle());
if (params.mode == blink::mojom::FileChooserParams::Mode::kOpen ||
params.mode == blink::mojom::FileChooserParams::Mode::kOpenMultiple ||
params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
RunOpenFileDialog(params, owner, filter_index, callback);
} else if (params.mode == blink::mojom::FileChooserParams::Mode::kSave) {
RunSaveFileDialog(params, owner, filter_index, callback);
} else {
NOTIMPLEMENTED();
}
}

View File

@ -520,5 +520,5 @@ void CefFileDialogRunnerWin::Run(CefBrowserHostImpl* browser,
NOTIMPLEMENTED();
}
callback.Run(filter_index, files);
std::move(callback).Run(filter_index, files);
}

View File

@ -29,7 +29,7 @@ class CefJavaScriptDialogRunnerMac : public CefJavaScriptDialogRunner {
const base::string16& display_url,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback) override;
DialogClosedCallback callback) override;
void Cancel() override;
// Callback from CefJavaScriptDialogHelper when the dialog is closed.

View File

@ -38,7 +38,7 @@
- (id)initHelperWithCallback:
(CefJavaScriptDialogRunner::DialogClosedCallback)callback {
if (self = [super init])
callback_ = callback;
callback_ = std::move(callback);
return self;
}
@ -69,7 +69,7 @@
if (textField_)
input = base::SysNSStringToUTF16([textField_ stringValue]);
callback_.Run(success, input);
std::move(callback_).Run(success, input);
}
- (void)cancel {
@ -92,15 +92,15 @@ void CefJavaScriptDialogRunnerMac::Run(
const base::string16& display_url,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback) {
DialogClosedCallback callback) {
DCHECK(!helper_.get());
callback_ = callback;
callback_ = std::move(callback);
bool text_field = message_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT;
bool one_button = message_type == content::JAVASCRIPT_DIALOG_TYPE_ALERT;
helper_.reset([[CefJavaScriptDialogHelper alloc]
initHelperWithCallback:base::Bind(
initHelperWithCallback:base::BindOnce(
&CefJavaScriptDialogRunnerMac::DialogClosed,
weak_ptr_factory_.GetWeakPtr())]);
@ -167,5 +167,5 @@ void CefJavaScriptDialogRunnerMac::DialogClosed(
bool success,
const base::string16& user_input) {
helper_.reset(nil);
callback_.Run(success, user_input);
std::move(callback_).Run(success, user_input);
}

View File

@ -96,13 +96,13 @@ void CefJavaScriptDialogRunnerWin::Run(
const base::string16& display_url,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback) {
DialogClosedCallback callback) {
DCHECK(!dialog_win_);
message_type_ = message_type;
message_text_ = message_text;
default_prompt_text_ = default_prompt_text;
callback_ = callback;
callback_ = std::move(callback);
InstallMessageHook();
hook_installed_ = true;
@ -177,8 +177,7 @@ void CefJavaScriptDialogRunnerWin::CloseDialog(
// cleared. Otherwise, RenderWidgetHostImpl::IsIgnoringInputEvents will
// return true and RenderWidgetHostViewAura::OnWindowFocused will fail to
// re-assign browser focus.
callback_.Run(success, user_input);
callback_.Reset();
std::move(callback_).Run(success, user_input);
Cancel();
}

View File

@ -22,7 +22,7 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner {
const base::string16& display_url,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback) override;
DialogClosedCallback callback) override;
void Cancel() override;
private:

View File

@ -37,7 +37,7 @@ struct CefNavigateParams {
// lead to undesired cookie blocking. Third-party cookie blocking can be
// bypassed by setting site_for_cookies = url, but this should ideally
// only be done if there really is no way to determine the correct value.
GURL site_for_cookies;
net::SiteForCookies site_for_cookies;
// Additional HTTP request headers.
std::string headers;

View File

@ -17,7 +17,7 @@ namespace {
void UpdateCRLSet(const std::string& crl_set_bytes) {
CEF_REQUIRE_UIT();
content::GetNetworkService()->UpdateCRLSet(
base::as_bytes(base::make_span(crl_set_bytes)));
base::as_bytes(base::make_span(crl_set_bytes)), base::DoNothing());
}
void LoadFromDisk(const base::FilePath& path) {

View File

@ -280,7 +280,7 @@ class CefBrowserURLRequest::Context
// Associate the request with |request_id|.
request_id_ = request_id;
loader_->SetRequestId(request_id);
loader_->SetRequestID(request_id);
g_manager.Get().Add(request_id, url_request_, client_);
if (request_body) {

View File

@ -15,7 +15,6 @@
#include "net/cookies/cookie_util.h"
#include "services/network/cookie_manager.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/resource_response.h"
namespace net_service {
@ -169,14 +168,14 @@ void LoadCookies(content::BrowserContext* browser_context,
void SaveCookies(content::BrowserContext* browser_context,
const network::ResourceRequest& request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
const AllowCookieCallback& allow_cookie_callback,
DoneCookieCallback done_callback) {
CEF_REQUIRE_IOT();
if (request.credentials_mode == network::mojom::CredentialsMode::kOmit ||
request.url.IsAboutBlank() || !head.headers ||
!head.headers->HasHeader(net_service::kHTTPSetCookieHeaderName)) {
request.url.IsAboutBlank() || !headers ||
!headers->HasHeader(net_service::kHTTPSetCookieHeaderName)) {
// Continue immediately without saving cookies.
std::move(done_callback).Run(0, {});
return;
@ -185,7 +184,7 @@ void SaveCookies(content::BrowserContext* browser_context,
// Match the logic in
// URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete.
base::Time response_date;
if (!head.headers->GetDateValue(&response_date))
if (!headers->GetDateValue(&response_date))
response_date = base::Time();
net::CookieOptions options;
@ -201,7 +200,7 @@ void SaveCookies(content::BrowserContext* browser_context,
net::CookieList allowed_cookies;
int total_count = 0;
while (head.headers->EnumerateHeader(&iter, name, &cookie_string)) {
while (headers->EnumerateHeader(&iter, name, &cookie_string)) {
total_count++;
net::CanonicalCookie::CookieInclusionStatus returned_status;

View File

@ -12,9 +12,12 @@ namespace content {
class BrowserContext;
}
namespace net {
class HttpResponseHeaders;
}
namespace network {
struct ResourceRequest;
struct ResourceResponseHead;
} // namespace network
namespace net_service {
@ -45,7 +48,7 @@ void LoadCookies(content::BrowserContext* browser_context,
// on the IO thread.
void SaveCookies(content::BrowserContext* browser_context,
const network::ResourceRequest& request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
const AllowCookieCallback& allow_cookie_callback,
DoneCookieCallback done_callback);

View File

@ -11,7 +11,7 @@
#include "base/barrier_closure.h"
#include "base/strings/string_number_conversions.h"
#include "components/safe_browsing/common/safebrowsing_constants.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/resource_context.h"
@ -245,7 +245,8 @@ class InterceptedRequest : public network::mojom::URLLoader,
bool waiting_for_upload_progress_ack_ = false;
network::ResourceRequest request_;
network::ResourceResponseHead current_response_;
network::mojom::URLResponseHeadPtr current_response_;
scoped_refptr<net::HttpResponseHeaders> current_headers_;
scoped_refptr<net::HttpResponseHeaders> override_headers_;
GURL original_url_;
GURL redirect_url_;
@ -426,16 +427,15 @@ void InterceptedRequest::OnHeadersReceived(
return;
}
current_response_.headers =
base::MakeRefCounted<net::HttpResponseHeaders>(headers);
current_headers_ = base::MakeRefCounted<net::HttpResponseHeaders>(headers);
on_headers_received_callback_ = std::move(callback);
base::Optional<net::RedirectInfo> redirect_info;
std::string location;
if (current_response_.headers->IsRedirect(&location)) {
if (current_headers_->IsRedirect(&location)) {
const GURL new_url = request_.url.Resolve(location);
redirect_info =
MakeRedirectInfo(request_, current_response_.headers.get(), new_url, 0);
MakeRedirectInfo(request_, current_headers_.get(), new_url, 0);
}
HandleResponseOrRedirectHeaders(
@ -448,16 +448,16 @@ void InterceptedRequest::OnHeadersReceived(
void InterceptedRequest::OnReceiveResponse(
network::mojom::URLResponseHeadPtr head) {
current_response_ = std::move(head);
if (current_request_uses_header_client_) {
// Use the headers we got from OnHeadersReceived as that'll contain
// Set-Cookie if it existed.
auto saved_headers = current_response_.headers;
DCHECK(saved_headers);
current_response_ = head;
current_response_.headers = saved_headers;
DCHECK(current_headers_);
current_response_->headers = current_headers_;
current_headers_ = nullptr;
ContinueToResponseStarted(net::OK);
} else {
current_response_ = head;
HandleResponseOrRedirectHeaders(
base::nullopt,
base::BindOnce(&InterceptedRequest::ContinueToResponseStarted,
@ -470,16 +470,15 @@ void InterceptedRequest::OnReceiveRedirect(
network::mojom::URLResponseHeadPtr head) {
bool needs_callback = false;
current_response_ = std::move(head);
if (current_request_uses_header_client_) {
// Use the headers we got from OnHeadersReceived as that'll contain
// Set-Cookie if it existed. May be null for synthetic redirects.
auto saved_headers = current_response_.headers;
current_response_ = head;
if (saved_headers) {
current_response_.headers = saved_headers;
}
DCHECK(current_headers_);
current_response_->headers = current_headers_;
current_headers_ = nullptr;
} else {
current_response_ = head;
needs_callback = true;
}
@ -625,33 +624,35 @@ void InterceptedRequest::InterceptResponseReceived(
DCHECK(!response);
// Perform the redirect.
network::ResourceResponseHead head;
head.request_start = base::TimeTicks::Now();
head.response_start = base::TimeTicks::Now();
head.headers = MakeResponseHeaders(
current_response_ = network::mojom::URLResponseHead::New();
current_response_->request_start = base::TimeTicks::Now();
current_response_->response_start = base::TimeTicks::Now();
auto headers = MakeResponseHeaders(
net::HTTP_TEMPORARY_REDIRECT, std::string(), std::string(),
std::string(), -1, {}, false /* allow_existing_header_override */);
current_response_->headers = headers;
head.encoded_data_length = head.headers->raw_headers().length();
head.content_length = head.encoded_body_length = 0;
current_response_->encoded_data_length = headers->raw_headers().length();
current_response_->content_length = current_response_->encoded_body_length =
0;
std::string origin;
if (request_.headers.GetHeader(net::HttpRequestHeaders::kOrigin, &origin) &&
origin != url::Origin().Serialize()) {
// Allow redirects of cross-origin resource loads.
head.headers->AddHeader(MakeHeader(
headers->AddHeader(MakeHeader(
network::cors::header_names::kAccessControlAllowOrigin, origin));
}
if (request_.credentials_mode ==
network::mojom::CredentialsMode::kInclude) {
head.headers->AddHeader(MakeHeader(
headers->AddHeader(MakeHeader(
network::cors::header_names::kAccessControlAllowCredentials, "true"));
}
current_response_ = head;
const net::RedirectInfo& redirect_info =
MakeRedirectInfo(request_, head.headers.get(), request_.url, 0);
MakeRedirectInfo(request_, headers.get(), request_.url, 0);
HandleResponseOrRedirectHeaders(
redirect_info,
base::BindOnce(&InterceptedRequest::ContinueToBeforeRedirect,
@ -715,17 +716,21 @@ void InterceptedRequest::HandleResponseOrRedirectHeaders(
redirect_url_ = redirect_info.has_value() ? redirect_info->new_url : GURL();
original_url_ = request_.url;
// |current_response_| may be nullptr when called from OnHeadersReceived.
auto headers =
current_response_ ? current_response_->headers : current_headers_;
// Even though |head| is const we can get a non-const pointer to the headers
// and modifications we make are passed to the target client.
factory_->request_handler_->ProcessResponseHeaders(
id_, request_, redirect_url_, current_response_);
id_, request_, redirect_url_, headers.get());
// Pause handling of client messages before waiting on an async callback.
if (proxied_client_binding_)
proxied_client_binding_.PauseIncomingMethodCallProcessing();
factory_->request_handler_->OnRequestResponse(
id_, &request_, current_response_, redirect_info,
id_, &request_, headers.get(), redirect_info,
base::BindOnce(&InterceptedRequest::ContinueResponseOrRedirect,
weak_factory_.GetWeakPtr(), std::move(continuation)));
}
@ -749,7 +754,7 @@ void InterceptedRequest::ContinueResponseOrRedirect(
// Make sure to update current_response_, since when OnReceiveResponse
// is called we will not use its headers as it might be missing the
// Set-Cookie line (which gets stripped by the IPC layer).
current_response_.headers = override_headers_;
current_response_->headers = override_headers_;
}
redirect_url_ = redirect_url;
@ -780,21 +785,22 @@ void InterceptedRequest::ContinueToHandleOverrideHeaders(int error_code) {
net::RedirectInfo InterceptedRequest::MakeRedirectResponseAndInfo(
const GURL& new_location) {
// Clear the Content-Type values.
current_response_.mime_type = current_response_.charset = std::string();
current_response_.headers->RemoveHeader(
current_response_->mime_type = current_response_->charset = std::string();
current_response_->headers->RemoveHeader(
net::HttpRequestHeaders::kContentType);
// Clear the Content-Length values.
current_response_.content_length = current_response_.encoded_body_length = 0;
current_response_.headers->RemoveHeader(
current_response_->content_length = current_response_->encoded_body_length =
0;
current_response_->headers->RemoveHeader(
net::HttpRequestHeaders::kContentLength);
current_response_.encoded_data_length =
current_response_.headers->raw_headers().size();
current_response_->encoded_data_length =
current_response_->headers->raw_headers().size();
const net::RedirectInfo& redirect_info = MakeRedirectInfo(
request_, current_response_.headers.get(), new_location, 0);
current_response_.headers->ReplaceStatusLine(
request_, current_response_->headers.get(), new_location, 0);
current_response_->headers->ReplaceStatusLine(
MakeStatusLine(redirect_info.status_code, std::string(), true));
return redirect_info;
@ -824,10 +830,12 @@ void InterceptedRequest::ContinueToBeforeRedirect(
if (redirect_url.is_valid()) {
net::RedirectInfo new_redirect_info = redirect_info;
new_redirect_info.new_url = redirect_url;
target_client_->OnReceiveRedirect(new_redirect_info, current_response_);
target_client_->OnReceiveRedirect(new_redirect_info,
std::move(current_response_));
request_.url = redirect_url;
} else {
target_client_->OnReceiveRedirect(redirect_info, current_response_);
target_client_->OnReceiveRedirect(redirect_info,
std::move(current_response_));
request_.url = redirect_info.new_url;
}
@ -854,8 +862,8 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) {
std::string location;
const bool is_redirect = redirect_url.is_valid() ||
(current_response_.headers &&
current_response_.headers->IsRedirect(&location));
(current_response_->headers &&
current_response_->headers->IsRedirect(&location));
if (stream_loader_ && is_redirect) {
// Redirecting from OnReceiveResponse generally isn't supported by the
// NetworkService, so we can only support it when using a custom loader.
@ -879,7 +887,7 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) {
if (proxied_client_binding_)
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
target_client_->OnReceiveResponse(current_response_);
target_client_->OnReceiveResponse(std::move(current_response_));
}
if (stream_loader_)
@ -1012,7 +1020,7 @@ void InterceptedRequestHandler::ShouldInterceptRequest(
void InterceptedRequestHandler::OnRequestResponse(
const RequestId& id,
network::ResourceRequest* request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
base::Optional<net::RedirectInfo> redirect_info,
OnRequestResponseResultCallback callback) {
std::move(callback).Run(

View File

@ -18,7 +18,6 @@
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
@ -76,11 +75,10 @@ class InterceptedRequestHandler {
// method is called in response to a redirect. Even though |head| is const the
// |head.headers| value is non-const and any changes will be passed to the
// client.
virtual void ProcessResponseHeaders(
const RequestId& id,
const network::ResourceRequest& request,
const GURL& redirect_url,
const network::ResourceResponseHead& head) {}
virtual void ProcessResponseHeaders(const RequestId& id,
const network::ResourceRequest& request,
const GURL& redirect_url,
net::HttpResponseHeaders* headers) {}
enum class ResponseMode {
// Continue the request.
@ -101,7 +99,7 @@ class InterceptedRequestHandler {
virtual void OnRequestResponse(
const RequestId& id,
network::ResourceRequest* request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
base::Optional<net::RedirectInfo> redirect_info,
OnRequestResponseResultCallback callback);

View File

@ -592,7 +592,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
new RequestCallbackWrapper(base::BindOnce(
&InterceptedRequestHandlerWrapper::ContinueShouldInterceptRequest,
weak_ptr_factory_.GetWeakPtr(), id, base::Unretained(request),
base::Passed(std::move(callback))));
std::move(callback)));
cef_return_value_t retval = state->handler_->OnBeforeResourceLoad(
init_state_->browser_, init_state_->frame_,
@ -687,11 +687,10 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
std::move(callback).Run(std::move(resource_response));
}
void ProcessResponseHeaders(
const RequestId& id,
const network::ResourceRequest& request,
const GURL& redirect_url,
const network::ResourceResponseHead& head) override {
void ProcessResponseHeaders(const RequestId& id,
const network::ResourceRequest& request,
const GURL& redirect_url,
net::HttpResponseHeaders* headers) override {
CEF_REQUIRE_IOT();
RequestState* state = GetState(id);
@ -708,15 +707,15 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
else
state->pending_response_->SetReadOnly(false);
if (head.headers)
state->pending_response_->SetResponseHeaders(*head.headers);
if (headers)
state->pending_response_->SetResponseHeaders(*headers);
state->pending_response_->SetReadOnly(true);
}
void OnRequestResponse(const RequestId& id,
network::ResourceRequest* request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
base::Optional<net::RedirectInfo> redirect_info,
OnRequestResponseResultCallback callback) override {
CEF_REQUIRE_IOT();
@ -735,7 +734,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
if (!state->handler_) {
// Cookies may come from a scheme handler.
MaybeSaveCookies(
id, state, request, head,
id, state, request, headers,
base::BindOnce(
std::move(callback), ResponseMode::CONTINUE, nullptr,
redirect_info.has_value() ? redirect_info->new_url : GURL()));
@ -746,17 +745,17 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
DCHECK(state->pending_response_);
if (redirect_info.has_value()) {
HandleRedirect(id, state, request, head, *redirect_info,
HandleRedirect(id, state, request, headers, *redirect_info,
std::move(callback));
} else {
HandleResponse(id, state, request, head, std::move(callback));
HandleResponse(id, state, request, headers, std::move(callback));
}
}
void HandleRedirect(const RequestId& id,
RequestState* state,
network::ResourceRequest* request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
const net::RedirectInfo& redirect_info,
OnRequestResponseResultCallback callback) {
GURL new_url = redirect_info.new_url;
@ -786,13 +785,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
auto exec_callback = base::BindOnce(
std::move(callback), ResponseMode::CONTINUE, nullptr, new_url);
MaybeSaveCookies(id, state, request, head, std::move(exec_callback));
MaybeSaveCookies(id, state, request, headers, std::move(exec_callback));
}
void HandleResponse(const RequestId& id,
RequestState* state,
network::ResourceRequest* request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
OnRequestResponseResultCallback callback) {
// The client may modify |pending_request_| in OnResourceResponse.
state->pending_request_->SetReadOnly(false);
@ -835,13 +834,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
return;
}
MaybeSaveCookies(id, state, request, head, std::move(exec_callback));
MaybeSaveCookies(id, state, request, headers, std::move(exec_callback));
}
void MaybeSaveCookies(const RequestId& id,
RequestState* state,
network::ResourceRequest* request,
const network::ResourceResponseHead& head,
net::HttpResponseHeaders* headers,
base::OnceClosure callback) {
CEF_REQUIRE_IOT();
@ -863,7 +862,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
auto done_cookie_callback = base::BindOnce(
&InterceptedRequestHandlerWrapper::ContinueWithSavedCookies,
weak_ptr_factory_.GetWeakPtr(), id, std::move(callback));
net_service::SaveCookies(init_state_->browser_context_, *request, head,
net_service::SaveCookies(init_state_->browser_context_, *request, headers,
allow_cookie_callback,
std::move(done_cookie_callback));
}

View File

@ -420,8 +420,8 @@ void InputStreamReader::RunSkipCallback(int64_t bytes_skipped) {
DCHECK(!pending_skip_callback_.is_null());
job_thread_task_runner_->PostTask(
FROM_HERE,
base::Bind(InputStreamReader::RunSkipCallbackOnJobThread, bytes_skipped,
base::Passed(std::move(pending_skip_callback_))));
base::BindOnce(InputStreamReader::RunSkipCallbackOnJobThread,
bytes_skipped, std::move(pending_skip_callback_)));
// Reset callback state.
pending_callback_id_ = -1;
@ -433,9 +433,8 @@ void InputStreamReader::RunReadCallback(int bytes_read) {
DCHECK(!pending_read_callback_.is_null());
job_thread_task_runner_->PostTask(
FROM_HERE,
base::Bind(InputStreamReader::RunReadCallbackOnJobThread, bytes_read,
base::Passed(std::move(pending_read_callback_))));
FROM_HERE, base::BindOnce(InputStreamReader::RunReadCallbackOnJobThread,
bytes_read, std::move(pending_read_callback_)));
// Reset callback state.
pending_callback_id_ = -1;
@ -640,32 +639,38 @@ void StreamReaderURLLoader::HeadersComplete(int orig_status_code,
return;
}
pending_response_.request_start = base::TimeTicks::Now();
pending_response_.response_start = base::TimeTicks::Now();
pending_response_.headers = MakeResponseHeaders(
auto pending_response = network::mojom::URLResponseHead::New();
pending_response->request_start = base::TimeTicks::Now();
pending_response->response_start = base::TimeTicks::Now();
auto headers = MakeResponseHeaders(
status_code, status_text, mime_type, charset, content_length,
extra_headers, false /* allow_existing_header_override */);
pending_response->headers = headers;
if (content_length >= 0)
pending_response_.content_length = content_length;
pending_response->content_length = content_length;
if (!mime_type.empty()) {
pending_response_.mime_type = mime_type;
pending_response->mime_type = mime_type;
if (!charset.empty())
pending_response_.charset = charset;
pending_response->charset = charset;
}
if (header_client_.is_bound()) {
header_client_->OnHeadersReceived(
pending_response_.headers->raw_headers(), net::IPEndPoint(),
headers->raw_headers(), net::IPEndPoint(),
base::BindOnce(&StreamReaderURLLoader::ContinueWithResponseHeaders,
weak_factory_.GetWeakPtr()));
weak_factory_.GetWeakPtr(),
std::move(pending_response)));
} else {
ContinueWithResponseHeaders(net::OK, base::nullopt, GURL());
ContinueWithResponseHeaders(std::move(pending_response), net::OK,
base::nullopt, base::nullopt);
}
}
void StreamReaderURLLoader::ContinueWithResponseHeaders(
network::mojom::URLResponseHeadPtr pending_response,
int32_t result,
const base::Optional<std::string>& headers,
const base::Optional<GURL>& redirect_url) {
@ -676,34 +681,35 @@ void StreamReaderURLLoader::ContinueWithResponseHeaders(
if (headers) {
DCHECK(header_client_.is_bound());
pending_response_.headers =
pending_response->headers =
base::MakeRefCounted<net::HttpResponseHeaders>(*headers);
}
auto pending_headers = pending_response->headers;
// What the length would be if we sent headers over the network. Used to
// calculate data length.
header_length_ = pending_response_.headers->raw_headers().length();
header_length_ = pending_headers->raw_headers().length();
DCHECK(client_.is_bound());
std::string location;
const auto has_redirect_url = redirect_url && !redirect_url->is_empty();
if (has_redirect_url || pending_response_.headers->IsRedirect(&location)) {
pending_response_.encoded_data_length = header_length_;
pending_response_.content_length = pending_response_.encoded_body_length =
if (has_redirect_url || pending_headers->IsRedirect(&location)) {
pending_response->encoded_data_length = header_length_;
pending_response->content_length = pending_response->encoded_body_length =
0;
const GURL new_location =
has_redirect_url ? *redirect_url : request_.url.Resolve(location);
client_->OnReceiveRedirect(
MakeRedirectInfo(request_, pending_response_.headers.get(),
new_location,
pending_response_.headers->response_code()),
pending_response_);
MakeRedirectInfo(request_, pending_headers.get(), new_location,
pending_headers->response_code()),
std::move(pending_response));
// The client will restart the request with a new loader.
// |this| will be deleted.
CleanUp();
} else {
client_->OnReceiveResponse(pending_response_);
client_->OnReceiveResponse(std::move(pending_response));
}
}

View File

@ -13,9 +13,9 @@
#include "mojo/public/cpp/system/simple_watcher.h"
#include "net/http/http_byte_range.h"
#include "services/network/public/cpp/net_adapters.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
namespace net_service {
@ -188,9 +188,11 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
void OnReaderSkipCompleted(int64_t bytes_skipped);
void HeadersComplete(int status_code, int64_t expected_content_length);
void ContinueWithResponseHeaders(int32_t result,
const base::Optional<std::string>& headers,
const base::Optional<GURL>& redirect_url);
void ContinueWithResponseHeaders(
network::mojom::URLResponseHeadPtr pending_response,
int32_t result,
const base::Optional<std::string>& headers,
const base::Optional<GURL>& redirect_url);
void SendBody();
void ReadMore();
@ -205,8 +207,6 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
const RequestId request_id_;
network::ResourceResponseHead pending_response_;
size_t header_length_ = 0;
int64_t total_bytes_read_ = 0;

View File

@ -64,7 +64,8 @@ scoped_refptr<URLLoaderFactoryGetter> URLLoaderFactoryGetter::Create(
content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource,
url::Origin(), base::nullopt /* navigation_id */,
&maybe_proxy_factory_request, nullptr /* header_client */,
nullptr /* bypass_redirect_checks */, nullptr /* factory_override */);
nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */,
nullptr /* factory_override */);
// If anyone above indicated that they care about proxying, pass the
// intermediate pipe along to the URLLoaderFactoryGetter.

View File

@ -9,7 +9,7 @@
#include "include/cef_base.h"
#include "third_party/blink/public/platform/web_touch_event.h"
#include "third_party/blink/public/common/input/web_touch_event.h"
#include "ui/events/gesture_detection/motion_event_generic.h"
// Implementation of MotionEvent which takes a stream of CefTouchEvents.

View File

@ -103,7 +103,7 @@ struct PopulateAxNodeAttributes {
case ax::mojom::IntAttribute::kActivedescendantId:
case ax::mojom::IntAttribute::kInPageLinkTargetId:
case ax::mojom::IntAttribute::kErrormessageId:
case ax::mojom::IntAttribute::kDetailsId:
case ax::mojom::IntAttribute::kDOMNodeId:
case ax::mojom::IntAttribute::kDropeffect:
case ax::mojom::IntAttribute::kMemberOfId:
case ax::mojom::IntAttribute::kNextFocusId:

View File

@ -64,7 +64,7 @@ const size_t kMaxDamageRects = 10;
const float kDefaultScaleFactor = 1.0;
static content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
content::ScreenInfo screenInfo;
screenInfo.device_scale_factor = src.device_scale_factor;
screenInfo.depth = src.depth;
@ -104,12 +104,6 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
return *view_->GetBackgroundColor();
}
void OnBeginFrame(base::TimeTicks frame_time) override {
// TODO(cef): Maybe we can use this method in combination with
// OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer.
// See https://codereview.chromium.org/1841083007.
}
void OnFrameTokenChanged(uint32_t frame_token) override {
view_->render_widget_host()->DidProcessFrame(frame_token);
}
@ -179,6 +173,23 @@ float GetDeviceScaleFactor(CefBrowserHostImpl* browser) {
return screen_info.device_scale_factor;
}
ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle(
cef_composition_underline_style_t style) {
switch (style) {
case CEF_CUS_SOLID:
return ui::ImeTextSpan::UnderlineStyle::kSolid;
case CEF_CUS_DOT:
return ui::ImeTextSpan::UnderlineStyle::kDot;
case CEF_CUS_DASH:
return ui::ImeTextSpan::UnderlineStyle::kDash;
case CEF_CUS_NONE:
return ui::ImeTextSpan::UnderlineStyle::kNone;
}
NOTREACHED();
return ui::ImeTextSpan::UnderlineStyle::kSolid;
}
} // namespace
CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
@ -450,11 +461,6 @@ void CefRenderWidgetHostViewOSR::TakeFallbackContentFrom(
host()->GetContentRenderingTimeoutFrom(view_cef->host());
}
void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink(
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) {
NOTREACHED();
}
void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame() {}
void CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete(
@ -526,13 +532,6 @@ void CefRenderWidgetHostViewOSR::AddDamageRect(uint32_t sequence,
damage_rects_[sequence] = rect;
}
void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
const viz::LocalSurfaceId& local_surface_id,
viz::CompositorFrame frame,
base::Optional<viz::HitTestRegionList> hit_test_region_list) {
NOTREACHED();
}
void CefRenderWidgetHostViewOSR::ResetFallbackToFirstNavigationSurface() {
delegated_frame_host_->ResetFallbackToFirstNavigationSurface();
}
@ -795,7 +794,8 @@ void CefRenderWidgetHostViewOSR::ImeSetComposition(
ui::ImeTextSpan::Type::kComposition, line.range.from, line.range.to,
line.thick ? ui::ImeTextSpan::Thickness::kThick
: ui::ImeTextSpan::Thickness::kThin,
line.background_color, line.color, std::vector<std::string>()));
GetImeUnderlineStyle(line.style), line.background_color, line.color,
std::vector<std::string>()));
}
gfx::Range range(replacement_range.from, replacement_range.to);
@ -898,20 +898,6 @@ CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() {
return std::make_unique<CefSyntheticGestureTargetOSR>(host());
}
void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) {
SetFrameRate();
if (host_display_client_) {
host_display_client_->SetActive(enabled);
}
}
void CefRenderWidgetHostViewOSR::SetWantsAnimateOnlyBeginFrames() {
if (delegated_frame_host_) {
delegated_frame_host_->SetWantsAnimateOnlyBeginFrames();
}
}
bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView(
const gfx::PointF& point,
RenderWidgetHostViewBase* target_view,
@ -1108,13 +1094,15 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
if (popup_host_view_) {
if (popup_host_view_->popup_position_.Contains(
event.PositionInWidget().x, event.PositionInWidget().y)) {
event.PositionInWidget().x(), event.PositionInWidget().y())) {
blink::WebMouseEvent popup_event(event);
popup_event.SetPositionInWidget(
event.PositionInWidget().x - popup_host_view_->popup_position_.x(),
event.PositionInWidget().y - popup_host_view_->popup_position_.y());
popup_event.SetPositionInScreen(popup_event.PositionInWidget().x,
popup_event.PositionInWidget().y);
event.PositionInWidget().x() -
popup_host_view_->popup_position_.x(),
event.PositionInWidget().y() -
popup_host_view_->popup_position_.y());
popup_event.SetPositionInScreen(popup_event.PositionInWidget().x(),
popup_event.PositionInWidget().y());
popup_host_view_->SendMouseEvent(popup_event);
return;
@ -1127,14 +1115,14 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
}
const gfx::Rect& guest_bounds =
guest_host_view->render_widget_host_->GetView()->GetViewBounds();
if (guest_bounds.Contains(event.PositionInWidget().x,
event.PositionInWidget().y)) {
if (guest_bounds.Contains(event.PositionInWidget().x(),
event.PositionInWidget().y())) {
blink::WebMouseEvent guest_event(event);
guest_event.SetPositionInWidget(
event.PositionInWidget().x - guest_bounds.x(),
event.PositionInWidget().y - guest_bounds.y());
guest_event.SetPositionInScreen(guest_event.PositionInWidget().x,
guest_event.PositionInWidget().y);
event.PositionInWidget().x() - guest_bounds.x(),
event.PositionInWidget().y() - guest_bounds.y());
guest_event.SetPositionInScreen(guest_event.PositionInWidget().x(),
guest_event.PositionInWidget().y());
guest_host_view->SendMouseEvent(guest_event);
return;
@ -1168,14 +1156,16 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
if (popup_host_view_) {
if (popup_host_view_->popup_position_.Contains(
event.PositionInWidget().x, event.PositionInWidget().y)) {
event.PositionInWidget().x(), event.PositionInWidget().y())) {
blink::WebMouseWheelEvent popup_mouse_wheel_event(event);
popup_mouse_wheel_event.SetPositionInWidget(
event.PositionInWidget().x - popup_host_view_->popup_position_.x(),
event.PositionInWidget().y - popup_host_view_->popup_position_.y());
event.PositionInWidget().x() -
popup_host_view_->popup_position_.x(),
event.PositionInWidget().y() -
popup_host_view_->popup_position_.y());
popup_mouse_wheel_event.SetPositionInScreen(
popup_mouse_wheel_event.PositionInWidget().x,
popup_mouse_wheel_event.PositionInWidget().y);
popup_mouse_wheel_event.PositionInWidget().x(),
popup_mouse_wheel_event.PositionInWidget().y());
popup_host_view_->SendMouseWheelEvent(popup_mouse_wheel_event);
return;
@ -1196,15 +1186,15 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
}
const gfx::Rect& guest_bounds =
guest_host_view->render_widget_host_->GetView()->GetViewBounds();
if (guest_bounds.Contains(event.PositionInWidget().x,
event.PositionInWidget().y)) {
if (guest_bounds.Contains(event.PositionInWidget().x(),
event.PositionInWidget().y())) {
blink::WebMouseWheelEvent guest_mouse_wheel_event(event);
guest_mouse_wheel_event.SetPositionInWidget(
event.PositionInWidget().x - guest_bounds.x(),
event.PositionInWidget().y - guest_bounds.y());
event.PositionInWidget().x() - guest_bounds.x(),
event.PositionInWidget().y() - guest_bounds.y());
guest_mouse_wheel_event.SetPositionInScreen(
guest_mouse_wheel_event.PositionInWidget().x,
guest_mouse_wheel_event.PositionInWidget().y);
guest_mouse_wheel_event.PositionInWidget().x(),
guest_mouse_wheel_event.PositionInWidget().y());
guest_host_view->SendMouseWheelEvent(guest_mouse_wheel_event);
return;

View File

@ -135,13 +135,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
#endif // defined(OS_MACOSX)
// RenderWidgetHostViewBase implementation.
void DidCreateNewRendererCompositorFrameSink(
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
override;
void SubmitCompositorFrame(
const viz::LocalSurfaceId& local_surface_id,
viz::CompositorFrame frame,
base::Optional<viz::HitTestRegionList> hit_test_region_list) override;
void ResetFallbackToFirstNavigationSurface() override;
void InitAsPopup(content::RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) override;
@ -176,8 +169,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
const std::vector<gfx::Rect>& character_bounds) override;
std::unique_ptr<content::SyntheticGestureTarget>
CreateSyntheticGestureTarget() override;
void SetNeedsBeginFrames(bool enabled) override;
void SetWantsAnimateOnlyBeginFrames() override;
bool TransformPointToCoordSpaceForView(
const gfx::PointF& point,
RenderWidgetHostViewBase* target_view,
@ -400,9 +391,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
content::MouseWheelPhaseHandler mouse_wheel_phase_handler_;
std::unique_ptr<viz::mojom::CompositorFrameSinkClient>
renderer_compositor_frame_sink_;
// Latest capture sequence number which is incremented when the caller
// requests surfaces be synchronized via
// EnsureSurfaceSynchronizedForLayoutTest().

View File

@ -56,7 +56,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_switches.h"
#if defined(OS_MACOSX) || defined(OS_WIN)
#if defined(OS_WIN)
#include "components/os_crypt/os_crypt.h"
#endif
@ -185,7 +185,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
if (!profile) {
SystemNetworkContextManager::RegisterPrefs(registry.get());
#if defined(OS_MACOSX) || defined(OS_WIN)
#if defined(OS_WIN)
OSCrypt::RegisterLocalPrefs(registry.get());
#endif
}

View File

@ -290,8 +290,11 @@ void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf(
DCHECK_EQ(pdf_print_state_->printing_rfh_, rfh);
rfh->Send(new PrintMsg_PrintPreview(rfh->GetRoutingID(),
pdf_print_state_->settings_));
mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>
print_render_frame_remote;
rfh->GetRemoteAssociatedInterfaces()->GetInterface(
&print_render_frame_remote);
print_render_frame_remote->PrintPreview(pdf_print_state_->settings_.Clone());
}
void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(

View File

@ -381,7 +381,7 @@ void CefServerImpl::SendHttp200ResponseInternal(
if (!CEF_CURRENTLY_ON_HT()) {
CEF_POST_TASK_HT(base::BindOnce(&CefServerImpl::SendHttp200ResponseInternal,
this, connection_id, content_type,
base::Passed(std::move(data))));
std::move(data)));
return;
}
@ -407,8 +407,7 @@ void CefServerImpl::SendRawDataInternal(int connection_id,
std::unique_ptr<std::string> data) {
if (!CEF_CURRENTLY_ON_HT()) {
CEF_POST_TASK_HT(base::BindOnce(&CefServerImpl::SendRawDataInternal, this,
connection_id,
base::Passed(std::move(data))));
connection_id, std::move(data)));
return;
}
@ -427,7 +426,7 @@ void CefServerImpl::SendWebSocketMessageInternal(
if (!CEF_CURRENTLY_ON_HT()) {
CEF_POST_TASK_HT(
base::BindOnce(&CefServerImpl::SendWebSocketMessageInternal, this,
connection_id, base::Passed(std::move(data))));
connection_id, std::move(data)));
return;
}

View File

@ -57,7 +57,8 @@ bool CefSSLHostStateDelegate::DidHostRunInsecureContent(
void CefSSLHostStateDelegate::AllowCert(const std::string& host,
const net::X509Certificate& cert,
int error) {
int error,
content::WebContents* web_contents) {
cert_policy_for_host_[host].Allow(cert, error);
}
@ -82,7 +83,8 @@ void CefSSLHostStateDelegate::Clear(
SSLHostStateDelegate::CertJudgment CefSSLHostStateDelegate::QueryPolicy(
const std::string& host,
const net::X509Certificate& cert,
int error) {
int error,
content::WebContents* web_contents) {
return cert_policy_for_host_[host].Check(cert, error)
? SSLHostStateDelegate::ALLOWED
: SSLHostStateDelegate::DENIED;
@ -93,7 +95,9 @@ void CefSSLHostStateDelegate::RevokeUserAllowExceptions(
cert_policy_for_host_.erase(host);
}
bool CefSSLHostStateDelegate::HasAllowException(const std::string& host) {
bool CefSSLHostStateDelegate::HasAllowException(
const std::string& host,
content::WebContents* web_contents) {
auto policy_iterator = cert_policy_for_host_.find(host);
return policy_iterator != cert_policy_for_host_.end() &&
policy_iterator->second.HasAllowException();

View File

@ -49,13 +49,15 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate {
// SSLHostStateDelegate methods:
void AllowCert(const std::string& host,
const net::X509Certificate& cert,
int error) override;
int error,
content::WebContents* web_contents) override;
void Clear(const base::RepeatingCallback<bool(const std::string&)>
host_filter) override;
content::SSLHostStateDelegate::CertJudgment QueryPolicy(
const std::string& host,
const net::X509Certificate& cert,
int error) override;
int error,
content::WebContents* web_contents) override;
void HostRanInsecureContent(const std::string& host,
int child_id,
InsecureContentType content_type) override;
@ -63,7 +65,8 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate {
int child_id,
InsecureContentType content_type) override;
void RevokeUserAllowExceptions(const std::string& host) override;
bool HasAllowException(const std::string& host) override;
bool HasAllowException(const std::string& host,
content::WebContents* web_contents) override;
private:
// Certificate policies for each host.

View File

@ -101,12 +101,12 @@ size_t CefX509CertificateImpl::GetIssuerChainSize() {
}
void CefX509CertificateImpl::AcquirePrivateKey(
const base::Callback<void(scoped_refptr<net::SSLPrivateKey>)>&
base::OnceCallback<void(scoped_refptr<net::SSLPrivateKey>)>
private_key_callback) {
if (identity_)
identity_->AcquirePrivateKey(private_key_callback);
identity_->AcquirePrivateKey(std::move(private_key_callback));
else
private_key_callback.Run(nullptr);
std::move(private_key_callback).Run(nullptr);
}
void CefX509CertificateImpl::GetEncodedIssuerChain(

View File

@ -35,7 +35,7 @@ class CefX509CertificateImpl : public CefX509Certificate {
scoped_refptr<net::X509Certificate> GetInternalCertObject() { return cert_; }
void AcquirePrivateKey(
const base::Callback<void(scoped_refptr<net::SSLPrivateKey>)>&
base::OnceCallback<void(scoped_refptr<net::SSLPrivateKey>)>
private_key_callback);
private:

View File

@ -114,7 +114,7 @@ IPC_STRUCT_BEGIN(CefMsg_LoadRequest_Params)
// lead to undesired cookie blocking. Third-party cookie blocking can be
// bypassed by setting site_for_cookies = url, but this should ideally
// only be done if there really is no way to determine the correct value.
IPC_STRUCT_MEMBER(GURL, site_for_cookies)
IPC_STRUCT_MEMBER(net::SiteForCookies, site_for_cookies)
// Additional HTTP request headers.
IPC_STRUCT_MEMBER(std::string, headers)

View File

@ -23,6 +23,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"

View File

@ -21,7 +21,6 @@
#include "net/url_request/redirect_util.h"
#include "net/url_request/url_request.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/resource_response.h"
namespace net_service {
@ -91,7 +90,7 @@ std::string MakeContentTypeValue(const std::string& mime_type,
return value;
}
net::HttpResponseHeaders* MakeResponseHeaders(
scoped_refptr<net::HttpResponseHeaders> MakeResponseHeaders(
int status_code,
const std::string& status_text,
const std::string& mime_type,
@ -102,8 +101,8 @@ net::HttpResponseHeaders* MakeResponseHeaders(
if (status_code <= 0)
status_code = 200;
auto headers = new net::HttpResponseHeaders(
MakeStatusLine(status_code, status_text, false));
auto headers = WrapRefCounted(new net::HttpResponseHeaders(
MakeStatusLine(status_code, status_text, false)));
// Track the headers that have already been set. Perform all comparisons in
// lowercase.
@ -171,8 +170,8 @@ net::RedirectInfo MakeRedirectInfo(const network::ResourceRequest& request,
: net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
return net::RedirectInfo::ComputeRedirectInfo(
request.method, request.url, request.site_for_cookies,
first_party_url_policy, request.referrer_policy,
request.referrer.spec(), status_code, location,
first_party_url_policy, request.referrer_policy, request.referrer.spec(),
status_code, location,
net::RedirectUtil::GetReferrerPolicyHeader(headers),
insecure_scheme_was_upgraded);
}

View File

@ -10,6 +10,8 @@
#include "include/internal/cef_types_wrappers.h"
#include "base/memory/scoped_refptr.h"
namespace net {
class CanonicalCookie;
class HttpResponseHeaders;
@ -18,7 +20,6 @@ struct RedirectInfo;
namespace network {
struct ResourceRequest;
struct ResourceResponseHead;
} // namespace network
class GURL;
@ -48,7 +49,7 @@ std::string MakeContentTypeValue(const std::string& mime_type,
const std::string& charset);
// Make a new HttpResponseHeaders object.
net::HttpResponseHeaders* MakeResponseHeaders(
scoped_refptr<net::HttpResponseHeaders> MakeResponseHeaders(
int status_code,
const std::string& status_text,
const std::string& mime_type,

View File

@ -102,8 +102,7 @@ CefString CefBase64Encode(const void* data, size_t data_size) {
if (data_size == 0)
return CefString();
base::StringPiece input;
input.set(static_cast<const char*>(data), data_size);
base::StringPiece input(static_cast<const char*>(data), data_size);
std::string output;
base::Base64Encode(input, &output);
return output;

View File

@ -299,13 +299,17 @@ void CefRequestImpl::SetReferrer(const CefString& referrer_url,
base::AutoLock lock_scope(lock_);
CHECK_READONLY_RETURN_VOID();
// Call GetAsReferrer here for consistency since the same logic will later be
// applied by URLRequest::SetReferrer().
const GURL& new_referrer_url = GURL(referrer_url.ToString()).GetAsReferrer();
if (referrer_url_ != new_referrer_url || referrer_policy_ != policy) {
const auto& sanitized_referrer = content::Referrer::SanitizeForRequest(
url_, content::Referrer(GURL(referrer_url.ToString()),
NetReferrerPolicyToBlinkReferrerPolicy(policy)));
const auto sanitized_policy =
BlinkReferrerPolicyToNetReferrerPolicy(sanitized_referrer.policy);
if (referrer_url_ != sanitized_referrer.url ||
referrer_policy_ != sanitized_policy) {
Changed(kChangedReferrer);
referrer_url_ = new_referrer_url;
referrer_policy_ = policy;
referrer_url_ = sanitized_referrer.url;
referrer_policy_ = sanitized_policy;
}
}
@ -425,16 +429,16 @@ void CefRequestImpl::SetFlags(int flags) {
CefString CefRequestImpl::GetFirstPartyForCookies() {
base::AutoLock lock_scope(lock_);
return first_party_for_cookies_.spec();
return site_for_cookies_.RepresentativeUrl().spec();
}
void CefRequestImpl::SetFirstPartyForCookies(const CefString& url) {
base::AutoLock lock_scope(lock_);
CHECK_READONLY_RETURN_VOID();
const GURL& new_url = GURL(url.ToString());
if (first_party_for_cookies_ != new_url) {
Changed(kChangedFirstPartyForCookies);
first_party_for_cookies_ = new_url;
auto new_site = net::SiteForCookies::FromUrl(GURL(url.ToString()));
if (!new_site.IsEquivalent(site_for_cookies_)) {
Changed(kChangedSiteForCookies);
site_for_cookies_ = new_site;
}
}
@ -464,12 +468,16 @@ void CefRequestImpl::Set(const network::ResourceRequest* request,
method_ = request->method;
identifier_ = identifier;
// Our consumer should have made sure that this is a safe referrer. See for
// instance WebCore::FrameLoader::HideReferrer.
if (request->referrer.is_valid()) {
referrer_url_ = request->referrer;
const auto& sanitized_referrer = content::Referrer::SanitizeForRequest(
request->url,
content::Referrer(
request->referrer,
NetReferrerPolicyToBlinkReferrerPolicy(
static_cast<cef_referrer_policy_t>(request->referrer_policy))));
referrer_url_ = sanitized_referrer.url;
referrer_policy_ =
static_cast<cef_referrer_policy_t>(request->referrer_policy);
BlinkReferrerPolicyToNetReferrerPolicy(sanitized_referrer.policy);
}
// Transfer request headers.
@ -481,7 +489,7 @@ void CefRequestImpl::Set(const network::ResourceRequest* request,
static_cast<CefPostDataImpl*>(postdata_.get())->Set(*request->request_body);
}
first_party_for_cookies_ = request->site_for_cookies;
site_for_cookies_ = request->site_for_cookies;
resource_type_ = static_cast<cef_resource_type_t>(request->resource_type);
transition_type_ =
@ -519,9 +527,9 @@ void CefRequestImpl::Get(network::ResourceRequest* request,
}
}
if (!first_party_for_cookies_.is_empty() &&
ShouldSet(kChangedFirstPartyForCookies, changed_only)) {
request->site_for_cookies = first_party_for_cookies_;
if (!site_for_cookies_.IsNull() &&
ShouldSet(kChangedSiteForCookies, changed_only)) {
request->site_for_cookies = site_for_cookies_;
}
if (ShouldSet(kChangedFlags, changed_only)) {
@ -560,10 +568,17 @@ void CefRequestImpl::Set(const net::RedirectInfo& redirect_info) {
url_ = redirect_info.new_url;
method_ = redirect_info.new_method;
first_party_for_cookies_ = redirect_info.new_site_for_cookies;
referrer_url_ = GURL(redirect_info.new_referrer);
site_for_cookies_ = redirect_info.new_site_for_cookies;
const auto& sanitized_referrer = content::Referrer::SanitizeForRequest(
redirect_info.new_url,
content::Referrer(GURL(redirect_info.new_referrer),
NetReferrerPolicyToBlinkReferrerPolicy(
static_cast<cef_referrer_policy_t>(
redirect_info.new_referrer_policy))));
referrer_url_ = sanitized_referrer.url;
referrer_policy_ =
static_cast<cef_referrer_policy_t>(redirect_info.new_referrer_policy);
BlinkReferrerPolicyToNetReferrerPolicy(sanitized_referrer.policy);
}
void CefRequestImpl::Set(const net::HttpRequestHeaders& headers) {
@ -584,7 +599,7 @@ void CefRequestImpl::Set(
url_ = params.url();
method_ = params.is_post() ? "POST" : "GET";
const content::Referrer& sanitized_referrer =
const auto& sanitized_referrer =
content::Referrer::SanitizeForRequest(params.url(), params.referrer());
referrer_url_ = sanitized_referrer.url;
referrer_policy_ =
@ -609,8 +624,9 @@ void CefRequestImpl::Get(blink::WebURLRequest& request,
NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_), url_,
blink::WebString::FromUTF8(referrer_url_.spec()));
if (!referrer.IsEmpty()) {
request.SetHttpReferrer(
referrer, NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_));
request.SetReferrerString(referrer);
request.SetReferrerPolicy(
NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_));
}
}
@ -634,8 +650,8 @@ void CefRequestImpl::Get(blink::WebURLRequest& request,
::SetHeaderMap(headermap_, request);
if (!first_party_for_cookies_.is_empty())
request.SetSiteForCookies(first_party_for_cookies_);
if (!site_for_cookies_.IsNull())
request.SetSiteForCookies(site_for_cookies_);
int flags = flags_;
if (!(flags & kURCachePolicyMask)) {
@ -666,10 +682,9 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params,
static_cast<cef_referrer_policy_t>(params.referrer_policy)),
params.url, blink::WebString::FromUTF8(params.referrer.spec()));
if (!referrer.IsEmpty()) {
request.SetHttpReferrer(
referrer,
NetReferrerPolicyToBlinkReferrerPolicy(
static_cast<cef_referrer_policy_t>(params.referrer_policy)));
request.SetReferrerString(referrer);
request.SetReferrerPolicy(NetReferrerPolicyToBlinkReferrerPolicy(
static_cast<cef_referrer_policy_t>(params.referrer_policy)));
}
}
@ -711,8 +726,10 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params,
data.Assign(element->bytes(), element->bytes_length());
body.AppendData(data);
} else if (element->type() == net::UploadElement::TYPE_FILE) {
body.AppendFile(
FilePathStringToWebString(element->file_path().value()));
body.AppendFileRange(
FilePathStringToWebString(element->file_path().value()),
element->file_range_offset(), element->file_range_length(),
element->expected_file_modification_time());
} else {
NOTREACHED();
}
@ -721,7 +738,7 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params,
request.SetHttpBody(body);
}
if (params.site_for_cookies.is_valid())
if (!params.site_for_cookies.IsNull())
request.SetSiteForCookies(params.site_for_cookies);
int flags = params.load_flags;
@ -758,7 +775,7 @@ void CefRequestImpl::Get(CefNavigateParams& params) const {
impl->Get(*params.upload_data.get());
}
params.site_for_cookies = first_party_for_cookies_;
params.site_for_cookies = site_for_cookies_;
params.load_flags = flags_;
}
@ -817,8 +834,8 @@ void CefRequestImpl::RevertChanges() {
}
if (backup_->backups_ & kChangedFlags)
flags_ = backup_->flags_;
if (backup_->backups_ & kChangedFirstPartyForCookies)
first_party_for_cookies_ = backup_->first_party_for_cookies_;
if (backup_->backups_ & kChangedSiteForCookies)
site_for_cookies_ = backup_->site_for_cookies_;
backup_.reset();
}
@ -938,10 +955,10 @@ void CefRequestImpl::Changed(uint8_t changes) {
backup_->flags_ = flags_;
backup_->backups_ |= kChangedFlags;
}
if ((changes & kChangedFirstPartyForCookies) &&
!(backup_->backups_ & kChangedFirstPartyForCookies)) {
backup_->first_party_for_cookies_ = first_party_for_cookies_;
backup_->backups_ |= kChangedFirstPartyForCookies;
if ((changes & kChangedSiteForCookies) &&
!(backup_->backups_ & kChangedSiteForCookies)) {
backup_->site_for_cookies_ = site_for_cookies_;
backup_->backups_ |= kChangedSiteForCookies;
}
}
@ -988,7 +1005,7 @@ void CefRequestImpl::Reset() {
transition_type_ = TT_EXPLICIT;
identifier_ = 0U;
flags_ = UR_FLAG_NONE;
first_party_for_cookies_ = GURL();
site_for_cookies_ = net::SiteForCookies();
changes_ = kChangedNone;
}
@ -1193,7 +1210,8 @@ void CefPostDataImpl::Get(blink::WebHTTPBody& data) const {
if (element.type == blink::WebHTTPBody::Element::kTypeData) {
data.AppendData(element.data);
} else if (element.type == blink::WebHTTPBody::Element::kTypeFile) {
data.AppendFile(element.file_path);
data.AppendFileRange(element.file_path, element.file_start,
element.file_length, element.modification_time);
} else {
NOTREACHED();
}

View File

@ -13,6 +13,7 @@
#include "include/cef_request.h"
#include "base/synchronization/lock.h"
#include "net/cookies/site_for_cookies.h"
#include "services/network/public/mojom/referrer_policy.mojom-shared.h"
#include "third_party/blink/public/platform/web_http_body.h"
#include "url/gurl.h"
@ -54,7 +55,7 @@ class CefRequestImpl : public CefRequest {
kChangedPostData = 1 << 3,
kChangedHeaderMap = 1 << 4,
kChangedFlags = 1 << 5,
kChangedFirstPartyForCookies = 1 << 6,
kChangedSiteForCookies = 1 << 6,
};
CefRequestImpl();
@ -162,7 +163,7 @@ class CefRequestImpl : public CefRequest {
// The below members are used by CefURLRequest.
int flags_;
GURL first_party_for_cookies_;
net::SiteForCookies site_for_cookies_;
// Stores backup of values for use with track changes.
struct Backup {
@ -176,7 +177,7 @@ class CefRequestImpl : public CefRequest {
CefRefPtr<CefPostData> postdata_;
std::unique_ptr<HeaderMap> headermap_;
int flags_;
GURL first_party_for_cookies_;
net::SiteForCookies site_for_cookies_;
};
std::unique_ptr<Backup> backup_;

View File

@ -155,7 +155,7 @@ void CefResponseImpl::SetHeaderMap(const HeaderMap& headerMap) {
header_map_ = headerMap;
}
net::HttpResponseHeaders* CefResponseImpl::GetResponseHeaders() {
scoped_refptr<net::HttpResponseHeaders> CefResponseImpl::GetResponseHeaders() {
base::AutoLock lock_scope(lock_);
std::string mime_type = mime_type_;

View File

@ -44,7 +44,7 @@ class CefResponseImpl : public CefResponse {
CefString GetURL() override;
void SetURL(const CefString& url) override;
net::HttpResponseHeaders* GetResponseHeaders();
scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders();
void SetResponseHeaders(const net::HttpResponseHeaders& headers);
void Set(const blink::WebURLResponse& response);

View File

@ -417,14 +417,14 @@ void LoadWidevineCdmInfoOnBlockingThread(
cef_cdm_registration_error_t result =
LoadWidevineCdmInfo(base_path, args.get(), &error_message);
if (result != CEF_CDM_REGISTRATION_ERROR_NONE) {
CEF_POST_TASK(CEF_UIT, base::Bind(DeliverWidevineCdmCallback, result,
error_message, callback));
CEF_POST_TASK(CEF_UIT, base::BindOnce(DeliverWidevineCdmCallback, result,
error_message, callback));
return;
}
// Continue execution on the UI thread.
CEF_POST_TASK(CEF_UIT, base::Bind(RegisterWidevineCdmOnUIThread,
base::Passed(std::move(args)), callback));
CEF_POST_TASK(CEF_UIT, base::BindOnce(RegisterWidevineCdmOnUIThread,
std::move(args), callback));
}
} // namespace
@ -446,7 +446,7 @@ void CefWidevineLoader::LoadWidevineCdm(
}
CEF_POST_USER_VISIBLE_TASK(
base::Bind(LoadWidevineCdmInfoOnBlockingThread, path, callback));
base::BindOnce(LoadWidevineCdmInfoOnBlockingThread, path, callback));
}
void CefWidevineLoader::OnContextInitialized() {

View File

@ -61,8 +61,10 @@ void GoBack(blink::WebView* view) {
if (main_frame && main_frame->IsWebLocalFrame()) {
blink::WebViewImpl* view_impl = reinterpret_cast<blink::WebViewImpl*>(view);
if (view_impl->Client()->HistoryBackListCount() > 0) {
main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon(
-1, true /* has_user_gesture */);
blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame);
blink::To<blink::LocalFrame>(core_frame)
->GetLocalFrameHostRemote()
.GoToEntryAtOffset(-1, true /* has_user_gesture */);
}
}
}
@ -75,8 +77,10 @@ void GoForward(blink::WebView* view) {
if (main_frame && main_frame->IsWebLocalFrame()) {
blink::WebViewImpl* view_impl = reinterpret_cast<blink::WebViewImpl*>(view);
if (view_impl->Client()->HistoryForwardListCount() > 0) {
main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon(
1, true /* has_user_gesture */);
blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame);
blink::To<blink::LocalFrame>(core_frame)
->GetLocalFrameHostRemote()
.GoToEntryAtOffset(1, true /* has_user_gesture */);
}
}
}

View File

@ -64,7 +64,6 @@
#include "components/printing/renderer/print_render_frame_helper.h"
#include "components/spellcheck/renderer/spellcheck.h"
#include "components/spellcheck/renderer/spellcheck_provider.h"
#include "components/startup_metric_utils/common/startup_metric.mojom.h"
#include "components/visitedlink/renderer/visitedlink_reader.h"
#include "components/web_cache/renderer/web_cache_impl.h"
#include "content/common/frame_messages.h"
@ -393,13 +392,6 @@ void CefContentRendererClient::RenderThreadStarted() {
? blink::scheduler::WebRendererProcessType::kExtensionRenderer
: blink::scheduler::WebRendererProcessType::kRenderer);
{
mojo::Remote<startup_metric_utils::mojom::StartupMetricHost>
startup_metric_host;
thread->BindHostReceiver(startup_metric_host.BindNewPipeAndPassReceiver());
startup_metric_host->RecordRendererMainEntryTime(main_entry_time_);
}
thread->AddObserver(observer_.get());
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
@ -609,7 +601,7 @@ void CefContentRendererClient::WillSendRequest(
blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const blink::WebURL& url,
const blink::WebURL& site_for_cookies,
const net::SiteForCookies& site_for_cookies,
const url::Origin* initiator_origin,
GURL* new_url,
bool* attach_same_site_cookies) {

View File

@ -118,7 +118,7 @@ class CefContentRendererClient
void WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const blink::WebURL& url,
const blink::WebURL& site_for_cookies,
const net::SiteForCookies& site_for_cookies,
const url::Origin* initiator_origin,
GURL* new_url,
bool* attach_same_site_cookies) override;

View File

@ -122,7 +122,7 @@ void CefExtensionsRendererClient::WillSendRequest(
blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const blink::WebURL& url,
const blink::WebURL& site_for_cookies,
const net::SiteForCookies& site_for_cookies,
const url::Origin* initiator_origin,
GURL* new_url,
bool* attach_same_site_cookies) {

View File

@ -22,6 +22,10 @@ struct WebPluginParams;
class WebURL;
} // namespace blink
namespace net {
class SiteForCookies;
}
namespace content {
class BrowserPluginDelegate;
class RenderFrame;
@ -64,7 +68,7 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
void WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const blink::WebURL& url,
const blink::WebURL& site_for_cookies,
const net::SiteForCookies& site_for_cookies,
const url::Origin* initiator_origin,
GURL* new_url,
bool* attach_same_site_cookies);

View File

@ -29,11 +29,6 @@ CefPrintRenderFrameHelperDelegate::CefPrintRenderFrameHelperDelegate(
CefPrintRenderFrameHelperDelegate::~CefPrintRenderFrameHelperDelegate() {}
bool CefPrintRenderFrameHelperDelegate::CancelPrerender(
content::RenderFrame* render_frame) {
return false;
}
// Return the PDF object element if |frame| is the out of process PDF extension.
blink::WebElement CefPrintRenderFrameHelperDelegate::GetPdfElement(
blink::WebLocalFrame* frame) {

View File

@ -15,7 +15,6 @@ class CefPrintRenderFrameHelperDelegate
explicit CefPrintRenderFrameHelperDelegate(bool is_windowless);
~CefPrintRenderFrameHelperDelegate() override;
bool CancelPrerender(content::RenderFrame* render_frame) override;
blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) override;
bool IsPrintPreviewEnabled() override;
bool OverridePrint(blink::WebLocalFrame* frame) override;

View File

@ -120,8 +120,8 @@ void CefFrameImpl::LoadRequest(CefRefPtr<CefRequest> request) {
CefMsg_LoadRequest_Params params;
params.url = GURL(std::string(request->GetURL()));
params.method = request->GetMethod();
params.site_for_cookies =
GURL(std::string(request->GetFirstPartyForCookies()));
params.site_for_cookies = net::SiteForCookies::FromUrl(
GURL(request->GetFirstPartyForCookies().ToString()));
CefRequest::HeaderMap headerMap;
request->GetHeaderMap(headerMap);
@ -504,7 +504,6 @@ void CefFrameImpl::OnDidStopLoading() {
// in this frame's in-process subtree. If there are multiple of these for the
// same browser then the other occurrences will be discarded in
// OnLoadingStateChange.
DCHECK(frame_->IsLocalRoot());
browser_->OnLoadingStateChange(false);
}

View File

@ -56,7 +56,7 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
void DidStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle response_body) override;
bool WillFollowRedirect(const WebURL& new_url,
const WebURL& new_site_for_cookies,
const net::SiteForCookies& new_site_for_cookies,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,
@ -392,7 +392,7 @@ void CefWebURLLoaderClient::DidStartLoadingResponseBody(
bool CefWebURLLoaderClient::WillFollowRedirect(
const WebURL& new_url,
const WebURL& new_site_for_cookies,
const net::SiteForCookies& new_site_for_cookies,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,

View File

@ -374,12 +374,6 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2398
'name': 'resource_bundle_2512',
},
{
# Fix redraw of OSR PDF viewer.
# https://bitbucket.org/chromiumembedded/cef/issues/2507
# Partially reverts changes from https://crrev.com/17771fad93
'name': 'browser_child_frame_2507',
},
{
# macOS: Fix crash when showing a select popup with CefDoMessageLoopWork.
# https://bitbucket.org/chromiumembedded/cef/issues/2495
@ -400,14 +394,15 @@ patches = [
},
{
# Enhancements to NetworkService:
# - Support customization of request_id via SimpleURLLoader.
# - Remove the non-nullptr WebContents requirement from
# NetworkServiceClient::OnAuthRequired.
# https://bitbucket.org/chromiumembedded/cef/issues/2718
#
# Fix shutdown crash in InitNetworkContext with multi-threaded message loop.
# https://bitbucket.org/chromiumembedded/cef/issues/2703
'name': 'services_network_request_id_2718',
#
# Compute correct default quota when cache_path is unspecified.
'name': 'services_network_2718',
},
{
# Windows: Remove the base::Value is_standard_layout assert which will fail
@ -482,11 +477,6 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2745
'name': 'osr_fling_2745',
},
{
# Windows: Fix ImportError: No module named win32file
# https://bugs.chromium.org/p/chromium/issues/detail?id=1033106#c7
'name': 'win_tool_wrapper_1033106',
},
{
# Windows: Build targets as C++17 to avoid export of std::is_integral
# templates in cef_sandbox that should be inlined.
@ -502,6 +492,7 @@ patches = [
# Fix Jumbo build errors.
# - Allow use of jumbo-related GN args.
# - Fix multiple definition errors.
# - Add `never_build_jumbo = true` for targets with complex errors.
'name': 'build_jumbo',
},
{

View File

@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn
index 0e54cd8264cf..44405b8a410b 100644
index 447280ffe5e3..ddff00ac1a69 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -32,6 +32,7 @@ import("//build/config/sysroot.gni")
@ -10,7 +10,7 @@ index 0e54cd8264cf..44405b8a410b 100644
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("//third_party/icu/config.gni")
@@ -1635,7 +1636,11 @@ jumbo_component("base") {
@@ -1644,7 +1645,11 @@ jumbo_component("base") {
"hash/md5_constexpr_internal.h",
"hash/sha1.h",
]

View File

@ -1,40 +0,0 @@
diff --git content/browser/renderer_host/render_widget_host_view_child_frame.cc content/browser/renderer_host/render_widget_host_view_child_frame.cc
index fc45d9e34fad..57d5d26613a5 100644
--- content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -596,6 +596,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
"RenderWidgetHostViewChildFrame::OnSwapCompositorFrame");
support_->SubmitCompositorFrame(local_surface_id, std::move(frame),
std::move(hit_test_region_list));
+ ProcessFrameSwappedCallbacks();
}
void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
@@ -604,6 +605,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
support_->DidNotProduceFrame(ack);
}
+void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() {
+ std::vector<base::OnceClosure> process_callbacks;
+ // Swap the vectors to avoid re-entrancy issues due to calls to
+ // RegisterFrameSwappedCallback() while running the OnceClosures.
+ process_callbacks.swap(frame_swapped_callbacks_);
+ for (base::OnceClosure& callback : process_callbacks)
+ std::move(callback).Run();
+}
+
void RenderWidgetHostViewChildFrame::TransformPointToRootSurface(
gfx::PointF* point) {
// This function is called by RenderWidgetHostInputEventRouter only for
@@ -798,6 +808,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() {
void RenderWidgetHostViewChildFrame::SpeakSelection() {}
#endif // defined(OS_MACOSX)
+void RenderWidgetHostViewChildFrame::RegisterFrameSwappedCallback(
+ base::OnceClosure callback) {
+ frame_swapped_callbacks_.emplace_back(std::move(callback));
+}
+
void RenderWidgetHostViewChildFrame::CopyFromSurface(
const gfx::Rect& src_subrect,
const gfx::Size& output_size,

View File

@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
index de89d291e5cb..9ce7bf4cb250 100644
index af7b3249d421..1483a48f9074 100644
--- content/browser/renderer_host/browser_compositor_view_mac.h
+++ content/browser/renderer_host/browser_compositor_view_mac.h
@@ -59,6 +59,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient,
@@ -58,6 +58,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient,
// These will not return nullptr until Destroy is called.
DelegatedFrameHost* GetDelegatedFrameHost();
@ -12,7 +12,7 @@ index de89d291e5cb..9ce7bf4cb250 100644
// Force a new surface id to be allocated. Returns true if the
// RenderWidgetHostImpl sent the resulting surface id to the renderer.
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
index 8ddd790decc4..3ffd3db8da4b 100644
index c1593171af25..4c892782d338 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -85,6 +85,12 @@ DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() {

View File

@ -1,8 +1,8 @@
diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc
index b8b4a1b8c70c..e036e15eafc7 100644
index eb9f505243bf..191368199d44 100644
--- content/browser/scheduler/browser_task_executor.cc
+++ content/browser/scheduler/browser_task_executor.cc
@@ -255,7 +255,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() {
@@ -245,7 +245,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() {
// static
void BrowserTaskExecutor::Shutdown() {

View File

@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index fbf8335f11ba..7a80641139a4 100644
index eef1140e8006..0e222de2a9a6 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -172,7 +172,7 @@ declare_args() {
@@ -162,7 +162,7 @@ declare_args() {
!use_clang_coverage && !(is_android && use_order_profiling) &&
(use_lld ||
(use_gold &&
@ -11,7 +11,7 @@ index fbf8335f11ba..7a80641139a4 100644
!(current_cpu == "x86" || current_cpu == "x64"))))
}
@@ -1763,8 +1763,6 @@ config("thin_archive") {
@@ -1743,8 +1743,6 @@ config("thin_archive") {
# archive names to 16 characters, which is not what we want).
if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) {
arflags = [ "-T" ]

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,16 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 6751a787272b..751b62c50a81 100644
index 477e30a34cd2..7a24ff410e7e 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -10,6 +10,7 @@ import("//build/config/features.gni")
@@ -11,6 +11,7 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/linux/gtk/gtk.gni")
import("//build/config/ui.gni")
+import("//cef/libcef/features/features.gni")
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//components/feature_engagement/features.gni")
@@ -1959,6 +1960,7 @@ jumbo_static_library("browser") {
import("//components/captive_portal/core/features.gni")
@@ -1956,6 +1957,7 @@ jumbo_static_library("browser") {
"//base/util/values:values_util",
"//build:branding_buildflags",
"//cc",
@ -18,7 +18,7 @@ index 6751a787272b..751b62c50a81 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2263,6 +2265,10 @@ jumbo_static_library("browser") {
@@ -2275,6 +2277,10 @@ jumbo_static_library("browser") {
]
}

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
index 47b1443298ec..c1e07075fec4 100644
index 1610e0ecc707..f231d5033983 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -7,6 +7,7 @@

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index faa1344bd0a9..4528f101adb8 100644
index c820df8447f0..58cb1279b7bf 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -9,6 +9,7 @@ import("//build/config/features.gni")
@ -7,10 +7,10 @@ index faa1344bd0a9..4528f101adb8 100644
import("//build/config/linux/gtk/gtk.gni")
import("//build/config/ui.gni")
+import("//cef/libcef/features/features.gni")
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//chromeos/assistant/assistant.gni")
import("//components/feature_engagement/features.gni")
@@ -355,6 +356,10 @@ jumbo_static_library("ui") {
@@ -362,6 +363,10 @@ jumbo_static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@ -21,7 +21,7 @@ index faa1344bd0a9..4528f101adb8 100644
# Since browser and browser_ui actually depend on each other,
# we must omit the dependency from browser_ui to browser.
# However, this means browser_ui and browser should more or less
@@ -376,6 +381,7 @@ jumbo_static_library("ui") {
@@ -383,6 +388,7 @@ jumbo_static_library("ui") {
"//base/allocator:buildflags",
"//build:branding_buildflags",
"//cc/paint",
@ -29,7 +29,7 @@ index faa1344bd0a9..4528f101adb8 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -1403,6 +1409,7 @@ jumbo_static_library("ui") {
@@ -1438,6 +1444,7 @@ jumbo_static_library("ui") {
"//components/keep_alive_registry",
"//components/network_session_configurator/common",
"//components/page_load_metrics/browser",
@ -38,10 +38,10 @@ index faa1344bd0a9..4528f101adb8 100644
"//components/ui_metrics",
"//components/url_formatter",
diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc
index 0924a6d73069..2fbdc6588a2c 100644
index 93bfc84f49a1..eeee229e943f 100644
--- chrome/browser/ui/webui/net_export_ui.cc
+++ chrome/browser/ui/webui/net_export_ui.cc
@@ -20,13 +20,12 @@
@@ -21,13 +21,12 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@ -55,8 +55,8 @@ index 0924a6d73069..2fbdc6588a2c 100644
-#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/url_constants.h"
#include "components/grit/components_resources.h"
@@ -41,7 +40,14 @@
#include "components/grit/dev_ui_components_resources.h"
@@ -42,7 +41,14 @@
#include "content/public/browser/web_ui_message_handler.h"
#include "extensions/buildflags/buildflags.h"
#include "net/log/net_log_capture_mode.h"
@ -71,7 +71,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
#if defined(OS_ANDROID)
#include "chrome/browser/android/intent_helper.h"
@@ -67,6 +73,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() {
@@ -68,6 +74,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() {
return source;
}
@ -79,7 +79,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
void SetIfNotNull(base::DictionaryValue* dict,
const base::StringPiece& path,
std::unique_ptr<base::Value> in_value) {
@@ -74,6 +81,7 @@ void SetIfNotNull(base::DictionaryValue* dict,
@@ -75,6 +82,7 @@ void SetIfNotNull(base::DictionaryValue* dict,
dict->Set(path, std::move(in_value));
}
}
@ -87,7 +87,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
// This class receives javascript messages from the renderer.
// Note that the WebUI infrastructure runs on the UI thread, therefore all of
@@ -81,7 +89,9 @@ void SetIfNotNull(base::DictionaryValue* dict,
@@ -82,7 +90,9 @@ void SetIfNotNull(base::DictionaryValue* dict,
class NetExportMessageHandler
: public WebUIMessageHandler,
public base::SupportsWeakPtr<NetExportMessageHandler>,
@ -97,7 +97,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
public net_log::NetExportFileWriter::StateObserver {
public:
NetExportMessageHandler();
@@ -97,11 +107,13 @@ class NetExportMessageHandler
@@ -98,11 +108,13 @@ class NetExportMessageHandler
void OnSendNetLog(const base::ListValue* list);
void OnShowFile(const base::ListValue* list);
@ -111,7 +111,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
// net_log::NetExportFileWriter::StateObserver implementation.
void OnNewState(const base::DictionaryValue& state) override;
@@ -131,9 +143,16 @@ class NetExportMessageHandler
@@ -132,9 +144,16 @@ class NetExportMessageHandler
// renderer.
void NotifyUIWithState(std::unique_ptr<base::DictionaryValue> state);
@ -128,7 +128,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
// Cached pointer to SystemNetworkContextManager's NetExportFileWriter.
net_log::NetExportFileWriter* file_writer_;
@@ -149,7 +168,9 @@ class NetExportMessageHandler
@@ -150,7 +169,9 @@ class NetExportMessageHandler
net::NetLogCaptureMode capture_mode_;
uint64_t max_log_file_size_;
@ -138,7 +138,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
base::WeakPtrFactory<NetExportMessageHandler> weak_ptr_factory_{this};
@@ -166,8 +187,10 @@ NetExportMessageHandler::NetExportMessageHandler()
@@ -167,8 +188,10 @@ NetExportMessageHandler::NetExportMessageHandler()
NetExportMessageHandler::~NetExportMessageHandler() {
// There may be a pending file dialog, it needs to be told that the user
// has gone away so that it doesn't try to call back.
@ -149,7 +149,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
file_writer_->StopNetLog(nullptr);
}
@@ -230,6 +253,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
@@ -231,6 +254,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
if (UsingMobileUI()) {
StartNetLog(base::FilePath());
} else {
@ -157,7 +157,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
base::FilePath initial_dir = last_save_dir.Pointer()->empty() ?
DownloadPrefs::FromBrowserContext(
web_ui()->GetWebContents()->GetBrowserContext())->DownloadPath() :
@@ -237,6 +261,9 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
@@ -238,6 +262,9 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
base::FilePath initial_path =
initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json"));
ShowSelectFileDialog(initial_path);
@ -167,7 +167,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
}
}
@@ -246,6 +273,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
@@ -247,6 +274,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
std::unique_ptr<base::DictionaryValue> ui_thread_polled_data(
new base::DictionaryValue());
@ -175,7 +175,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
Profile* profile = Profile::FromWebUI(web_ui());
SetIfNotNull(ui_thread_polled_data.get(), "prerenderInfo",
chrome_browser_net::GetPrerenderInfo(profile));
@@ -255,6 +283,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
@@ -256,6 +284,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
SetIfNotNull(ui_thread_polled_data.get(), "serviceProviders",
chrome_browser_net::GetWindowsServiceProviders());
#endif
@ -183,7 +183,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
file_writer_->StopNetLog(std::move(ui_thread_polled_data));
}
@@ -271,6 +300,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) {
@@ -272,6 +301,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) {
base::Bind(&NetExportMessageHandler::ShowFileInShell, AsWeakPtr()));
}
@ -191,7 +191,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
void NetExportMessageHandler::FileSelected(const base::FilePath& path,
int index,
void* params) {
@@ -289,6 +319,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) {
@@ -290,6 +320,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) {
DCHECK(select_file_dialog_);
select_file_dialog_ = nullptr;
}
@ -199,7 +199,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
void NetExportMessageHandler::OnNewState(const base::DictionaryValue& state) {
NotifyUIWithState(state.CreateDeepCopy());
@@ -353,6 +384,7 @@ void NetExportMessageHandler::NotifyUIWithState(
@@ -354,6 +385,7 @@ void NetExportMessageHandler::NotifyUIWithState(
*state);
}
@ -207,7 +207,7 @@ index 0924a6d73069..2fbdc6588a2c 100644
void NetExportMessageHandler::ShowSelectFileDialog(
const base::FilePath& default_path) {
// User may have clicked more than once before the save dialog appears.
@@ -371,6 +403,43 @@ void NetExportMessageHandler::ShowSelectFileDialog(
@@ -372,6 +404,43 @@ void NetExportMessageHandler::ShowSelectFileDialog(
ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), default_path,
&file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr);
}

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 5cdfec3a834b..99a06ed3332c 100644
index 6cdca1affb9f..f875ba1a5d75 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -990,10 +990,6 @@ void LaunchURL(const GURL& url,
@@ -1027,10 +1027,6 @@ void LaunchURL(const GURL& url,
}
}
@ -13,7 +13,7 @@ index 5cdfec3a834b..99a06ed3332c 100644
void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) {
// |allowlist| combines pref/policy + cmdline switch in the browser process.
// For renderer and utility (e.g. NetworkService) processes the switch is the
@@ -1088,6 +1084,14 @@ void MaybeRecordSameSiteCookieEngagementHistogram(
@@ -1125,6 +1121,14 @@ void MaybeRecordSameSiteCookieEngagementHistogram(
} // namespace
@ -29,10 +29,10 @@ index 5cdfec3a834b..99a06ed3332c 100644
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kUserAgent)) {
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index d6b48bfa4314..bc4266755dc7 100644
index e4a98f0bb2f6..cbc986303fd2 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -87,7 +87,8 @@ enum class Channel;
@@ -86,7 +86,8 @@ enum class Channel;
class ChromeHidDelegate;
class ChromeSerialDelegate;

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 1abea76ebc02..d9fc9c0450c2 100644
index 3c43cc752511..fbc476cc9023 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -359,7 +359,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
@@ -362,7 +362,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED,
content::NotificationService::AllSources());
@ -12,10 +12,10 @@ index 1abea76ebc02..d9fc9c0450c2 100644
}
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 7d02af7f8f60..eb70e533dbfb 100644
index f4c3c9e25190..dd91e00d3001 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -99,7 +99,7 @@ class ProfileManager : public content::NotificationObserver,
@@ -101,7 +101,7 @@ class ProfileManager : public content::NotificationObserver,
// acceptable. Returns null if creation of the new profile fails.
// TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then
// make this method private.
@ -24,7 +24,7 @@ index 7d02af7f8f60..eb70e533dbfb 100644
// Returns total number of profiles available on this machine.
size_t GetNumberOfProfiles();
@@ -129,7 +129,7 @@ class ProfileManager : public content::NotificationObserver,
@@ -131,7 +131,7 @@ class ProfileManager : public content::NotificationObserver,
// Returns true if the profile pointer is known to point to an existing
// profile.
@ -33,7 +33,7 @@ index 7d02af7f8f60..eb70e533dbfb 100644
// Returns the directory where the first created profile is stored,
// relative to the user data directory currently in use.
@@ -138,7 +138,7 @@ class ProfileManager : public content::NotificationObserver,
@@ -140,7 +140,7 @@ class ProfileManager : public content::NotificationObserver,
// Get the Profile last used (the Profile to which owns the most recently
// focused window) with this Chrome build. If no signed profile has been
// stored in Local State, hand back the Default profile.
@ -43,7 +43,7 @@ index 7d02af7f8f60..eb70e533dbfb 100644
// Get the path of the last used profile, or if that's undefined, the default
// profile.
diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc
index 07e6f8d726df..9a3c6b38b8eb 100644
index ce50c9ee3f92..eba0894ee2b4 100644
--- chrome/browser/profiles/renderer_updater.cc
+++ chrome/browser/profiles/renderer_updater.cc
@@ -7,6 +7,7 @@
@ -54,7 +54,7 @@ index 07e6f8d726df..9a3c6b38b8eb 100644
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
@@ -67,8 +68,12 @@ void GetGuestViewDefaultContentSettingRules(
@@ -62,8 +63,12 @@ void GetGuestViewDefaultContentSettingRules(
RendererUpdater::RendererUpdater(Profile* profile)
: profile_(profile), identity_manager_observer_(this) {
@ -67,7 +67,7 @@ index 07e6f8d726df..9a3c6b38b8eb 100644
#if defined(OS_CHROMEOS)
oauth2_login_manager_ =
chromeos::OAuth2LoginManagerFactory::GetForProfile(profile_);
@@ -238,7 +243,7 @@ void RendererUpdater::UpdateRenderer(
@@ -233,7 +238,7 @@ void RendererUpdater::UpdateRenderer(
force_google_safesearch_.GetValue(),
force_youtube_restrict_.GetValue(),
allowed_domains_for_apps_.GetValue(),

View File

@ -1,12 +1,12 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index 0f60694e2d9f..35eeee3233a1 100644
index 7bd46afdfd34..f3d2d056d6a0 100644
--- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn
@@ -237,6 +237,7 @@ jumbo_static_library("safe_browsing") {
@@ -243,6 +243,7 @@ jumbo_static_library("safe_browsing") {
"//chrome/common/safe_browsing:download_type_util",
"//chrome/services/file_util/public/cpp",
"//components/content_settings/core/browser",
+ "//components/gcm_driver:gcm_buildflags",
"//components/language/core/common",
"//components/prefs",
"//components/safe_browsing/db",
"//components/safe_browsing/core/db",

View File

@ -1,18 +1,18 @@
diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc
index 3f065778092c..3661a9ece2a6 100644
index 5a0d5e736cb9..f1c9da3f73b1 100644
--- chrome/browser/themes/theme_service_factory.cc
+++ chrome/browser/themes/theme_service_factory.cc
@@ -6,6 +6,7 @@
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/no_destructor.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
@@ -25,6 +26,10 @@
#include "ui/views/linux_ui/linux_ui.h"
#endif
@@ -42,6 +43,10 @@ const ThemeHelper& GetThemeHelper() {
} // namespace
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
@ -21,7 +21,7 @@ index 3f065778092c..3661a9ece2a6 100644
// static
ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) {
return static_cast<ThemeService*>(
@@ -54,7 +59,13 @@ ThemeServiceFactory::ThemeServiceFactory()
@@ -71,7 +76,13 @@ ThemeServiceFactory::ThemeServiceFactory()
BrowserContextDependencyManager::GetInstance()) {
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());

View File

@ -165,17 +165,16 @@ index 4e64db143b8a..71322b0261a1 100644
Profile* profile = Profile::FromBrowserContext(browser_context);
std::vector<std::string> whitelist = MimeTypesHandler::GetMIMETypeWhitelist();
diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc
index 69539de7b1ec..001cf1d1fe0d 100644
index a7e5caea5add..f9d11b317946 100644
--- chrome/common/google_url_loader_throttle.cc
+++ chrome/common/google_url_loader_throttle.cc
@@ -4,11 +4,16 @@
@@ -4,10 +4,15 @@
#include "chrome/common/google_url_loader_throttle.h"
+#include "cef/libcef/features/features.h"
#include "chrome/common/net/safe_search_util.h"
#include "components/variations/net/variations_http_headers.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
+#if BUILDFLAG(ENABLE_CEF)
@ -185,7 +184,7 @@ index 69539de7b1ec..001cf1d1fe0d 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/extension_urls.h"
#endif
@@ -97,6 +102,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse(
@@ -96,6 +101,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse(
const GURL& response_url,
network::mojom::URLResponseHead* response_head,
bool* defer) {
@ -198,10 +197,10 @@ index 69539de7b1ec..001cf1d1fe0d 100644
GURL webstore_url(extension_urls::GetWebstoreLaunchURL());
if (response_url.SchemeIsHTTPOrHTTPS() &&
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index ffde51cd276a..3ef2ad8d3945 100644
index e03ad3a5a115..12adcae6cf84 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -814,6 +814,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -811,6 +811,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
@ -209,7 +208,7 @@ index ffde51cd276a..3ef2ad8d3945 100644
content_settings_agent->IsPluginTemporarilyAllowed(identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
}
@@ -1012,7 +1013,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1009,7 +1010,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
plugin_auth_host.BindNewEndpointAndPassReceiver());
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@ -219,7 +218,7 @@ index ffde51cd276a..3ef2ad8d3945 100644
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -1021,7 +1023,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1018,7 +1020,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@ -229,7 +228,7 @@ index ffde51cd276a..3ef2ad8d3945 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1031,7 +1034,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1028,7 +1031,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));
@ -239,7 +238,7 @@ index ffde51cd276a..3ef2ad8d3945 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
@@ -1039,7 +1043,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1036,7 +1040,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
group_name));
@ -250,10 +249,10 @@ index ffde51cd276a..3ef2ad8d3945 100644
}
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc
index b86b883882cf..442bfa6753d8 100644
index ed7a8e4d9c7b..19af355cac2a 100644
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -358,8 +358,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
@@ -359,8 +359,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
if (status ==
content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) {

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/ui/prefs/pref_watcher.h chrome/browser/ui/prefs/pref_watcher.h
index dd06c6d22b16..1f3a5aa7ac2b 100644
index a439b2ce1b32..21c7b97639f4 100644
--- chrome/browser/ui/prefs/pref_watcher.h
+++ chrome/browser/ui/prefs/pref_watcher.h
@@ -29,10 +29,10 @@ class PrefWatcher : public KeyedService {
@ -13,4 +13,4 @@ index dd06c6d22b16..1f3a5aa7ac2b 100644
+ private:
void UpdateRendererPreferences();
void OnWebPrefChanged(const std::string& pref_name);
void OnLiveCaptionEnabledPrefChanged(const std::string& pref_name);

View File

@ -1,16 +1,16 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 4e229c16628f..17741b4d83a1 100644
index b2eaaf2b29fd..842e99c37e95 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -4,6 +4,7 @@
@@ -5,6 +5,7 @@
import("//build/config/buildflags_paint_preview.gni")
import("//build/config/features.gni")
import("//build/config/jumbo.gni")
+import("//cef/libcef/features/features.gni")
import("//chrome/common/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
@@ -128,6 +129,7 @@ jumbo_static_library("renderer") {
@@ -129,6 +130,7 @@ jumbo_static_library("renderer") {
defines = []
deps = [
@ -18,7 +18,7 @@ index 4e229c16628f..17741b4d83a1 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -196,6 +198,10 @@ jumbo_static_library("renderer") {
@@ -194,6 +196,10 @@ jumbo_static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

View File

@ -1,5 +1,5 @@
diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn
index 60757fdc2eee..29012ea670cf 100644
index 1919784f5f93..6a8d2d5140f2 100644
--- third_party/widevine/cdm/BUILD.gn
+++ third_party/widevine/cdm/BUILD.gn
@@ -5,6 +5,7 @@

View File

@ -20,7 +20,7 @@ index 544ed223ac8e..490330c87453 100644
bool is_navigation,
bool is_download,
diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h
index 33a2d55e47ac..1700b3df2468 100644
index a1f57138a24f..f6dd542ab89e 100644
--- content/browser/renderer_host/input/synthetic_gesture_target_base.h
+++ content/browser/renderer_host/input/synthetic_gesture_target_base.h
@@ -8,6 +8,7 @@
@ -28,10 +28,10 @@ index 33a2d55e47ac..1700b3df2468 100644
#include "base/time/time.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target.h"
+#include "content/common/content_export.h"
#include "ui/gfx/geometry/point_f.h"
namespace ui {
class LatencyInfo;
@@ -24,7 +25,8 @@ namespace content {
@@ -25,7 +26,8 @@ namespace content {
class RenderWidgetHostImpl;
@ -55,7 +55,7 @@ index 886bdf0edf8f..1d714000cce5 100644
blink::mojom::V8CacheOptions GetV8CacheOptions();
diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn
index afb225949027..d0647753af2b 100644
index ea7f0d6dbdac..d586c2900861 100644
--- third_party/blink/renderer/controller/BUILD.gn
+++ third_party/blink/renderer/controller/BUILD.gn
@@ -25,6 +25,7 @@ jumbo_component("controller") {
@ -74,14 +74,14 @@ index afb225949027..d0647753af2b 100644
+ "//cef/libcef/renderer/blink_glue.h",
]
if (is_android) {
if (is_linux) {
diff --git ui/events/keycodes/BUILD.gn ui/events/keycodes/BUILD.gn
index 97e5fd499c81..8508a8fbcc8e 100644
index 772d0ef90e03..7d6d9aaf8014 100644
--- ui/events/keycodes/BUILD.gn
+++ ui/events/keycodes/BUILD.gn
@@ -18,6 +18,8 @@ jumbo_source_set("xkb") {
"//ui/base:buildflags",
]
@@ -16,6 +16,8 @@ jumbo_source_set("xkb") {
public_deps = [ "//ui/base:buildflags" ]
+ defines = [ "KEYCODES_X_IMPLEMENTATION" ]
+

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 2d5b195caecb..827fcc962640 100644
index c07ba782b810..7ae3ab09a15a 100644
--- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc
@@ -636,7 +636,7 @@ void IsHandledBySafePlugin(int render_process_id,
@@ -639,7 +639,7 @@ void IsHandledBySafePlugin(int render_process_id,
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(
@ -49,25 +49,23 @@ index 8d7b5276955d..787f338e7ca6 100644
false /* allow_wildcard */, is_stale, &plugin_info,
nullptr /* actual_mime_type */);
diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
index 000ce05d8712..5806aef4d696 100644
index e622e8099e95..2b08fc4e3727 100644
--- chrome/browser/ui/views/frame/browser_root_view.cc
+++ chrome/browser/ui/views/frame/browser_root_view.cc
@@ -69,8 +69,8 @@ void OnFindURLMimeType(const GURL& url,
std::move(callback).Run(
url, mime_type.empty() || blink::IsSupportedMimeType(mime_type) ||
content::PluginService::GetInstance()->GetPluginInfo(
- process_id, routing_id, url, url::Origin(), mime_type, false,
- nullptr, &plugin, nullptr));
+ process_id, routing_id, url, true, url::Origin(), mime_type,
+ false, nullptr, &plugin, nullptr));
}
@@ -75,7 +75,7 @@ void OnFindURLMimeType(const GURL& url,
#if BUILDFLAG(ENABLE_PLUGINS)
content::WebPluginInfo plugin;
result = result || content::PluginService::GetInstance()->GetPluginInfo(
- process_id, routing_id, url, url::Origin(), mime_type,
+ process_id, routing_id, url, true, url::Origin(), mime_type,
false, nullptr, &plugin, nullptr);
#endif
bool GetURLForDrop(const ui::DropTargetEvent& event, GURL* url) {
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
index 23565fc63987..88caf430a0c9 100644
index 6518a57a5f16..e88984c8150c 100644
--- content/browser/devtools/devtools_http_handler.cc
+++ content/browser/devtools/devtools_http_handler.cc
@@ -570,7 +570,7 @@ void DevToolsHttpHandler::OnJsonRequest(
@@ -571,7 +571,7 @@ void DevToolsHttpHandler::OnJsonRequest(
version.SetString("Protocol-Version",
DevToolsAgentHost::GetProtocolVersion());
version.SetString("WebKit-Version", GetWebKitVersion());
@ -77,7 +75,7 @@ index 23565fc63987..88caf430a0c9 100644
GetContentClient()->browser()->GetUserAgent());
version.SetString("V8-Version", V8_VERSION_STRING);
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index c194f7a03838..450b6cb2c3ca 100644
index c80e4075de69..7bc702749974 100644
--- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc
@@ -308,6 +308,7 @@ void RenderFrameMessageFilter::OnAre3DAPIsBlocked(int render_frame_id,
@ -101,7 +99,7 @@ index c194f7a03838..450b6cb2c3ca 100644
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h
index 307a119bb9d8..c522bfcf3298 100644
index 9ce9487ef40c..78421b32149c 100644
--- content/browser/frame_host/render_frame_message_filter.h
+++ content/browser/frame_host/render_frame_message_filter.h
@@ -90,6 +90,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter {
@ -113,10 +111,10 @@ index 307a119bb9d8..c522bfcf3298 100644
const std::string& mime_type,
bool* found,
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
index a223fcaccd46..9ca82d7c1c8d 100644
index 7f322176a102..9301825b8b59 100644
--- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc
@@ -697,6 +697,13 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
@@ -716,6 +716,13 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
resource_request_->has_user_gesture,
resource_request_->request_initiator, &loader_factory);
@ -130,7 +128,7 @@ index a223fcaccd46..9ca82d7c1c8d 100644
if (loader_factory) {
factory =
base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>(
@@ -905,7 +912,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
@@ -924,7 +931,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
frame_tree_node->current_frame_host()->GetProcess()->GetID();
int routing_id = frame_tree_node->current_frame_host()->GetRoutingID();
bool has_plugin = PluginService::GetInstance()->GetPluginInfo(
@ -140,10 +138,10 @@ index a223fcaccd46..9ca82d7c1c8d 100644
if (stale) {
diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
index 4461a489227e..fea615b44abe 100644
index 848431a0cad6..9001ad4c9e68 100644
--- content/browser/plugin_service_impl.cc
+++ content/browser/plugin_service_impl.cc
@@ -302,6 +302,7 @@ bool PluginServiceImpl::GetPluginInfoArray(
@@ -311,6 +311,7 @@ bool PluginServiceImpl::GetPluginInfoArray(
bool PluginServiceImpl::GetPluginInfo(int render_process_id,
int render_frame_id,
const GURL& url,
@ -151,7 +149,7 @@ index 4461a489227e..fea615b44abe 100644
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
@@ -319,7 +320,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
@@ -328,7 +329,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
for (size_t i = 0; i < plugins.size(); ++i) {
if (!filter_ ||
filter_->IsPluginAvailable(render_process_id, render_frame_id, url,
@ -162,7 +160,7 @@ index 4461a489227e..fea615b44abe 100644
if (actual_mime_type)
*actual_mime_type = mime_types[i];
diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h
index 6c39259a2c67..b3d18b1135d3 100644
index 79ac3b705511..71d73d3da158 100644
--- content/browser/plugin_service_impl.h
+++ content/browser/plugin_service_impl.h
@@ -54,6 +54,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService {
@ -226,10 +224,10 @@ index 632ae86c6fd6..55b749ec1242 100644
const std::vector<WebPluginInfo>& all_plugins);
diff --git content/common/frame_messages.h content/common/frame_messages.h
index 06c8e08ba8d5..1e349e3c06b6 100644
index 4370f99c9a51..8dc0736e2b59 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -1060,9 +1060,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
@@ -826,9 +826,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
// type. If there is no matching plugin, |found| is false.
// |actual_mime_type| is the actual mime type supported by the
// found plugin.
@ -242,10 +240,10 @@ index 06c8e08ba8d5..1e349e3c06b6 100644
std::string /* mime_type */,
bool /* found */,
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index b70473936db0..0cb62733520b 100644
index 51f31b2c7e43..85faf2c0486b 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -24,6 +24,7 @@
@@ -26,6 +26,7 @@
#include "content/common/content_export.h"
#include "content/public/browser/certificate_request_result_type.h"
#include "content/public/browser/generated_code_cache_settings.h"
@ -253,7 +251,7 @@ index b70473936db0..0cb62733520b 100644
#include "content/public/common/page_visibility_state.h"
#include "content/public/common/previews_state.h"
#include "content/public/common/window_container_type.mojom-forward.h"
@@ -1611,6 +1612,14 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1626,6 +1627,14 @@ class CONTENT_EXPORT ContentBrowserClient {
const base::Optional<url::Origin>& initiating_origin,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
@ -268,7 +266,7 @@ index b70473936db0..0cb62733520b 100644
// Creates an OverlayWindow to be used for Picture-in-Picture. This window
// will house the content shown when in Picture-in-Picture mode. This will
// return a new OverlayWindow.
@@ -1674,6 +1683,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1689,6 +1698,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct();
@ -304,7 +302,7 @@ index 98c59005599e..69752184745d 100644
WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index 6002ce70bb17..4198134b1b73 100644
index 87df60c52d1e..c3841a7845dd 100644
--- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h
@@ -80,6 +80,9 @@ class CONTENT_EXPORT ContentRendererClient {
@ -317,7 +315,7 @@ index 6002ce70bb17..4198134b1b73 100644
// Notifies that a new RenderFrame has been created.
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
@@ -328,6 +331,10 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -321,6 +324,10 @@ class CONTENT_EXPORT ContentRendererClient {
// This method may invalidate the frame.
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
@ -329,10 +327,10 @@ index 6002ce70bb17..4198134b1b73 100644
// started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index 32a6927eaa93..540a6cbf450b 100644
index 00bbbdc9b82d..a3c923fcc442 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -3892,7 +3892,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
@@ -3796,7 +3796,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
std::string mime_type;
bool found = false;
Send(new FrameHostMsg_GetPluginInfo(
@ -343,10 +341,10 @@ index 32a6927eaa93..540a6cbf450b 100644
if (!found)
return nullptr;
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 078c895fe5cd..f763acde4d66 100644
index ae1a77a219f1..f91dd6477bf3 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -624,6 +624,8 @@ void RenderThreadImpl::Init() {
@@ -620,6 +620,8 @@ void RenderThreadImpl::Init() {
GetContentClient()->renderer()->CreateURLLoaderThrottleProvider(
URLLoaderThrottleProviderType::kFrame);
@ -356,10 +354,10 @@ index 078c895fe5cd..f763acde4d66 100644
&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 17e84479f922..6bf6c2ab93ac 100644
index 58c1b0e78a66..e8efa7277f33 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -918,6 +918,15 @@ RendererBlinkPlatformImpl::GetGpuFactories() {
@@ -914,6 +914,15 @@ RendererBlinkPlatformImpl::GetGpuFactories() {
//------------------------------------------------------------------------------
@ -376,7 +374,7 @@ index 17e84479f922..6bf6c2ab93ac 100644
if (!code_cache_host_) {
code_cache_host_ = mojo::SharedRemote<blink::mojom::CodeCacheHost>(
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index edbf232175e4..27e4c87dd4c1 100644
index 096cd162c7d5..c409b6eb08ca 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -197,6 +197,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {

View File

@ -1,5 +1,5 @@
diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc
index 8b3b16ff94f6..96e5ead655e5 100644
index 3b37ef6a284e..466c0331311e 100644
--- content/app/content_main_runner_impl.cc
+++ content/app/content_main_runner_impl.cc
@@ -43,6 +43,7 @@
@ -10,7 +10,7 @@ index 8b3b16ff94f6..96e5ead655e5 100644
#include "base/trace_event/trace_event.h"
#include "components/discardable_memory/service/discardable_shared_memory_manager.h"
#include "components/download/public/common/download_task_runner.h"
@@ -996,6 +997,11 @@ void ContentMainRunnerImpl::Shutdown() {
@@ -1001,6 +1002,11 @@ void ContentMainRunnerImpl::Shutdown() {
is_shutdown_ = true;
}
@ -23,10 +23,10 @@ index 8b3b16ff94f6..96e5ead655e5 100644
ContentMainRunner* ContentMainRunner::Create() {
return ContentMainRunnerImpl::Create();
diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h
index 9575db7e2311..6b449160565d 100644
index 72098b4d06f8..2c2091576aa8 100644
--- content/app/content_main_runner_impl.h
+++ content/app/content_main_runner_impl.h
@@ -51,6 +51,8 @@ class ContentMainRunnerImpl : public ContentMainRunner {
@@ -50,6 +50,8 @@ class ContentMainRunnerImpl : public ContentMainRunner {
int Run(bool start_service_manager_only) override;
void Shutdown() override;

View File

@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc
index 6c40589cc989..a34b0eb0eb15 100644
index fe3311bc5e54..e4b5385ff3bf 100644
--- content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc
+++ content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc
@@ -55,7 +55,7 @@ PepperFlashFileMessageFilter::PepperFlashFileMessageFilter(

View File

@ -1,5 +1,5 @@
diff --git chrome/chrome_elf/BUILD.gn chrome/chrome_elf/BUILD.gn
index 99ef45605fb5..2e16fc44a242 100644
index abd8ceba1896..f92981183aad 100644
--- chrome/chrome_elf/BUILD.gn
+++ chrome/chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@
@ -10,7 +10,7 @@ index 99ef45605fb5..2e16fc44a242 100644
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")
@@ -110,9 +111,6 @@ source_set("constants") {
@@ -104,9 +105,6 @@ source_set("constants") {
static_library("crash") {
sources = [
@ -20,7 +20,7 @@ index 99ef45605fb5..2e16fc44a242 100644
"crash/crash_helper.cc",
"crash/crash_helper.h",
]
@@ -120,6 +118,7 @@ static_library("crash") {
@@ -114,6 +112,7 @@ static_library("crash") {
":hook_util",
"//base", # This needs to go. DEP of app, crash_keys, client.
"//base:base_static", # pe_image
@ -28,7 +28,7 @@ index 99ef45605fb5..2e16fc44a242 100644
"//chrome/install_static:install_static_util",
"//components/crash/content/app",
"//components/crash/core/common", # crash_keys
@@ -127,6 +126,17 @@ static_library("crash") {
@@ -121,6 +120,17 @@ static_library("crash") {
"//content/public/common:result_codes",
"//third_party/crashpad/crashpad/client", # DumpWithoutCrash
]
@ -47,7 +47,7 @@ index 99ef45605fb5..2e16fc44a242 100644
source_set("dll_hash") {
diff --git chrome/chrome_elf/crash/crash_helper.cc chrome/chrome_elf/crash/crash_helper.cc
index 381322aca895..a5622ddfe66d 100644
index a02aa37c566a..0d0581132bdd 100644
--- chrome/chrome_elf/crash/crash_helper.cc
+++ chrome/chrome_elf/crash/crash_helper.cc
@@ -11,12 +11,17 @@
@ -68,7 +68,7 @@ index 381322aca895..a5622ddfe66d 100644
namespace {
// Crash handling from elf is only enabled for the chrome.exe process.
@@ -74,7 +79,11 @@ bool InitializeCrashReporting() {
@@ -77,7 +82,11 @@ bool InitializeCrashReporting() {
g_crash_reports = new std::vector<crash_reporter::Report>;
g_set_unhandled_exception_filter = new elf_hook::IATHook();
@ -514,7 +514,7 @@ index c2de9fe867c5..29cda67a1f72 100644
handler_path, database_path, metrics_path, url,
GetProcessSimpleAnnotations(), arguments, true, false);
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
index d13ae5cf7e40..f87f84d3121c 100644
index 4e6d3052b315..f8c4dfb37e5d 100644
--- components/crash/content/app/crashpad_win.cc
+++ components/crash/content/app/crashpad_win.cc
@@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations(
@ -548,9 +548,9 @@ index d13ae5cf7e40..f87f84d3121c 100644
const char kServerUrlVar[] = "CHROME_CRASHPAD_SERVER_URL";
+#endif
std::unique_ptr<base::Environment> env(base::Environment::Create());
if (initial_client) {
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
@@ -86,13 +88,13 @@ base::FilePath PlatformCrashpadInitialization(
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
@@ -87,13 +89,13 @@ base::FilePath PlatformCrashpadInitialization(
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
std::string url = "https://clients2.google.com/cr/report";
@ -567,8 +567,8 @@ index d13ae5cf7e40..f87f84d3121c 100644
base::FilePath exe_file(exe_path);
if (exe_file.empty()) {
@@ -110,13 +112,14 @@ base::FilePath PlatformCrashpadInitialization(
crashpad::TriState::kEnabled, kIndirectMemoryLimit);
@@ -104,13 +106,14 @@ base::FilePath PlatformCrashpadInitialization(
exe_file = base::FilePath(exe_file_path);
}
- // If the handler is embedded in the binary (e.g. chrome, setup), we
@ -587,7 +587,7 @@ index d13ae5cf7e40..f87f84d3121c 100644
if (!user_data_dir.empty()) {
start_arguments.push_back(std::string("--user-data-dir=") +
user_data_dir);
@@ -127,9 +130,12 @@ base::FilePath PlatformCrashpadInitialization(
@@ -121,9 +124,12 @@ base::FilePath PlatformCrashpadInitialization(
start_arguments.push_back("/prefetch:7");
} else {
base::FilePath exe_dir = exe_file.DirName();

View File

@ -146,7 +146,7 @@ index a2b0c74636f4..01370fdc20d9 100644
struct Data;
diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn
index 550f686a4562..b6cc04846d42 100644
index b06f68af3baa..42b47ab40109 100644
--- third_party/crashpad/crashpad/handler/BUILD.gn
+++ third_party/crashpad/crashpad/handler/BUILD.gn
@@ -12,6 +12,7 @@
@ -248,7 +248,7 @@ index 2ec1147d2620..8ff9a72e0bd7 100644
//! \brief Calls ProcessPendingReports() in response to ReportPending() having
//! been called on any thread, as well as periodically on a timer.
diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc
index 7d9701c0bf08..767a3c23fb4f 100644
index 1cf655aec466..50ff7ed6fdbf 100644
--- third_party/crashpad/crashpad/handler/handler_main.cc
+++ third_party/crashpad/crashpad/handler/handler_main.cc
@@ -36,8 +36,10 @@
@ -273,7 +273,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644
namespace crashpad {
namespace {
@@ -200,6 +206,9 @@ struct Options {
@@ -204,6 +210,9 @@ struct Options {
bool periodic_tasks;
bool rate_limit;
bool upload_gzip;
@ -281,9 +281,9 @@ index 7d9701c0bf08..767a3c23fb4f 100644
+ int max_database_size;
+ int max_database_age;
#if defined(OS_CHROMEOS)
bool use_cros_crash_reporter;
bool use_cros_crash_reporter = false;
base::FilePath minidump_dir_for_tests;
@@ -558,6 +567,9 @@ int HandlerMain(int argc,
@@ -563,6 +572,9 @@ int HandlerMain(int argc,
kOptionTraceParentWithException,
#endif
kOptionURL,
@ -293,7 +293,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644
#if defined(OS_CHROMEOS)
kOptionUseCrosCrashReporter,
kOptionMinidumpDirForTests,
@@ -639,6 +651,9 @@ int HandlerMain(int argc,
@@ -649,6 +661,9 @@ int HandlerMain(int argc,
#endif // OS_CHROMEOS
{"help", no_argument, nullptr, kOptionHelp},
{"version", no_argument, nullptr, kOptionVersion},
@ -303,7 +303,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644
{nullptr, 0, nullptr, 0},
};
@@ -778,6 +793,27 @@ int HandlerMain(int argc,
@@ -788,6 +803,27 @@ int HandlerMain(int argc,
options.url = optarg;
break;
}
@ -331,7 +331,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644
#if defined(OS_CHROMEOS)
case kOptionUseCrosCrashReporter: {
options.use_cros_crash_reporter = true;
@@ -909,8 +945,14 @@ int HandlerMain(int argc,
@@ -923,8 +959,14 @@ int HandlerMain(int argc,
upload_thread_options.upload_gzip = options.upload_gzip;
upload_thread_options.watch_pending_reports = options.periodic_tasks;
@ -346,7 +346,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644
upload_thread.Get()->Start();
}
@@ -966,7 +1008,8 @@ int HandlerMain(int argc,
@@ -984,7 +1026,8 @@ int HandlerMain(int argc,
ScopedStoppable prune_thread;
if (options.periodic_tasks) {
prune_thread.Reset(new PruneCrashReportThread(

View File

@ -27,7 +27,7 @@ index 3841b7adf65d..41ca32ea5e2f 100644
auto* browser_context = web_contents->GetBrowserContext();
diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc
index 55284840012b..c24e5ee96ae0 100644
index 524c0603c138..f10ecd683aae 100644
--- extensions/browser/extension_host.cc
+++ extensions/browser/extension_host.cc
@@ -66,11 +66,12 @@ ExtensionHost::ExtensionHost(const Extension* extension,
@ -97,7 +97,7 @@ index 55284840012b..c24e5ee96ae0 100644
ExtensionRegistry::Get(browser_context_)->RemoveObserver(this);
diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h
index a2914294a795..5140f9f5b165 100644
index 093fb25589a9..3e6247802c52 100644
--- extensions/browser/extension_host.h
+++ extensions/browser/extension_host.h
@@ -52,13 +52,19 @@ class ExtensionHost : public DeferredStartRenderHost,
@ -132,10 +132,10 @@ index a2914294a795..5140f9f5b165 100644
// A weak pointer to the current or pending RenderViewHost. We don't access
// this through the host_contents because we want to deal with the pending
diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h
index 72defe9fa9de..31041cd2a459 100644
index e697984786c5..dc84cfd92669 100644
--- extensions/browser/extensions_browser_client.h
+++ extensions/browser/extensions_browser_client.h
@@ -57,6 +57,7 @@ class ComponentExtensionResourceManager;
@@ -56,6 +56,7 @@ class ComponentExtensionResourceManager;
class Extension;
class ExtensionCache;
class ExtensionError;
@ -143,7 +143,7 @@ index 72defe9fa9de..31041cd2a459 100644
class ExtensionHostDelegate;
class ExtensionSet;
class ExtensionSystem;
@@ -196,6 +197,14 @@ class ExtensionsBrowserClient {
@@ -195,6 +196,14 @@ class ExtensionsBrowserClient {
virtual std::unique_ptr<ExtensionHostDelegate>
CreateExtensionHostDelegate() = 0;
@ -159,10 +159,10 @@ index 72defe9fa9de..31041cd2a459 100644
// once each time the extensions system is loaded per browser_context. The
// implementation may wish to use the BrowserContext to record the current
diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc
index 6c235f6a15b3..b0b907b63d32 100644
index 3c02c62162f1..13c355db03e0 100644
--- extensions/browser/process_manager.cc
+++ extensions/browser/process_manager.cc
@@ -385,9 +385,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
@@ -386,9 +386,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
return true; // TODO(kalman): return false here? It might break things...
DVLOG(1) << "CreateBackgroundHost " << extension->id();

Some files were not shown because too many files have changed in this diff Show More