Update to Chromium version 100.0.4896.0 (#972766)

This commit is contained in:
Marshall Greenblatt
2022-02-21 17:23:40 -05:00
parent a2c621bf8b
commit f97f0bbda6
120 changed files with 668 additions and 725 deletions

View File

@@ -1456,15 +1456,13 @@ bool AlloyBrowserHostImpl::IsNeverComposited(
}
content::PictureInPictureResult AlloyBrowserHostImpl::EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
content::WebContents* web_contents) {
if (!IsPictureInPictureSupported()) {
return content::PictureInPictureResult::kNotSupported;
}
return PictureInPictureWindowManager::GetInstance()->EnterPictureInPicture(
web_contents, surface_id, natural_size);
return PictureInPictureWindowManager::GetInstance()
->EnterVideoPictureInPicture(web_contents);
}
void AlloyBrowserHostImpl::ExitPictureInPicture() {
@@ -1477,7 +1475,8 @@ bool AlloyBrowserHostImpl::IsBackForwardCacheSupported() {
return false;
}
bool AlloyBrowserHostImpl::IsPrerender2Supported() {
bool AlloyBrowserHostImpl::IsPrerender2Supported(
content::WebContents& web_contents) {
return true;
}

View File

@@ -283,12 +283,10 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
blink::mojom::MediaStreamType type) override;
bool IsNeverComposited(content::WebContents* web_contents) override;
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
content::WebContents* web_contents) override;
void ExitPictureInPicture() override;
bool IsBackForwardCacheSupported() override;
bool IsPrerender2Supported() override;
bool IsPrerender2Supported(content::WebContents& web_contents) override;
// content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired;

View File

@@ -115,7 +115,7 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_web_contents_observer.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
#include "extensions/browser/guest_view/extensions_guest_view.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/process_map.h"
@@ -197,7 +197,7 @@ class CefQuotaCallbackImpl : public CefCallback {
void Cancel() override { ContinueNow(false); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
void ContinueNow(bool allow) {
@@ -255,7 +255,7 @@ class CefAllowCertificateErrorCallbackImpl : public CefCallback {
void Cancel() override { ContinueNow(false); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
void ContinueNow(bool allow) {
@@ -521,8 +521,6 @@ void AlloyContentBrowserClient::RenderProcessWillLaunch(
if (extensions::ExtensionsEnabled()) {
host->AddFilter(new extensions::ExtensionMessageFilter(id, profile));
host->AddFilter(
new extensions::ExtensionsGuestViewMessageFilter(id, profile));
}
// If the renderer process crashes then the host may already have
@@ -765,14 +763,6 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
if (extensions::ExtensionsEnabled()) {
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(child_process_id);
#if !BUILDFLAG(IS_WIN)
// kPdfRenderer will be set for Windows in
// RenderProcessHostImpl::AppendRendererCommandLine.
if (process && process->IsPdf()) {
command_line->AppendSwitch(switches::kPdfRenderer);
}
#endif // !BUILDFLAG(IS_WIN)
auto browser_context = process->GetBrowserContext();
CefBrowserContext* cef_browser_context =
process ? CefBrowserContext::FromBrowserContext(browser_context)
@@ -1164,6 +1154,10 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
if (extensions::ExtensionsEnabled()) {
associated_registry->AddInterface(base::BindRepeating(
&extensions::EventRouter::BindForRenderer, host->GetID()));
associated_registry->AddInterface(base::BindRepeating(
&extensions::ExtensionsGuestView::CreateForComponents, host->GetID()));
associated_registry->AddInterface(base::BindRepeating(
&extensions::ExtensionsGuestView::CreateForExtensions, host->GetID()));
}
CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry,
@@ -1406,19 +1400,29 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
web_contents_getter, std::move(receiver), std::move(request_handler));
return true;
}
std::unique_ptr<content::OverlayWindow>
AlloyContentBrowserClient::CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) {
// Note: content::OverlayWindow::Create() is defined by platform-specific
std::unique_ptr<content::VideoOverlayWindow>
AlloyContentBrowserClient::CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) {
// Note: content::VideoOverlayWindow::Create() is defined by platform-specific
// implementation in chrome/browser/ui/views. This layering hack, which goes
// through //content and ContentBrowserClient, allows us to work around the
// dependency constraints that disallow directly calling
// chrome/browser/ui/views code either from here or from other code in
// chrome/browser.
return content::OverlayWindow::Create(controller);
return content::VideoOverlayWindow::Create(controller);
}
std::unique_ptr<content::DocumentOverlayWindow>
AlloyContentBrowserClient::CreateWindowForDocumentPictureInPicture(
content::DocumentPictureInPictureWindowController* controller) {
// Note: content::DocumentOverlayWindow::Create() is defined by
// platform-specific implementation in chrome/browser/ui/views. This layering
// hack, which goes through //content and ContentBrowserClient, allows us to
// work around the dependency constraints that disallow directly calling
// chrome/browser/ui/views code either from here or from other code in
// chrome/browser.
return content::DocumentOverlayWindow::Create(controller);
}
void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
@@ -1466,6 +1470,10 @@ std::string AlloyContentBrowserClient::GetUserAgent() {
return embedder_support::GetUserAgent();
}
std::string AlloyContentBrowserClient::GetFullUserAgent() {
return embedder_support::GetFullUserAgent();
}
std::string AlloyContentBrowserClient::GetReducedUserAgent() {
return embedder_support::GetReducedUserAgent();
}

View File

@@ -216,8 +216,12 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
override;
std::unique_ptr<content::OverlayWindow> CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) override;
std::unique_ptr<content::VideoOverlayWindow>
CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) override;
std::unique_ptr<content::DocumentOverlayWindow>
CreateWindowForDocumentPictureInPicture(
content::DocumentPictureInPictureWindowController* controller) override;
void RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
@@ -225,6 +229,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::string GetProduct() override;
std::string GetChromeProduct() override;
std::string GetUserAgent() override;
std::string GetFullUserAgent() override;
std::string GetReducedUserAgent() override;
blink::UserAgentMetadata GetUserAgentMetadata() override;
base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(

View File

@@ -329,12 +329,6 @@ ChromeBrowserProcessAlloy::subresource_filter_ruleset_service() {
return nullptr;
}
federated_learning::FlocSortingLshClustersService*
ChromeBrowserProcessAlloy::floc_sorting_lsh_clusters_service() {
NOTREACHED();
return nullptr;
}
StartupData* ChromeBrowserProcessAlloy::startup_data() {
NOTREACHED();
return nullptr;
@@ -409,6 +403,12 @@ ChromeBrowserProcessAlloy::serial_policy_allowed_ports() {
return nullptr;
}
HidPolicyAllowedDevices*
ChromeBrowserProcessAlloy::hid_policy_allowed_devices() {
NOTREACHED();
return nullptr;
}
breadcrumbs::BreadcrumbPersistentStorageManager*
ChromeBrowserProcessAlloy::GetBreadcrumbPersistentStorageManager() {
NOTREACHED();

View File

@@ -12,7 +12,6 @@
#include <memory>
#include <string>
#include "base/compiler_specific.h"
#include "base/metrics/field_trial.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/event_router_forwarder.h"
@@ -91,8 +90,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
subresource_filter::RulesetService* subresource_filter_ruleset_service()
override;
federated_learning::FlocSortingLshClustersService*
floc_sorting_lsh_clusters_service() override;
StartupData* startup_data() override;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
@@ -109,6 +106,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
override;
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidPolicyAllowedDevices* hid_policy_allowed_devices() override;
breadcrumbs::BreadcrumbPersistentStorageManager*
GetBreadcrumbPersistentStorageManager() override;

View File

@@ -83,7 +83,8 @@ void CreateSystemWideLoopbackStreamHelper(
const bool enable_agc = false;
factory->CreateInputStream(
-1, -1, media::AudioDeviceDescription::kLoopbackWithMuteDeviceId, params,
total_segments, enable_agc, std::move(client_remote));
total_segments, enable_agc, media::mojom::AudioProcessingConfigPtr(),
std::move(client_remote));
}
} // namespace

View File

@@ -331,8 +331,7 @@ void CefBrowserContentsDelegate::OnFrameFocused(
OnStateChanged(State::kFocusedFrame);
}
void CefBrowserContentsDelegate::DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) {
void CefBrowserContentsDelegate::PrimaryMainDocumentElementAvailable() {
has_document_ = true;
OnStateChanged(State::kDocument);

View File

@@ -121,8 +121,7 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
void PrimaryMainFrameRenderProcessGone(
base::TerminationStatus status) override;
void OnFrameFocused(content::RenderFrameHost* render_frame_host) override;
void DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) override;
void PrimaryMainDocumentElementAvailable() override;
void LoadProgressChanged(double progress) override;
void DidStopLoading() override;
void DidFinishNavigation(

View File

@@ -127,16 +127,6 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
base::size(kSwitchNames));
#if !BUILDFLAG(IS_WIN)
// kPdfRenderer will be set for Windows in
// RenderProcessHostImpl::AppendRendererCommandLine.
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(child_process_id);
if (process && process->IsPdf()) {
command_line->AppendSwitch(switches::kPdfRenderer);
}
#endif // !BUILDFLAG(IS_WIN)
}
CefRefPtr<CefApp> app = CefAppManager::Get()->GetApplication();

View File

@@ -339,8 +339,7 @@ void CefDevToolsFrontend::ReadyToCommitNavigation(
content::DevToolsFrontendHost::SetupExtensionsAPI(frame, script);
}
void CefDevToolsFrontend::DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) {
void CefDevToolsFrontend::PrimaryMainDocumentElementAvailable() {
// Don't call AttachClient multiple times for the same DevToolsAgentHost.
// Otherwise it will call AgentHostClosed which closes the DevTools window.
// This may happen in cases where the DevTools content fails to load.
@@ -381,7 +380,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
// Since we've received message by value, we can take the list.
base::Value::ListStorage params;
if (params_value) {
params = std::move(*params_value).TakeList();
params = std::move(*params_value).TakeListDeprecated();
}
if (*method == "dispatchProtocolMessage") {

View File

@@ -10,7 +10,6 @@
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/devtools/devtools_file_manager.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -81,8 +80,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
// WebContentsObserver overrides
void ReadyToCommitNavigation(
content::NavigationHandle* navigation_handle) override;
void DocumentAvailableInMainFrame(
content::RenderFrameHost* render_frame_host) override;
void PrimaryMainDocumentElementAvailable() override;
void WebContentsDestroyed() override;
void SendMessageAck(int request_id, base::Value arg);

View File

@@ -5,7 +5,6 @@
#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
#include "base/compiler_specific.h"
#include "content/public/browser/devtools_manager_delegate.h"
namespace content {

View File

@@ -10,7 +10,6 @@
#include "libcef/browser/browser_host_base.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/download_manager.h"

View File

@@ -86,10 +86,10 @@ void CefExtensionImpl::Unload() {
// flag, so set it here.
unloaded_ = true;
const bool result = static_cast<CefRequestContextImpl*>(loader_context_)
->GetBrowserContext()
->UnloadExtension(id_);
ALLOW_UNUSED_LOCAL(result);
[[maybe_unused]] const bool result =
static_cast<CefRequestContextImpl*>(loader_context_)
->GetBrowserContext()
->UnloadExtension(id_);
DCHECK(result);
}

View File

@@ -8,7 +8,6 @@
#include <memory>
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "extensions/browser/api/storage/settings_storage_quota_enforcer.h"
#include "extensions/browser/api/storage/value_store_cache.h"

View File

@@ -60,9 +60,7 @@ bool CefExtensionHostDelegate::CheckMediaAccessPermission(
}
content::PictureInPictureResult CefExtensionHostDelegate::EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
content::WebContents* web_contents) {
NOTREACHED();
return content::PictureInPictureResult::kNotSupported;
}

View File

@@ -38,9 +38,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
blink::mojom::MediaStreamType type,
const Extension* extension) override;
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
content::WebContents* web_contents) override;
void ExitPictureInPicture() override;
};

View File

@@ -466,11 +466,10 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
// Implementation based on
// ExtensionSystemImpl::UnregisterExtensionWithRequestContexts.
void CefExtensionSystem::UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionReason reason) {
const std::string& extension_id) {
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(&InfoMap::RemoveExtension, info_map(),
extension_id, reason));
FROM_HERE,
base::BindOnce(&InfoMap::RemoveExtension, info_map(), extension_id));
}
const base::OneShotEvent& CefExtensionSystem::ready() const {
@@ -611,7 +610,7 @@ void CefExtensionSystem::UnloadExtension(const std::string& extension_id,
if (!extension.get()) {
// In case the extension may have crashed/uninstalled. Allow the profile to
// clean up its RequestContexts.
UnregisterExtensionWithRequestContexts(extension_id, reason);
UnregisterExtensionWithRequestContexts(extension_id);
return;
}
@@ -620,7 +619,7 @@ void CefExtensionSystem::UnloadExtension(const std::string& extension_id,
// Make sure the profile cleans up its RequestContexts when an already
// disabled extension is unloaded (since they are also tracking the disabled
// extensions).
UnregisterExtensionWithRequestContexts(extension_id, reason);
UnregisterExtensionWithRequestContexts(extension_id);
// Don't send the unloaded notification. It was sent when the extension
// was disabled.
} else {
@@ -712,7 +711,7 @@ void CefExtensionSystem::NotifyExtensionUnloaded(
// Tell renderers about the unloaded extension.
renderer_helper_->OnExtensionUnloaded(*extension);
UnregisterExtensionWithRequestContexts(extension->id(), reason);
UnregisterExtensionWithRequestContexts(extension->id());
}
} // namespace extensions

View File

@@ -12,7 +12,6 @@
#include "include/cef_extension_handler.h"
#include "include/cef_request_context.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "base/one_shot_event.h"
#include "extensions/browser/extension_system.h"
@@ -102,8 +101,7 @@ class CefExtensionSystem : public ExtensionSystem {
const Extension* extension,
base::OnceClosure callback) override;
void UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionReason reason) override;
const std::string& extension_id) override;
const base::OneShotEvent& ready() const override;
bool is_ready() const override;
ContentVerifier* content_verifier() override;

View File

@@ -6,7 +6,6 @@
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_CLIENT_H_
#define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_CLIENT_H_
#include "base/compiler_specific.h"
#include "extensions/browser/extensions_browser_client.h"
namespace extensions {

View File

@@ -11,7 +11,6 @@
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "components/value_store/value_store.h"
namespace value_store {

View File

@@ -67,7 +67,7 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback {
}
}
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
static void CancelNow(CallbackType callback) {

View File

@@ -10,7 +10,6 @@
#include "include/cef_browser.h"
#include "libcef/browser/file_dialog_runner.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/web_contents_observer.h"

View File

@@ -47,7 +47,7 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback {
}
}
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
private:
static void CancelNow(CallbackType callback) {

View File

@@ -11,7 +11,6 @@
#include "libcef/browser/javascript_dialog_runner.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/javascript_dialog_manager.h"

View File

@@ -13,7 +13,6 @@
#include "libcef/browser/thread_util.h"
#include "libcef/common/app_manager.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "cef/grit/cef_strings.h"
#include "chrome/grit/generated_resources.h"

View File

@@ -236,8 +236,7 @@ void CefBrowserPlatformDelegateNativeLinux::ViewText(const std::string& text) {
std::string openCommand("xdg-open ");
openCommand += newName;
int result = system(openCommand.c_str());
ALLOW_UNUSED_LOCAL(result);
[[maybe_unused]] int result = system(openCommand.c_str());
}
bool CefBrowserPlatformDelegateNativeLinux::HandleKeyboardEvent(

View File

@@ -6,7 +6,6 @@
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/compiler_specific.h"
#include "base/strings/string_util.h"
#include "ui/gfx/geometry/point.h"

View File

@@ -6,7 +6,6 @@
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/compiler_specific.h"
#import "base/mac/scoped_sending_event.h"
#include "base/task/current_thread.h"
#import "ui/base/cocoa/menu_controller.h"

View File

@@ -10,7 +10,6 @@
#include "libcef/browser/native/menu_wrapper.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"

View File

@@ -17,7 +17,7 @@
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/x11_window_event_manager.h"
#include "ui/gfx/x/xproto_util.h"
#include "ui/platform_window/x11/x11_topmost_window_finder.h"
#include "ui/ozone/platform/x11/x11_topmost_window_finder.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
namespace {

View File

@@ -227,7 +227,8 @@ class InterceptedRequest : public network::mojom::URLLoader,
// mojom::URLLoaderClient methods:
void OnReceiveEarlyHints(network::mojom::EarlyHintsPtr early_hints) override;
void OnReceiveResponse(network::mojom::URLResponseHeadPtr head) override;
void OnReceiveResponse(network::mojom::URLResponseHeadPtr head,
mojo::ScopedDataPipeConsumerHandle body) override;
void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr head) override;
void OnUploadProgress(int64_t current_position,
@@ -333,6 +334,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
network::ResourceRequest request_;
network::mojom::URLResponseHeadPtr current_response_;
mojo::ScopedDataPipeConsumerHandle current_body_;
scoped_refptr<net::HttpResponseHeaders> current_headers_;
scoped_refptr<net::HttpResponseHeaders> override_headers_;
GURL original_url_;
@@ -556,8 +558,10 @@ void InterceptedRequest::OnReceiveEarlyHints(
}
void InterceptedRequest::OnReceiveResponse(
network::mojom::URLResponseHeadPtr head) {
network::mojom::URLResponseHeadPtr head,
mojo::ScopedDataPipeConsumerHandle body) {
current_response_ = std::move(head);
current_body_ = std::move(body);
if (current_request_uses_header_client_) {
// Use the headers we got from OnHeadersReceived as that'll contain
@@ -580,6 +584,7 @@ void InterceptedRequest::OnReceiveRedirect(
bool needs_callback = false;
current_response_ = std::move(head);
current_body_.reset();
if (current_request_uses_header_client_) {
// Use the headers we got from OnHeadersReceived as that'll contain
@@ -743,6 +748,7 @@ void InterceptedRequest::InterceptResponseReceived(
current_response_ = network::mojom::URLResponseHead::New();
current_response_->request_start = base::TimeTicks::Now();
current_response_->response_start = base::TimeTicks::Now();
current_body_.reset();
auto headers = MakeResponseHeaders(
net::HTTP_TEMPORARY_REDIRECT, std::string(), std::string(),
@@ -1041,7 +1047,8 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) {
if (proxied_client_receiver_.is_bound())
proxied_client_receiver_.Resume();
target_client_->OnReceiveResponse(std::move(current_response_));
target_client_->OnReceiveResponse(std::move(current_response_),
std::move(current_body_));
}
if (stream_loader_)

View File

@@ -38,12 +38,12 @@ class OpenInputStreamWrapper
OpenInputStreamWrapper(const OpenInputStreamWrapper&) = delete;
OpenInputStreamWrapper& operator=(const OpenInputStreamWrapper&) = delete;
static base::OnceClosure Open(
[[nodiscard]] static base::OnceClosure Open(
std::unique_ptr<StreamReaderURLLoader::Delegate> delegate,
scoped_refptr<base::SequencedTaskRunner> work_thread_task_runner,
int32_t request_id,
const network::ResourceRequest& request,
OnInputStreamOpenedCallback callback) WARN_UNUSED_RESULT {
OnInputStreamOpenedCallback callback) {
scoped_refptr<OpenInputStreamWrapper> wrapper = new OpenInputStreamWrapper(
std::move(delegate), work_thread_task_runner,
base::ThreadTaskRunnerHandle::Get(), std::move(callback));
@@ -697,7 +697,8 @@ void StreamReaderURLLoader::ContinueWithResponseHeaders(
// |this| will be deleted.
CleanUp();
} else {
client_->OnReceiveResponse(std::move(pending_response));
client_->OnReceiveResponse(std::move(pending_response),
mojo::ScopedDataPipeConsumerHandle());
}
}

View File

@@ -139,7 +139,3 @@ void CefVideoConsumerOSR::OnFrameCaptured(
view_->OnPaint(damage_rect, info->coded_size, pixels);
}
void CefVideoConsumerOSR::OnStopped() {}
void CefVideoConsumerOSR::OnLog(const std::string& message) {}

View File

@@ -30,8 +30,9 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer {
const gfx::Rect& content_rect,
mojo::PendingRemote<viz::mojom::FrameSinkVideoConsumerFrameCallbacks>
callbacks) override;
void OnStopped() override;
void OnLog(const std::string& message) override;
void OnFrameWithEmptyRegionCapture() override {}
void OnStopped() override {}
void OnLog(const std::string& message) override {}
CefRenderWidgetHostViewOSR* const view_;
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;

View File

@@ -9,7 +9,6 @@
#include <string>
#include "base/compiler_specific.h"
#include "base/observer_list.h"
#include "components/prefs/persistent_pref_store.h"
#include "components/prefs/pref_value_map.h"

View File

@@ -47,7 +47,7 @@ class CefPrintSettingsImpl
void SetDuplexMode(DuplexMode mode) override;
DuplexMode GetDuplexMode() override;
std::unique_ptr<printing::PrintSettings> TakeOwnership() WARN_UNUSED_RESULT;
[[nodiscard]] std::unique_ptr<printing::PrintSettings> TakeOwnership();
};
#endif // CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_

View File

@@ -9,7 +9,6 @@
#include "include/cef_print_handler.h"
#include "libcef/browser/browser_host_base.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/task/sequenced_task_runner_helpers.h"

View File

@@ -5,7 +5,6 @@
#ifndef CEF_LIBCEF_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
#define CEF_LIBCEF_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/browser/speech_recognition_manager_delegate.h"

View File

@@ -11,7 +11,6 @@
#include "include/views/cef_overlay_controller.h"
#include "include/views/cef_view.h"
#include "base/compiler_specific.h"
#include "ui/views/view_observer.h"
#include "ui/views/widget/widget_delegate.h"

View File

@@ -59,8 +59,8 @@ class UserData : public base::SupportsUserData::Data {
// gain a ref-counted reference to the CefView and the CefView will keep an
// unowned reference to the views::View. Destruction of the views::View will
// release the ref-counted reference to the CefView.
static std::unique_ptr<views::View> PassOwnership(CefRefPtr<CefView> cef_view)
WARN_UNUSED_RESULT {
[[nodiscard]] static std::unique_ptr<views::View> PassOwnership(
CefRefPtr<CefView> cef_view) {
DCHECK(cef_view->IsValid());
DCHECK(!cef_view->IsAttached());

View File

@@ -61,8 +61,8 @@ views::View* GetFor(CefRefPtr<CefView> view);
// views::View will keep a ref-counted reference to |view|, and |view| will keep
// an un-owned reference to the views::View. These references will reset when
// the views::View object is deleted or when ResumeOwnership() is called.
std::unique_ptr<views::View> PassOwnership(CefRefPtr<CefView> view)
WARN_UNUSED_RESULT;
[[nodiscard]] std::unique_ptr<views::View> PassOwnership(
CefRefPtr<CefView> view);
// Causes |view| to resume ownership of the views::View object. Should be called
// after removing the views::View object from its previous parent.

View File

@@ -671,6 +671,5 @@ void CefWindowImpl::CreateWidget() {
// The Widget and root View are owned by the native window. Therefore don't
// keep an owned reference.
std::unique_ptr<views::View> view_ptr = view_util::PassOwnership(this);
views::View* view = view_ptr.release();
ALLOW_UNUSED_LOCAL(view);
[[maybe_unused]] views::View* view = view_ptr.release();
}

View File

@@ -7,7 +7,6 @@
#define CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_
#pragma once
#include "base/compiler_specific.h"
#include "content/public/common/content_client.h"
#include "content/public/common/pepper_plugin_info.h"

View File

@@ -15,7 +15,6 @@
#include "libcef/common/resource_bundle_delegate.h"
#include "libcef/common/task_runner_manager.h"
#include "base/compiler_specific.h"
#include "content/public/app/content_main_delegate.h"
namespace base {

View File

@@ -124,10 +124,4 @@ const char kFrameworkDirPath[] = "framework-dir-path";
const char kMainBundlePath[] = "main-bundle-path";
#endif
#if !BUILDFLAG(IS_WIN)
// Renderer process that runs the non-PPAPI PDF plugin.
// This is defined in content/public/common/content_switches.h for Windows.
const char kPdfRenderer[] = "pdf-renderer";
#endif
} // namespace switches

View File

@@ -57,10 +57,6 @@ extern const char kFrameworkDirPath[];
extern const char kMainBundlePath[];
#endif
#if !BUILDFLAG(IS_WIN)
extern const char kPdfRenderer[];
#endif
} // namespace switches
#endif // CEF_LIBCEF_COMMON_CEF_SWITCHES_H_

View File

@@ -8,9 +8,6 @@
#include <string>
#include <vector>
// Include this first to avoid compiler errors.
#include "base/compiler_specific.h"
#include "include/cef_version.h"
#include "base/strings/string_piece_forward.h"

View File

@@ -6,7 +6,6 @@
#ifndef CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_
#define CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_
#include "base/compiler_specific.h"
#include "chrome/common/extensions/permissions/chrome_permission_message_provider.h"
#include "extensions/common/extensions_client.h"
#include "url/gurl.h"

View File

@@ -34,7 +34,7 @@ class CefProcessMessageImpl : public CefProcessMessage {
// a copy if the argument list is already owned by something else.
// TODO: Pass by reference instead of ownership if/when Mojo adds support
// for that.
base::ListValue TakeArgumentList() WARN_UNUSED_RESULT;
[[nodiscard]] base::ListValue TakeArgumentList();
// CefProcessMessage methods.
bool IsValid() override;

View File

@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/time/time.h"
bool CefCurrentlyOn(CefThreadId threadId) {
scoped_refptr<base::SequencedTaskRunner> task_runner =

View File

@@ -321,7 +321,7 @@ class CefValueBase : public CefType, public CefValueController::Object {
// Detaches the underlying value and returns a pointer to it. If this is an
// owner and a |new_controller| value is specified any existing references
// will be passed to the new controller.
ValueType* Detach(CefValueController* new_controller) WARN_UNUSED_RESULT {
[[nodiscard]] ValueType* Detach(CefValueController* new_controller) {
CEF_VALUE_VERIFY_RETURN(false, nullptr);
if (new_controller && !reference()) {

View File

@@ -1109,7 +1109,7 @@ CefRefPtr<CefListValue> CefListValueImpl::Copy() {
bool CefListValueImpl::SetSize(size_t size) {
CEF_VALUE_VERIFY_RETURN(true, false);
size_t current_size = const_value().GetList().size();
size_t current_size = const_value().GetListDeprecated().size();
if (size < current_size) {
// Clean up any values above the requested size.
for (size_t i = current_size - 1; i >= size; --i)
@@ -1118,7 +1118,7 @@ bool CefListValueImpl::SetSize(size_t size) {
// Expand the list size.
// TODO: This approach seems inefficient. See https://crbug.com/1187066#c17
// for background.
auto list = mutable_value()->GetList();
auto list = mutable_value()->GetListDeprecated();
while (list.size() < size)
mutable_value()->Append(base::Value());
}
@@ -1127,7 +1127,7 @@ bool CefListValueImpl::SetSize(size_t size) {
size_t CefListValueImpl::GetSize() {
CEF_VALUE_VERIFY_RETURN(false, 0);
return const_value().GetList().size();
return const_value().GetListDeprecated().size();
}
bool CefListValueImpl::Clear() {
@@ -1148,9 +1148,10 @@ bool CefListValueImpl::Remove(size_t index) {
CefValueType CefListValueImpl::GetType(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID);
const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value)) {
switch (out_value->type()) {
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
switch (value.type()) {
case base::Value::Type::NONE:
return VTYPE_NULL;
case base::Value::Type::BOOLEAN:
@@ -1176,10 +1177,11 @@ CefValueType CefListValueImpl::GetType(size_t index) {
CefRefPtr<CefValue> CefListValueImpl::GetValue(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value)) {
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
return CefValueImpl::GetOrCreateRefOrCopy(
const_cast<base::Value*>(out_value),
const_cast<base::Value*>(&value),
const_cast<base::ListValue*>(&const_value()), read_only(),
controller());
}
@@ -1190,11 +1192,13 @@ CefRefPtr<CefValue> CefListValueImpl::GetValue(size_t index) {
bool CefListValueImpl::GetBool(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, false);
const base::Value* out_value = nullptr;
bool ret_value = false;
if (const_value().Get(index, &out_value) && out_value->is_bool()) {
ret_value = out_value->GetBool();
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
if (value.is_bool()) {
ret_value = value.GetBool();
}
}
return ret_value;
@@ -1203,11 +1207,13 @@ bool CefListValueImpl::GetBool(size_t index) {
int CefListValueImpl::GetInt(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = nullptr;
int ret_value = 0;
if (const_value().Get(index, &out_value) && out_value->is_int()) {
ret_value = out_value->GetInt();
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
if (value.is_int()) {
ret_value = value.GetInt();
}
}
return ret_value;
@@ -1216,11 +1222,13 @@ int CefListValueImpl::GetInt(size_t index) {
double CefListValueImpl::GetDouble(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, 0);
const base::Value* out_value = nullptr;
double ret_value = 0;
if (const_value().Get(index, &out_value) && out_value->is_double()) {
ret_value = out_value->GetDouble();
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
if (value.is_double()) {
ret_value = value.GetDouble();
}
}
return ret_value;
@@ -1229,11 +1237,13 @@ double CefListValueImpl::GetDouble(size_t index) {
CefString CefListValueImpl::GetString(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, CefString());
const base::Value* out_value = nullptr;
std::string ret_value;
if (const_value().Get(index, &out_value) && out_value->is_string()) {
ret_value = out_value->GetString();
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
if (value.is_string()) {
ret_value = value.GetString();
}
}
return ret_value;
@@ -1242,13 +1252,15 @@ CefString CefListValueImpl::GetString(size_t index) {
CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value) && out_value->is_blob()) {
base::Value* binary_value = const_cast<base::Value*>(out_value);
return CefBinaryValueImpl::GetOrCreateRef(
binary_value, const_cast<base::ListValue*>(&const_value()),
controller());
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
if (value.is_blob()) {
base::Value* binary_value = const_cast<base::Value*>(&value);
return CefBinaryValueImpl::GetOrCreateRef(
binary_value, const_cast<base::ListValue*>(&const_value()),
controller());
}
}
return nullptr;
@@ -1257,14 +1269,16 @@ CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value) && out_value->is_dict()) {
base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>(
const_cast<base::Value*>(out_value));
return CefDictionaryValueImpl::GetOrCreateRef(
dict_value, const_cast<base::ListValue*>(&const_value()), read_only(),
controller());
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
if (value.is_dict()) {
base::DictionaryValue* dict_value =
static_cast<base::DictionaryValue*>(const_cast<base::Value*>(&value));
return CefDictionaryValueImpl::GetOrCreateRef(
dict_value, const_cast<base::ListValue*>(&const_value()), read_only(),
controller());
}
}
return nullptr;
@@ -1273,14 +1287,16 @@ CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
CefRefPtr<CefListValue> CefListValueImpl::GetList(size_t index) {
CEF_VALUE_VERIFY_RETURN(false, nullptr);
const base::Value* out_value = nullptr;
if (const_value().Get(index, &out_value) && out_value->is_list()) {
base::ListValue* list_value =
static_cast<base::ListValue*>(const_cast<base::Value*>(out_value));
return CefListValueImpl::GetOrCreateRef(
list_value, const_cast<base::ListValue*>(&const_value()), read_only(),
controller());
const auto& list = const_value().GetListDeprecated();
if (index < list.size()) {
const base::Value& value = list[index];
if (value.is_list()) {
base::ListValue* list_value =
static_cast<base::ListValue*>(const_cast<base::Value*>(&value));
return CefListValueImpl::GetOrCreateRef(
list_value, const_cast<base::ListValue*>(&const_value()), read_only(),
controller());
}
}
return nullptr;
@@ -1362,29 +1378,27 @@ bool CefListValueImpl::SetList(size_t index, CefRefPtr<CefListValue> value) {
}
bool CefListValueImpl::RemoveInternal(size_t index) {
auto list = mutable_value()->GetList();
auto list = mutable_value()->GetListDeprecated();
if (index >= list.size())
return false;
// The std::move() call below which removes the Value from the list will
// return a new Value object with the moved contents of the Value that exists
// in the implementation std::vector. Consequently we use Get() to retrieve
// the actual Value pointer as it current exists first, for later comparison
// purposes.
const base::Value* actual_value = nullptr;
if (!const_value().Get(index, &actual_value) || !actual_value)
return false;
// in the implementation std::vector. Consequently we use operator[] to
// retrieve the actual Value pointer as it current exists first, for later
// comparison purposes.
const base::Value& actual_value = list[index];
// |actual_value| is no longer valid after this call.
auto out_value = std::move(list[index]);
mutable_value()->EraseListIter(list.begin() + index);
// Remove the value.
controller()->Remove(const_cast<base::Value*>(actual_value), true);
controller()->Remove(const_cast<base::Value*>(&actual_value), true);
// Only list and dictionary types may have dependencies.
if (out_value.is_list() || out_value.is_dict()) {
controller()->RemoveDependencies(const_cast<base::Value*>(actual_value));
controller()->RemoveDependencies(const_cast<base::Value*>(&actual_value));
}
return true;
@@ -1393,7 +1407,7 @@ bool CefListValueImpl::RemoveInternal(size_t index) {
base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) {
DCHECK(value);
auto list = mutable_value()->GetList();
auto list = mutable_value()->GetListDeprecated();
if (RemoveInternal(index)) {
CHECK_LE(index, list.size());
mutable_value()->Insert(list.begin() + index, std::move(*value));
@@ -1410,17 +1424,15 @@ base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) {
// base::Value now uses move semantics which means that Insert()/Set() will
// move the contents of the passed-in base::Value instead of keeping the same
// object. Consequently we use Get() to retrieve the actual base::Value
// object. Consequently we use operator[] to retrieve the actual base::Value
// pointer as it exists in the std::vector.
const base::Value* actual_value = nullptr;
const_value().Get(index, &actual_value);
DCHECK(actual_value);
const base::Value& actual_value = list[index];
// |value| will have been deleted at this point. Update the controller to
// reference |actual_value| instead.
controller()->Swap(value, const_cast<base::Value*>(actual_value));
controller()->Swap(value, const_cast<base::Value*>(&actual_value));
return const_cast<base::Value*>(actual_value);
return const_cast<base::Value*>(&actual_value);
}
CefListValueImpl::CefListValueImpl(base::ListValue* value,

View File

@@ -148,12 +148,12 @@ class CefBinaryValueImpl : public CefValueBase<CefBinaryValue, base::Value> {
CefBinaryValueImpl& operator=(const CefBinaryValueImpl&) = delete;
// Return a copy of the value.
base::Value* CopyValue() WARN_UNUSED_RESULT;
[[nodiscard]] base::Value* CopyValue();
// If this value is a reference then return a copy. Otherwise, detach and
// transfer ownership of the value.
base::Value* CopyOrDetachValue(CefValueController* new_controller)
WARN_UNUSED_RESULT;
[[nodiscard]] base::Value* CopyOrDetachValue(
CefValueController* new_controller);
bool IsSameValue(const base::Value* that);
bool IsEqualValue(const base::Value* that);
@@ -205,12 +205,12 @@ class CefDictionaryValueImpl
CefDictionaryValueImpl& operator=(const CefDictionaryValueImpl&) = delete;
// Return a copy of the value.
base::DictionaryValue* CopyValue() WARN_UNUSED_RESULT;
[[nodiscard]] base::DictionaryValue* CopyValue();
// If this value is a reference then return a copy. Otherwise, detach and
// transfer ownership of the value.
base::DictionaryValue* CopyOrDetachValue(CefValueController* new_controller)
WARN_UNUSED_RESULT;
[[nodiscard]] base::DictionaryValue* CopyOrDetachValue(
CefValueController* new_controller);
bool IsSameValue(const base::DictionaryValue* that);
bool IsEqualValue(const base::DictionaryValue* that);
@@ -285,12 +285,12 @@ class CefListValueImpl : public CefValueBase<CefListValue, base::ListValue> {
CefListValueImpl& operator=(const CefListValueImpl&) = delete;
// Return a copy of the value.
base::ListValue* CopyValue() WARN_UNUSED_RESULT;
[[nodiscard]] base::ListValue* CopyValue();
// If this value is a reference then return a copy. Otherwise, detach and
// transfer ownership of the value.
base::ListValue* CopyOrDetachValue(CefValueController* new_controller)
WARN_UNUSED_RESULT;
[[nodiscard]] base::ListValue* CopyOrDetachValue(
CefValueController* new_controller);
bool IsSameValue(const base::ListValue* that);
bool IsEqualValue(const base::ListValue* that);

View File

@@ -7,7 +7,7 @@
#include <utility>
#include "base/compiler_specific.h"
#include "build/build_config.h"
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
#if BUILDFLAG(IS_WIN)
@@ -60,7 +60,6 @@
#include "components/nacl/common/nacl_constants.h"
#include "components/pdf/common/internal_plugin_helpers.h"
#include "components/pdf/renderer/internal_plugin_renderer_helpers.h"
#include "components/pdf/renderer/pdf_find_in_page.h"
#include "components/printing/renderer/print_render_frame_helper.h"
#include "components/spellcheck/renderer/spellcheck.h"
#include "components/spellcheck/renderer/spellcheck_provider.h"
@@ -76,6 +75,7 @@
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_view_visitor.h"
#include "extensions/common/manifest_handlers/csp_info.h"
#include "extensions/common/switches.h"
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container_manager.h"
#include "extensions/renderer/renderer_extension_registry.h"
@@ -83,7 +83,6 @@
#include "media/base/media.h"
#include "mojo/public/cpp/bindings/binder_map.h"
#include "mojo/public/cpp/bindings/generic_pending_receiver.h"
#include "pdf/pdf_features.h"
#include "printing/print_settings.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "services/service_manager/public/cpp/connector.h"
@@ -308,12 +307,6 @@ void AlloyContentRendererClient::RenderFrameCreated(
base::WrapUnique(
new extensions::CefPrintRenderFrameHelperDelegate(*is_windowless)));
}
if (base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned)) {
render_frame_observer->associated_interfaces()->AddInterface(
base::BindRepeating(&pdf::PdfFindInPageFactory::BindReceiver,
render_frame->GetRoutingID()));
}
}
void AlloyContentRendererClient::WebViewCreated(blink::WebView* web_view) {
@@ -343,9 +336,8 @@ bool AlloyContentRendererClient::IsPluginHandledExternally(
// a more unified approach to avoid sending the IPC twice.
chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
ChromeContentRendererClient::GetPluginInfoHost()->GetPluginInfo(
render_frame->GetRoutingID(), original_url,
render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), mime_type,
&plugin_info);
original_url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
mime_type, &plugin_info);
// TODO(ekaramad): Not continuing here due to a disallowed status should take
// us to CreatePlugin. See if more in depths investigation of |status| is
// necessary here (see https://crbug.com/965747). For now, returning false
@@ -389,9 +381,8 @@ bool AlloyContentRendererClient::OverrideCreatePlugin(
GURL url(params.url);
chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
ChromeContentRendererClient::GetPluginInfoHost()->GetPluginInfo(
render_frame->GetRoutingID(), url,
render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), orig_mime_type,
&plugin_info);
url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
orig_mime_type, &plugin_info);
*plugin = ChromeContentRendererClient::CreatePlugin(render_frame, params,
*plugin_info);
return true;
@@ -428,9 +419,9 @@ bool AlloyContentRendererClient::IsOriginIsolatedPepperPlugin(
return true;
}
void AlloyContentRendererClient::AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) {
key_systems_provider_.AddSupportedKeySystems(key_systems);
void AlloyContentRendererClient::GetSupportedKeySystems(
media::GetSupportedKeySystemsCB cb) {
key_systems_provider_.GetSupportedKeySystems(std::move(cb));
}
bool AlloyContentRendererClient::IsKeySystemsUpdateNeeded() {
@@ -487,6 +478,39 @@ AlloyContentRendererClient::CreateURLLoaderThrottleProvider(
return std::make_unique<CefURLLoaderThrottleProviderImpl>(provider_type);
}
void AlloyContentRendererClient::AppendContentSecurityPolicy(
const blink::WebURL& url,
blink::WebVector<blink::WebContentSecurityPolicyHeader>* csp) {
if (!extensions::ExtensionsEnabled())
return;
// Don't apply default CSP to PDF renderers.
// TODO(crbug.com/1252096): Lock down the CSP once style and script are no
// longer injected inline by `pdf::PluginResponseWriter`. That class may be a
// better place to define such CSP, or we may continue doing so here.
if (pdf::IsPdfRenderer())
return;
DCHECK(csp);
GURL gurl(url);
const extensions::Extension* extension =
extensions::RendererExtensionRegistry::Get()->GetExtensionOrAppByURL(
gurl);
if (!extension)
return;
// Append a default CSP to ensure the extension can't relax the default
// applied CSP through means like Service Worker.
const std::string* default_csp =
extensions::CSPInfo::GetDefaultCSPToAppend(*extension, gurl.path());
if (!default_csp)
return;
csp->push_back({blink::WebString::FromUTF8(*default_csp),
network::mojom::ContentSecurityPolicyType::kEnforce,
network::mojom::ContentSecurityPolicySource::kHTTP});
}
void AlloyContentRendererClient::GetInterface(
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) {

View File

@@ -15,7 +15,6 @@
#include "libcef/renderer/browser_impl.h"
#include "base/compiler_specific.h"
#include "base/task/current_thread.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/common/plugin.mojom.h"
@@ -101,9 +100,7 @@ class AlloyContentRendererClient
uint64_t VisitedLinkHash(const char* canonical_url, size_t length) override;
bool IsLinkVisited(uint64_t link_hash) override;
bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override;
void AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems)
override;
void GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb) override;
bool IsKeySystemsUpdateNeeded() override;
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override;
@@ -113,6 +110,9 @@ class AlloyContentRendererClient
std::unique_ptr<blink::URLLoaderThrottleProvider>
CreateURLLoaderThrottleProvider(
blink::URLLoaderThrottleProviderType provider_type) override;
void AppendContentSecurityPolicy(
const blink::WebURL& url,
blink::WebVector<blink::WebContentSecurityPolicyHeader>* csp) override;
// service_manager::LocalInterfaceProvider implementation.
void GetInterface(const std::string& name,

View File

@@ -8,7 +8,6 @@
#include <memory>
#include "base/compiler_specific.h"
#include "chrome/common/renderer_configuration.mojom.h"
#include "components/content_settings/core/common/content_settings.h"
#include "content/public/renderer/render_thread_observer.h"

View File

@@ -74,7 +74,7 @@ bool CefDOMNodeImpl::IsEditable() {
return true;
if (node_.IsElementNode()) {
const WebElement& element = node_.ToConst<WebElement>();
const WebElement& element = node_.To<WebElement>();
if (blink_glue::IsTextControlElement(element))
return true;
@@ -99,7 +99,7 @@ bool CefDOMNodeImpl::IsFormControlElement() {
return false;
if (node_.IsElementNode()) {
const WebElement& element = node_.ToConst<WebElement>();
const WebElement& element = node_.To<WebElement>();
return element.IsFormControlElement();
}
@@ -112,11 +112,11 @@ CefString CefDOMNodeImpl::GetFormControlElementType() {
return str;
if (node_.IsElementNode()) {
const WebElement& element = node_.ToConst<WebElement>();
const WebElement& element = node_.To<WebElement>();
if (element.IsFormControlElement()) {
// Retrieve the type from the form control element.
const WebFormControlElement& formElement =
node_.ToConst<WebFormControlElement>();
node_.To<WebFormControlElement>();
const std::u16string& form_control_type =
formElement.FormControlType().Utf16();
@@ -156,22 +156,22 @@ CefString CefDOMNodeImpl::GetValue() {
return str;
if (node_.IsElementNode()) {
const WebElement& element = node_.ToConst<WebElement>();
const WebElement& element = node_.To<WebElement>();
if (element.IsFormControlElement()) {
// Retrieve the value from the form control element.
const WebFormControlElement& formElement =
node_.ToConst<WebFormControlElement>();
node_.To<WebFormControlElement>();
std::u16string value;
const std::u16string& form_control_type =
formElement.FormControlType().Utf16();
if (form_control_type == u"text") {
const WebInputElement& input_element =
formElement.ToConst<WebInputElement>();
formElement.To<WebInputElement>();
value = input_element.Value().Utf16();
} else if (form_control_type == u"select-one") {
const WebSelectElement& select_element =
formElement.ToConst<WebSelectElement>();
formElement.To<WebSelectElement>();
value = select_element.Value().Utf16();
}
@@ -271,7 +271,7 @@ CefString CefDOMNodeImpl::GetElementTagName() {
return str;
}
const WebElement& element = node_.ToConst<blink::WebElement>();
const WebElement& element = node_.To<blink::WebElement>();
const WebString& tagname = element.TagName();
if (!tagname.IsNull())
str = tagname.Utf16();
@@ -288,7 +288,7 @@ bool CefDOMNodeImpl::HasElementAttributes() {
return false;
}
const WebElement& element = node_.ToConst<blink::WebElement>();
const WebElement& element = node_.To<blink::WebElement>();
return (element.AttributeCount() > 0);
}
@@ -301,7 +301,7 @@ bool CefDOMNodeImpl::HasElementAttribute(const CefString& attrName) {
return false;
}
const WebElement& element = node_.ToConst<blink::WebElement>();
const WebElement& element = node_.To<blink::WebElement>();
return element.HasAttribute(WebString::FromUTF16(attrName.ToString16()));
}
@@ -315,7 +315,7 @@ CefString CefDOMNodeImpl::GetElementAttribute(const CefString& attrName) {
return str;
}
const WebElement& element = node_.ToConst<blink::WebElement>();
const WebElement& element = node_.To<blink::WebElement>();
const WebString& attr =
element.GetAttribute(WebString::FromUTF16(attrName.ToString16()));
if (!attr.IsNull())
@@ -333,7 +333,7 @@ void CefDOMNodeImpl::GetElementAttributes(AttributeMap& attrMap) {
return;
}
const WebElement& element = node_.ToConst<blink::WebElement>();
const WebElement& element = node_.To<blink::WebElement>();
unsigned int len = element.AttributeCount();
if (len == 0)
return;

View File

@@ -10,7 +10,6 @@
#include "base/stl_util.h"
#include "chrome/common/url_constants.h"
#include "chrome/renderer/extensions/resource_request_policy.h"
#include "components/guest_view/renderer/guest_view_container_dispatcher.h"
#include "content/public/common/content_constants.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
@@ -84,11 +83,8 @@ void CefExtensionsRendererClient::RenderThreadStarted() {
resource_request_policy_ =
std::make_unique<extensions::ResourceRequestPolicy>(
extension_dispatcher_.get());
guest_view_container_dispatcher_ =
std::make_unique<guest_view::GuestViewContainerDispatcher>();
thread->AddObserver(extension_dispatcher_.get());
thread->AddObserver(guest_view_container_dispatcher_.get());
}
void CefExtensionsRendererClient::RenderFrameCreated(

View File

@@ -31,10 +31,6 @@ class RenderFrame;
struct WebPluginInfo;
} // namespace content
namespace guest_view {
class GuestViewContainerDispatcher;
}
namespace url {
class Origin;
}
@@ -84,8 +80,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
private:
std::unique_ptr<extensions::Dispatcher> extension_dispatcher_;
std::unique_ptr<guest_view::GuestViewContainerDispatcher>
guest_view_container_dispatcher_;
std::unique_ptr<extensions::ResourceRequestPolicy> resource_request_policy_;
};

View File

@@ -4,7 +4,7 @@
#include "libcef/renderer/frame_impl.h"
#include "base/compiler_specific.h"
#include "build/build_config.h"
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
#if BUILDFLAG(IS_WIN)

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "base/compiler_specific.h"
#include "build/build_config.h"
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
#if BUILDFLAG(IS_WIN)

View File

@@ -6,7 +6,7 @@
#include <tuple>
#include "base/compiler_specific.h"
#include "build/build_config.h"
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
#if BUILDFLAG(IS_WIN)

View File

@@ -10,7 +10,7 @@
#include <string>
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "build/build_config.h"
// Enable deprecation warnings for MSVC and Clang. See http://crbug.com/585142.
#if BUILDFLAG(IS_WIN)