mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
42 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7001d56090 | ||
|
90eb8ccacc | ||
|
e7846f4305 | ||
|
7cb6de3925 | ||
|
52be333cfa | ||
|
76634e9b50 | ||
|
8856ee4a5a | ||
|
2429af4e57 | ||
|
8de6b17541 | ||
|
162fdec77b | ||
|
f2ecb89741 | ||
|
ad428f3212 | ||
|
00e6af45f8 | ||
|
89261260df | ||
|
628f8107a7 | ||
|
ce42c133d3 | ||
|
42873cd85b | ||
|
25f55fbb74 | ||
|
4f99f5d329 | ||
|
a6a4e9f051 | ||
|
0f098accaf | ||
|
c024311399 | ||
|
988e669b75 | ||
|
b98524a59d | ||
|
beb1c7ba80 | ||
|
ffdd705602 | ||
|
c8fd3de01a | ||
|
b246d8420d | ||
|
e1b0be6437 | ||
|
0e1d6c6906 | ||
|
28d24e22d6 | ||
|
6df612a597 | ||
|
91a1286d52 | ||
|
3e06fa8271 | ||
|
f5a3fd6430 | ||
|
7ea19d740d | ||
|
919ae45b0f | ||
|
285dbb1ce6 | ||
|
bb5fe57984 | ||
|
1e0c248044 | ||
|
a7e997e524 | ||
|
07f57223a8 |
8
BUILD.gn
8
BUILD.gn
@@ -212,11 +212,11 @@ if (is_mac) {
|
||||
# Read file lists from gypi files. The gypi_to_gn.py script does not support
|
||||
# variable references so all required variables must be explicitly specified in
|
||||
# the below configurations.
|
||||
gypi_paths = exec_script("//build/gypi_to_gn.py",
|
||||
gypi_paths = exec_script("//cef/tools/gypi_to_gn.py",
|
||||
[ rebase_path("cef_paths.gypi") ],
|
||||
"scope",
|
||||
[ "cef_paths.gypi" ])
|
||||
gypi_paths2 = exec_script("//build/gypi_to_gn.py",
|
||||
gypi_paths2 = exec_script("//cef/tools/gypi_to_gn.py",
|
||||
[ rebase_path("cef_paths2.gypi") ],
|
||||
"scope",
|
||||
[ "cef_paths2.gypi" ])
|
||||
@@ -679,11 +679,12 @@ static_library("libcef_static") {
|
||||
"//components/printing/browser",
|
||||
"//components/printing/common",
|
||||
"//components/printing/renderer",
|
||||
"//components/proxy_config",
|
||||
"//components/safe_browsing/db:test_database_manager",
|
||||
"//components/services/pdf_compositor:pdf_compositor_manifest",
|
||||
"//components/services/pdf_compositor/public/cpp:factory",
|
||||
"//components/services/pdf_compositor/public/interfaces",
|
||||
"//components/proxy_config",
|
||||
"//components/tracing",
|
||||
"//components/update_client",
|
||||
"//components/url_formatter",
|
||||
"//components/user_prefs",
|
||||
@@ -713,7 +714,6 @@ static_library("libcef_static") {
|
||||
"//media",
|
||||
"//media/blink",
|
||||
"//net",
|
||||
"//net/dns:mojo_client",
|
||||
"//net:net_with_v8",
|
||||
"//pdf",
|
||||
"//ppapi/buildflags",
|
||||
|
@@ -7,5 +7,5 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/71.0.3578.98',
|
||||
'chromium_checkout': 'refs/tags/72.0.3626.121',
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=2d14f5cfe748ef0f34aade25cfd1e299cb0ae793$
|
||||
// $hash=706e3ebbdb4e3b01f3f3bb18eb85c1897c8b5ade$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
|
||||
@@ -80,8 +80,12 @@ typedef struct _cef_resource_handler_t {
|
||||
// (0) or the specified number of bytes have been read. Use the |response|
|
||||
// object to set the mime type, http status code and other optional header
|
||||
// values. To redirect the request to a new URL set |redirectUrl| to the new
|
||||
// URL. If an error occured while setting up the request you can call
|
||||
// set_error() on |response| to indicate the error condition.
|
||||
// URL. |redirectUrl| can be either a relative or fully qualified URL. It is
|
||||
// also possible to set |response| to a redirect http status code and pass the
|
||||
// new URL via a Location header. Likewise with |redirectUrl| it is valid to
|
||||
// set a relative or fully qualified URL as the Location header value. If an
|
||||
// error occured while setting up the request you can call set_error() on
|
||||
// |response| to indicate the error condition.
|
||||
///
|
||||
void(CEF_CALLBACK* get_response_headers)(struct _cef_resource_handler_t* self,
|
||||
struct _cef_response_t* response,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ba9968a57c88511feec2b12338c366a400c101ed$
|
||||
// $hash=f375009823015557083997f5a1c2033739de9c22$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_
|
||||
@@ -85,14 +85,12 @@ typedef struct _cef_menu_button_t {
|
||||
// have a visible frame at all times, center alignment, additional padding and a
|
||||
// default minimum size of 70x33 DIP. If |with_frame| is false (0) the button
|
||||
// will only have a visible frame on hover/press, left alignment, less padding
|
||||
// and no default minimum size. If |with_menu_marker| is true (1) a menu marker
|
||||
// will be added to the button.
|
||||
// and no default minimum size.
|
||||
///
|
||||
CEF_EXPORT cef_menu_button_t* cef_menu_button_create(
|
||||
struct _cef_menu_button_delegate_t* delegate,
|
||||
const cef_string_t* text,
|
||||
int with_frame,
|
||||
int with_menu_marker);
|
||||
int with_frame);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -71,7 +71,11 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
|
||||
// false or the specified number of bytes have been read. Use the |response|
|
||||
// object to set the mime type, http status code and other optional header
|
||||
// values. To redirect the request to a new URL set |redirectUrl| to the new
|
||||
// URL. If an error occured while setting up the request you can call
|
||||
// URL. |redirectUrl| can be either a relative or fully qualified URL.
|
||||
// It is also possible to set |response| to a redirect http status code
|
||||
// and pass the new URL via a Location header. Likewise with |redirectUrl| it
|
||||
// is valid to set a relative or fully qualified URL as the Location header
|
||||
// value. If an error occured while setting up the request you can call
|
||||
// SetError() on |response| to indicate the error condition.
|
||||
///
|
||||
/*--cef()--*/
|
||||
|
@@ -58,15 +58,13 @@ class CefMenuButton : public CefLabelButton {
|
||||
// have a visible frame at all times, center alignment, additional padding and
|
||||
// a default minimum size of 70x33 DIP. If |with_frame| is false the button
|
||||
// will only have a visible frame on hover/press, left alignment, less padding
|
||||
// and no default minimum size. If |with_menu_marker| is true a menu marker
|
||||
// will be added to the button.
|
||||
// and no default minimum size.
|
||||
///
|
||||
/*--cef(optional_param=text)--*/
|
||||
static CefRefPtr<CefMenuButton> CreateMenuButton(
|
||||
CefRefPtr<CefMenuButtonDelegate> delegate,
|
||||
const CefString& text,
|
||||
bool with_frame,
|
||||
bool with_menu_marker);
|
||||
bool with_frame);
|
||||
|
||||
///
|
||||
// Show a menu with contents |menu_model|. |screen_point| specifies the menu
|
||||
|
@@ -105,10 +105,6 @@ void CefBrowserContext::Shutdown() {
|
||||
}
|
||||
}
|
||||
|
||||
base::FilePath CefBrowserContext::GetCachePath() const {
|
||||
return GetPath();
|
||||
}
|
||||
|
||||
content::ResourceContext* CefBrowserContext::GetResourceContext() {
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
@@ -137,7 +137,6 @@ class CefBrowserContext : public ChromeProfileStub {
|
||||
virtual void Initialize();
|
||||
|
||||
// BrowserContext methods.
|
||||
base::FilePath GetCachePath() const override;
|
||||
content::ResourceContext* GetResourceContext() override;
|
||||
net::URLRequestContextGetter* GetRequestContext() override;
|
||||
net::URLRequestContextGetter* CreateMediaRequestContext() override;
|
||||
|
@@ -472,7 +472,6 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
|
||||
url_request_getter_ = new CefURLRequestContextGetterImpl(
|
||||
settings_, GetPrefs(), io_thread_runner, protocol_handlers,
|
||||
std::move(proxy_config_service), std::move(request_interceptors));
|
||||
resource_context()->set_url_request_context_getter(url_request_getter_.get());
|
||||
return url_request_getter_.get();
|
||||
}
|
||||
|
||||
|
@@ -233,8 +233,6 @@ CefBrowserContextProxy::GetOrCreateStoragePartitionProxy(
|
||||
scoped_refptr<CefURLRequestContextGetterProxy> url_request_getter =
|
||||
new CefURLRequestContextGetterProxy(handler_,
|
||||
parent_->request_context_getter());
|
||||
resource_context()->set_url_request_context_getter(
|
||||
url_request_getter.get());
|
||||
storage_partition_proxy_.reset(
|
||||
new CefStoragePartitionProxy(partition_impl, url_request_getter.get()));
|
||||
|
||||
|
@@ -1772,8 +1772,8 @@ void CefBrowserHostImpl::SendCommand(
|
||||
|
||||
// Execute on the UI thread because CefResponseManager is not thread safe.
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", "frame_id",
|
||||
frame_id, "needsResponse", responseHandler.get() ? 1 : 0);
|
||||
TRACE_EVENT2("cef", "CefBrowserHostImpl::SendCommand", "frame_id", frame_id,
|
||||
"needsResponse", responseHandler.get() ? 1 : 0);
|
||||
Cef_Request_Params params;
|
||||
params.name = "execute-command";
|
||||
params.frame_id = frame_id;
|
||||
@@ -1811,8 +1811,8 @@ void CefBrowserHostImpl::SendCode(
|
||||
|
||||
// Execute on the UI thread because CefResponseManager is not thread safe.
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", "frame_id",
|
||||
frame_id, "needsResponse", responseHandler.get() ? 1 : 0);
|
||||
TRACE_EVENT2("cef", "CefBrowserHostImpl::SendCommand", "frame_id", frame_id,
|
||||
"needsResponse", responseHandler.get() ? 1 : 0);
|
||||
Cef_Request_Params params;
|
||||
params.name = "execute-code";
|
||||
params.frame_id = frame_id;
|
||||
@@ -2450,15 +2450,15 @@ KeyboardEventProcessingResult CefBrowserHostImpl::PreHandleKeyboardEvent(
|
||||
return KeyboardEventProcessingResult::NOT_HANDLED;
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::HandleKeyboardEvent(
|
||||
bool CefBrowserHostImpl::HandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
// Check to see if event should be ignored.
|
||||
if (event.skip_in_browser)
|
||||
return;
|
||||
return false;
|
||||
|
||||
if (!platform_delegate_)
|
||||
return;
|
||||
return false;
|
||||
|
||||
if (client_.get()) {
|
||||
CefRefPtr<CefKeyboardHandler> handler = client_->GetKeyboardHandler();
|
||||
@@ -2469,12 +2469,12 @@ void CefBrowserHostImpl::HandleKeyboardEvent(
|
||||
|
||||
CefEventHandle event_handle = platform_delegate_->GetEventHandle(event);
|
||||
if (handler->OnKeyEvent(this, cef_event, event_handle))
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
platform_delegate_->HandleKeyboardEvent(event);
|
||||
return platform_delegate_->HandleKeyboardEvent(event);
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::PreHandleGestureEvent(
|
||||
|
@@ -425,7 +425,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
bool PreHandleGestureEvent(content::WebContents* source,
|
||||
|
@@ -16,7 +16,7 @@ namespace {
|
||||
|
||||
// MessagePump implementation that delegates to OnScheduleMessagePumpWork() for
|
||||
// scheduling.
|
||||
class MessagePumpExternal : public base::MessagePump {
|
||||
class MessagePumpExternal : public base::MessagePumpForUI {
|
||||
public:
|
||||
MessagePumpExternal(float max_time_slice,
|
||||
CefRefPtr<CefBrowserProcessHandler> handler)
|
||||
|
@@ -176,7 +176,7 @@ class CefBrowserPlatformDelegate {
|
||||
|
||||
// Forward the keyboard event to the application or frame window to allow
|
||||
// processing of shortcut keys.
|
||||
virtual void HandleKeyboardEvent(
|
||||
virtual bool HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) = 0;
|
||||
|
||||
// Invoke platform specific handling for the external protocol.
|
||||
|
@@ -243,9 +243,8 @@ const std::string& ChromeBrowserProcessStub::GetApplicationLocale() {
|
||||
return locale_;
|
||||
}
|
||||
|
||||
void ChromeBrowserProcessStub::SetApplicationLocale(
|
||||
const std::string& actual_locale) {
|
||||
locale_ = actual_locale;
|
||||
void ChromeBrowserProcessStub::SetApplicationLocale(const std::string& locale) {
|
||||
locale_ = locale;
|
||||
}
|
||||
|
||||
DownloadStatusUpdater* ChromeBrowserProcessStub::download_status_updater() {
|
||||
@@ -284,7 +283,7 @@ ChromeBrowserProcessStub::safe_browsing_detection_service() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
subresource_filter::ContentRulesetService*
|
||||
subresource_filter::RulesetService*
|
||||
ChromeBrowserProcessStub::subresource_filter_ruleset_service() {
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
@@ -361,6 +360,12 @@ resource_coordinator::TabManager* ChromeBrowserProcessStub::GetTabManager() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
resource_coordinator::ResourceCoordinatorParts*
|
||||
ChromeBrowserProcessStub::resource_coordinator_parts() {
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
prefs::InProcessPrefServiceFactory*
|
||||
ChromeBrowserProcessStub::pref_service_factory() const {
|
||||
NOTREACHED();
|
||||
|
@@ -75,7 +75,7 @@ class ChromeBrowserProcessStub : public BrowserProcess,
|
||||
printing::BackgroundPrintingManager* background_printing_manager() override;
|
||||
IntranetRedirectDetector* intranet_redirect_detector() override;
|
||||
const std::string& GetApplicationLocale() override;
|
||||
void SetApplicationLocale(const std::string& actual_locale) override;
|
||||
void SetApplicationLocale(const std::string& locale) override;
|
||||
DownloadStatusUpdater* download_status_updater() override;
|
||||
DownloadRequestLimiter* download_request_limiter() override;
|
||||
BackgroundModeManager* background_mode_manager() override;
|
||||
@@ -85,8 +85,8 @@ class ChromeBrowserProcessStub : public BrowserProcess,
|
||||
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
|
||||
safe_browsing::ClientSideDetectionService* safe_browsing_detection_service()
|
||||
override;
|
||||
subresource_filter::ContentRulesetService*
|
||||
subresource_filter_ruleset_service() override;
|
||||
subresource_filter::RulesetService* subresource_filter_ruleset_service()
|
||||
override;
|
||||
optimization_guide::OptimizationGuideService* optimization_guide_service()
|
||||
override;
|
||||
|
||||
@@ -105,6 +105,8 @@ class ChromeBrowserProcessStub : public BrowserProcess,
|
||||
shell_integration::DefaultWebClientState CachedDefaultWebClientState()
|
||||
override;
|
||||
resource_coordinator::TabManager* GetTabManager() override;
|
||||
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
|
||||
override;
|
||||
prefs::InProcessPrefServiceFactory* pref_service_factory() const override;
|
||||
|
||||
// BrowserContextIncognitoHelper implementation.
|
||||
|
@@ -73,10 +73,10 @@ PrefService* ChromeProfileStub::GetOffTheRecordPrefs() {
|
||||
base::OnceCallback<net::CookieStore*()>
|
||||
ChromeProfileStub::GetExtensionsCookieStoreGetter() {
|
||||
return base::BindOnce(
|
||||
[](content::ResourceContext* context) {
|
||||
return context->GetRequestContext()->cookie_store();
|
||||
[](scoped_refptr<net::URLRequestContextGetter> context) {
|
||||
return context->GetURLRequestContext()->cookie_store();
|
||||
},
|
||||
GetResourceContext());
|
||||
base::WrapRefCounted(GetRequestContext()));
|
||||
}
|
||||
|
||||
bool ChromeProfileStub::IsSameProfile(Profile* profile) {
|
||||
|
@@ -508,10 +508,11 @@ void CefContentBrowserClient::RenderProcessWillLaunch(
|
||||
*service_request = mojo::MakeRequest(&service);
|
||||
service_manager::mojom::PIDReceiverPtr pid_receiver;
|
||||
service_manager::Identity renderer_identity = host->GetChildIdentity();
|
||||
ChromeService::GetInstance()->connector()->StartService(
|
||||
ChromeService::GetInstance()->connector()->RegisterServiceInstance(
|
||||
service_manager::Identity(chrome::mojom::kRendererServiceName,
|
||||
renderer_identity.user_id(),
|
||||
renderer_identity.instance()),
|
||||
renderer_identity.instance_group(),
|
||||
renderer_identity.instance_id(),
|
||||
base::Token::CreateRandom()),
|
||||
std::move(service), mojo::MakeRequest(&pid_receiver));
|
||||
}
|
||||
|
||||
@@ -613,12 +614,10 @@ void CefContentBrowserClient::SiteInstanceDeleting(
|
||||
void CefContentBrowserClient::RegisterInProcessServices(
|
||||
StaticServiceMap* services,
|
||||
content::ServiceManagerConnection* connection) {
|
||||
{
|
||||
// For spell checking.
|
||||
service_manager::EmbeddedServiceInfo info;
|
||||
info.factory = ChromeService::GetInstance()->CreateChromeServiceFactory();
|
||||
services->insert(std::make_pair(chrome::mojom::kServiceName, info));
|
||||
}
|
||||
// For spell checking.
|
||||
connection->AddServiceRequestHandler(
|
||||
chrome::mojom::kServiceName,
|
||||
ChromeService::GetInstance()->CreateChromeServiceRequestHandler());
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::RegisterOutOfProcessServices(
|
||||
@@ -740,7 +739,8 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||
// Propagate the following switches to the zygote command line (along with
|
||||
// any associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
switches::kPpapiFlashPath, switches::kPpapiFlashVersion,
|
||||
switches::kPpapiFlashPath,
|
||||
switches::kPpapiFlashVersion,
|
||||
};
|
||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
||||
arraysize(kSwitchNames));
|
||||
@@ -834,6 +834,17 @@ CefContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content::GeneratedCodeCacheSettings
|
||||
CefContentBrowserClient::GetGeneratedCodeCacheSettings(
|
||||
content::BrowserContext* context) {
|
||||
// If we pass 0 for size, disk_cache will pick a default size using the
|
||||
// heuristics based on available disk size. These are implemented in
|
||||
// disk_cache::PreferredCacheSize in net/disk_cache/cache_util.cc.
|
||||
const base::FilePath& cache_path = context->GetPath();
|
||||
return content::GeneratedCodeCacheSettings(!cache_path.empty() /* enabled */,
|
||||
0 /* size */, cache_path);
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::AllowCertificateError(
|
||||
content::WebContents* web_contents,
|
||||
int cert_error,
|
||||
@@ -1103,9 +1114,11 @@ void CefContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
|
||||
bool CefContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* frame,
|
||||
int render_process_id,
|
||||
bool is_navigation,
|
||||
const url::Origin& request_initiator,
|
||||
network::mojom::URLLoaderFactoryRequest* factory_request,
|
||||
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
|
||||
bool* bypass_redirect_checks) {
|
||||
if (!extensions::ExtensionsEnabled())
|
||||
return false;
|
||||
@@ -1114,7 +1127,8 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
extensions::BrowserContextKeyedAPIFactory<extensions::WebRequestAPI>::Get(
|
||||
browser_context);
|
||||
bool use_proxy = web_request_api->MaybeProxyURLLoaderFactory(
|
||||
frame, is_navigation, factory_request);
|
||||
browser_context, frame, render_process_id, is_navigation, factory_request,
|
||||
header_client);
|
||||
if (bypass_redirect_checks)
|
||||
*bypass_redirect_checks = use_proxy;
|
||||
return use_proxy;
|
||||
@@ -1127,7 +1141,9 @@ bool CefContentBrowserClient::HandleExternalProtocol(
|
||||
content::NavigationUIData* navigation_data,
|
||||
bool is_main_frame,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture) {
|
||||
bool has_user_gesture,
|
||||
const std::string& method,
|
||||
const net::HttpRequestHeaders& headers) {
|
||||
CEF_POST_TASK(
|
||||
CEF_UIT,
|
||||
base::Bind(
|
||||
|
@@ -75,6 +75,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
content::MediaObserver* GetMediaObserver() override;
|
||||
content::SpeechRecognitionManagerDelegate*
|
||||
CreateSpeechRecognitionManagerDelegate() override;
|
||||
content::GeneratedCodeCacheSettings GetGeneratedCodeCacheSettings(
|
||||
content::BrowserContext* context) override;
|
||||
void AllowCertificateError(
|
||||
content::WebContents* web_contents,
|
||||
int cert_error,
|
||||
@@ -144,9 +146,11 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
bool WillCreateURLLoaderFactory(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* frame,
|
||||
int render_process_id,
|
||||
bool is_navigation,
|
||||
const url::Origin& request_initiator,
|
||||
network::mojom::URLLoaderFactoryRequest* factory_request,
|
||||
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
|
||||
bool* bypass_redirect_checks) override;
|
||||
|
||||
bool HandleExternalProtocol(
|
||||
@@ -156,7 +160,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
content::NavigationUIData* navigation_data,
|
||||
bool is_main_frame,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture) override;
|
||||
bool has_user_gesture,
|
||||
const std::string& method,
|
||||
const net::HttpRequestHeaders& headers) override;
|
||||
|
||||
// Perform browser process registration for the custom scheme.
|
||||
void RegisterCustomScheme(const std::string& scheme);
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "components/network_session_configurator/common/network_switches.h"
|
||||
#include "content/app/content_service_manager_main_delegate.h"
|
||||
#include "content/browser/startup_helper.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_types.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
@@ -123,7 +124,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) {
|
||||
argv.insert(argv.begin(), command_line.GetProgram().value());
|
||||
#endif
|
||||
|
||||
std::unique_ptr<char* []> argv_as_utf8(new char*[argv.size() + 1]);
|
||||
std::unique_ptr<char*[]> argv_as_utf8(new char*[argv.size() + 1]);
|
||||
std::vector<std::string> storage;
|
||||
storage.reserve(argv.size());
|
||||
for (size_t i = 0; i < argv.size(); ++i) {
|
||||
@@ -332,7 +333,7 @@ void CefSetOSModalLoop(bool osModalLoop) {
|
||||
}
|
||||
|
||||
if (CEF_CURRENTLY_ON_UIT())
|
||||
base::MessageLoop::current()->set_os_modal_loop(osModalLoop);
|
||||
base::MessageLoopCurrent::Get()->set_os_modal_loop(osModalLoop);
|
||||
else
|
||||
CEF_POST_TASK(CEF_UIT, base::Bind(CefSetOSModalLoop, osModalLoop));
|
||||
#endif // defined(OS_WIN)
|
||||
@@ -409,11 +410,38 @@ bool CefContext::Initialize(const CefMainArgs& args,
|
||||
|
||||
static_cast<ChromeBrowserProcessStub*>(g_browser_process)->Initialize();
|
||||
|
||||
// Run the process. Results in a call to CefMainDelegate::RunProcess() which
|
||||
// will create the browser runner and message loop without blocking.
|
||||
exit_code = service_manager::MainRun(*sm_main_params_);
|
||||
if (settings.multi_threaded_message_loop) {
|
||||
base::WaitableEvent uithread_startup_event(
|
||||
base::WaitableEvent::ResetPolicy::AUTOMATIC,
|
||||
base::WaitableEvent::InitialState::NOT_SIGNALED);
|
||||
|
||||
initialized_ = true;
|
||||
// This is required because creating a base::Thread as starting it will
|
||||
// check some feature flags this will cause a CHECK failure later when this
|
||||
// gets called by some call down the line of service_manager::MainRun.
|
||||
content::SetUpFieldTrialsAndFeatureList();
|
||||
|
||||
if (!main_delegate_->CreateUIThread()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
initialized_ = true;
|
||||
|
||||
// Can't use CEF_POST_TASK here yet, because the TaskRunner is not yet set.
|
||||
main_delegate_->ui_thread()->task_runner()->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(
|
||||
[](CefContext* context, base::WaitableEvent* event) {
|
||||
service_manager::MainRun(*context->sm_main_params_);
|
||||
event->Signal();
|
||||
},
|
||||
base::Unretained(this), base::Unretained(&uithread_startup_event)));
|
||||
|
||||
// We need to wait until service_manager::MainRun has finished.
|
||||
uithread_startup_event.Wait();
|
||||
} else {
|
||||
initialized_ = true;
|
||||
service_manager::MainRun(*sm_main_params_);
|
||||
}
|
||||
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
OnContextInitialized();
|
||||
|
@@ -80,9 +80,10 @@ void CefBrowserPlatformDelegateBackground::ViewText(const std::string& text) {
|
||||
native_delegate_->ViewText(text);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateBackground::HandleKeyboardEvent(
|
||||
bool CefBrowserPlatformDelegateBackground::HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
// Nothing to do here.
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateBackground::HandleExternalProtocol(
|
||||
|
@@ -31,7 +31,7 @@ class CefBrowserPlatformDelegateBackground
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void HandleExternalProtocol(const GURL& url) override;
|
||||
void TranslateKeyEvent(content::NativeWebKeyboardEvent& result,
|
||||
|
@@ -92,7 +92,7 @@ class CefGetExtensionLoadFileCallbackImpl
|
||||
static std::unique_ptr<std::string> LoadFileFromStream(
|
||||
const std::string& file,
|
||||
CefRefPtr<CefStreamReader> stream) {
|
||||
base::AssertBlockingAllowed();
|
||||
base::AssertBlockingAllowedDeprecated();
|
||||
|
||||
// Move to the end of the stream.
|
||||
stream->Seek(0, SEEK_END);
|
||||
|
@@ -359,15 +359,23 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback(
|
||||
const std::vector<base::FilePath>& file_paths) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
// Convert FilePath list to SelectedFileInfo list.
|
||||
base::FilePath base_dir;
|
||||
std::vector<blink::mojom::FileChooserFileInfoPtr> selected_files;
|
||||
for (size_t i = 0; i < file_paths.size(); ++i) {
|
||||
auto info = blink::mojom::FileChooserFileInfo::NewNativeFile(
|
||||
blink::mojom::NativeFileInfo::New(file_paths[i], base::string16()));
|
||||
selected_files.push_back(std::move(info));
|
||||
|
||||
if (!file_paths.empty()) {
|
||||
if (mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
|
||||
base_dir = file_paths[0];
|
||||
} else {
|
||||
// Convert FilePath list to SelectedFileInfo list.
|
||||
for (size_t i = 0; i < file_paths.size(); ++i) {
|
||||
auto info = blink::mojom::FileChooserFileInfo::NewNativeFile(
|
||||
blink::mojom::NativeFileInfo::New(file_paths[i], base::string16()));
|
||||
selected_files.push_back(std::move(info));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
listener->FileSelected(std::move(selected_files), mode);
|
||||
listener->FileSelected(std::move(selected_files), base_dir, mode);
|
||||
|
||||
Cleanup();
|
||||
}
|
||||
|
@@ -72,7 +72,6 @@ CefJavaScriptDialogManager::~CefJavaScriptDialogManager() {}
|
||||
|
||||
void CefJavaScriptDialogManager::Destroy() {
|
||||
if (runner_.get()) {
|
||||
DCHECK(!dialog_running_);
|
||||
runner_.reset(NULL);
|
||||
}
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "libcef/browser/native/window_x11.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "base/no_destructor.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||
#include "content/public/browser/native_web_keyboard_event.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
@@ -103,15 +104,14 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
|
||||
prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50);
|
||||
|
||||
// Set font-related attributes.
|
||||
CR_DEFINE_STATIC_LOCAL(
|
||||
const gfx::FontRenderParams, params,
|
||||
(gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL)));
|
||||
prefs->should_antialias_text = params.antialiasing;
|
||||
prefs->use_subpixel_positioning = params.subpixel_positioning;
|
||||
prefs->hinting = params.hinting;
|
||||
prefs->use_autohinter = params.autohinter;
|
||||
prefs->use_bitmaps = params.use_bitmaps;
|
||||
prefs->subpixel_rendering = params.subpixel_rendering;
|
||||
static const base::NoDestructor<gfx::FontRenderParams> params(
|
||||
gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr));
|
||||
prefs->should_antialias_text = params->antialiasing;
|
||||
prefs->use_subpixel_positioning = params->subpixel_positioning;
|
||||
prefs->hinting = params->hinting;
|
||||
prefs->use_autohinter = params->autohinter;
|
||||
prefs->use_bitmaps = params->use_bitmaps;
|
||||
prefs->subpixel_rendering = params->subpixel_rendering;
|
||||
|
||||
browser_->web_contents()->GetRenderViewHost()->SyncRendererPrefs();
|
||||
|
||||
@@ -228,9 +228,10 @@ void CefBrowserPlatformDelegateNativeLinux::ViewText(const std::string& text) {
|
||||
ALLOW_UNUSED_LOCAL(result);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeLinux::HandleKeyboardEvent(
|
||||
bool CefBrowserPlatformDelegateNativeLinux::HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
// TODO(cef): Is something required here to handle shortcut keys?
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeLinux::HandleExternalProtocol(
|
||||
|
@@ -27,7 +27,7 @@ class CefBrowserPlatformDelegateNativeLinux
|
||||
void SizeTo(int width, int height) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void HandleExternalProtocol(const GURL& url) override;
|
||||
void TranslateKeyEvent(content::NativeWebKeyboardEvent& result,
|
||||
|
@@ -22,7 +22,7 @@ class CefBrowserPlatformDelegateNativeMac
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void HandleExternalProtocol(const GURL& url) override;
|
||||
void TranslateKeyEvent(content::NativeWebKeyboardEvent& result,
|
||||
|
@@ -221,7 +221,8 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() {
|
||||
|
||||
// Parent the TabContents to the browser view.
|
||||
const NSRect bounds = [browser_view bounds];
|
||||
NSView* native_view = browser_->web_contents()->GetNativeView();
|
||||
NSView* native_view =
|
||||
browser_->web_contents()->GetNativeView().GetNativeNSView();
|
||||
[browser_view addSubview:native_view];
|
||||
[native_view setFrame:bounds];
|
||||
[native_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||
@@ -261,7 +262,8 @@ void CefBrowserPlatformDelegateNativeMac::SendFocusEvent(bool setFocus) {
|
||||
|
||||
if (setFocus) {
|
||||
// Give keyboard focus to the native view.
|
||||
NSView* view = browser_->web_contents()->GetContentNativeView();
|
||||
NSView* view =
|
||||
browser_->web_contents()->GetContentNativeView().GetNativeNSView();
|
||||
DCHECK([view canBecomeKeyView]);
|
||||
[[view window] makeFirstResponder:view];
|
||||
}
|
||||
@@ -290,11 +292,12 @@ void CefBrowserPlatformDelegateNativeMac::ViewText(const std::string& text) {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeMac::HandleKeyboardEvent(
|
||||
bool CefBrowserPlatformDelegateNativeMac::HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
// Give the top level menu equivalents a chance to handle the event.
|
||||
if ([event.os_event type] == NSKeyDown)
|
||||
[[NSApp mainMenu] performKeyEquivalent:event.os_event];
|
||||
return [[NSApp mainMenu] performKeyEquivalent:event.os_event];
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeMac::HandleExternalProtocol(
|
||||
|
@@ -207,8 +207,27 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() {
|
||||
gfx::Rect(0, 0, point.x(), point.y()));
|
||||
|
||||
window_widget_ = delegate_view->GetWidget();
|
||||
|
||||
const HWND widget_hwnd = HWNDForWidget(window_widget_);
|
||||
DCHECK(widget_hwnd);
|
||||
const DWORD widget_ex_styles = GetWindowLongPtr(widget_hwnd, GWL_EXSTYLE);
|
||||
|
||||
if (window_info_.ex_style & WS_EX_NOACTIVATE) {
|
||||
// Add the WS_EX_NOACTIVATE style on the DesktopWindowTreeHostWin HWND
|
||||
// so that HWNDMessageHandler::Show() called via Widget::Show() does not
|
||||
// activate the window.
|
||||
SetWindowLongPtr(widget_hwnd, GWL_EXSTYLE,
|
||||
widget_ex_styles | WS_EX_NOACTIVATE);
|
||||
}
|
||||
|
||||
window_widget_->Show();
|
||||
|
||||
if (window_info_.ex_style & WS_EX_NOACTIVATE) {
|
||||
// Remove the WS_EX_NOACTIVATE style so that future mouse clicks inside the
|
||||
// browser correctly activate and focus the window.
|
||||
SetWindowLongPtr(widget_hwnd, GWL_EXSTYLE, widget_ex_styles);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -339,19 +358,19 @@ void CefBrowserPlatformDelegateNativeWin::ViewText(const std::string& text) {
|
||||
CEF_POST_USER_VISIBLE_TASK(base::Bind(WriteTempFileAndView, str_ref));
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
|
||||
bool CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
// Any unhandled keyboard/character messages are sent to DefWindowProc so that
|
||||
// shortcut keys work correctly.
|
||||
if (event.os_event) {
|
||||
const MSG& msg = event.os_event->native_event();
|
||||
DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
||||
return !DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
||||
} else {
|
||||
MSG msg = {};
|
||||
|
||||
msg.hwnd = GetHostWindowHandle();
|
||||
if (!msg.hwnd)
|
||||
return;
|
||||
return false;
|
||||
|
||||
switch (event.GetType()) {
|
||||
case blink::WebInputEvent::kRawKeyDown:
|
||||
@@ -365,7 +384,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
|
||||
break;
|
||||
default:
|
||||
NOTREACHED();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
msg.wParam = event.windows_key_code;
|
||||
@@ -376,7 +395,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
|
||||
if (event.GetModifiers() & content::NativeWebKeyboardEvent::kAltKey)
|
||||
msg.lParam |= (1 << 29);
|
||||
|
||||
DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
||||
return !DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -688,7 +707,10 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
|
||||
return 0;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
if (browser)
|
||||
// Selecting "Close window" from the task bar menu may send a focus
|
||||
// notification even though the window is currently disabled (e.g. while
|
||||
// a modal JS dialog is displayed).
|
||||
if (browser && ::IsWindowEnabled(hwnd))
|
||||
browser->SetFocus(true);
|
||||
return 0;
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class CefBrowserPlatformDelegateNativeWin
|
||||
void SizeTo(int width, int height) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void HandleExternalProtocol(const GURL& url) override;
|
||||
void TranslateKeyEvent(content::NativeWebKeyboardEvent& result,
|
||||
|
@@ -39,8 +39,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog,
|
||||
reinterpret_cast<CefJavaScriptDialogRunnerWin*>(
|
||||
GetWindowLongPtr(dialog, DWLP_USER));
|
||||
if (owner) {
|
||||
owner->Cancel();
|
||||
owner->callback_.Run(false, base::string16());
|
||||
owner->CloseDialog(false, base::string16());
|
||||
|
||||
// No need for the system to call DestroyWindow() because it will be
|
||||
// called by the Cancel() method.
|
||||
@@ -74,8 +73,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog,
|
||||
break;
|
||||
}
|
||||
if (finish) {
|
||||
owner->Cancel();
|
||||
owner->callback_.Run(result, user_input);
|
||||
owner->CloseDialog(result, user_input);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -153,12 +151,9 @@ void CefJavaScriptDialogRunnerWin::Run(
|
||||
}
|
||||
|
||||
void CefJavaScriptDialogRunnerWin::Cancel() {
|
||||
HWND parent = NULL;
|
||||
|
||||
// Re-enable the parent before closing the popup to avoid focus/activation/
|
||||
// z-order issues.
|
||||
if (parent_win_ && IsWindow(parent_win_) && !IsWindowEnabled(parent_win_)) {
|
||||
parent = parent_win_;
|
||||
EnableWindow(parent_win_, TRUE);
|
||||
parent_win_ = NULL;
|
||||
}
|
||||
@@ -169,16 +164,24 @@ void CefJavaScriptDialogRunnerWin::Cancel() {
|
||||
dialog_win_ = NULL;
|
||||
}
|
||||
|
||||
// Return focus to the parent window.
|
||||
if (parent)
|
||||
SetFocus(parent);
|
||||
|
||||
if (hook_installed_) {
|
||||
UninstallMessageHook();
|
||||
hook_installed_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CefJavaScriptDialogRunnerWin::CloseDialog(
|
||||
bool success,
|
||||
const base::string16& user_input) {
|
||||
// Run the callback first so that RenderProcessHostImpl::IsBlocked is
|
||||
// cleared. Otherwise, RenderWidgetHostImpl::IsIgnoringInputEvents will
|
||||
// return true and RenderWidgetHostViewAura::OnWindowFocused will fail to
|
||||
// re-assign browser focus.
|
||||
callback_.Run(success, user_input);
|
||||
callback_.Reset();
|
||||
Cancel();
|
||||
}
|
||||
|
||||
// static
|
||||
LRESULT CALLBACK CefJavaScriptDialogRunnerWin::GetMsgProc(int code,
|
||||
WPARAM wparam,
|
||||
|
@@ -26,6 +26,8 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner {
|
||||
void Cancel() override;
|
||||
|
||||
private:
|
||||
void CloseDialog(bool success, const base::string16& user_input);
|
||||
|
||||
HWND dialog_win_;
|
||||
HWND parent_win_;
|
||||
|
||||
|
@@ -56,7 +56,8 @@ bool CefMenuRunnerMac::RunContextMenu(
|
||||
atLocation:screen_position
|
||||
inView:nil];
|
||||
} else {
|
||||
NSView* parent_view = browser->web_contents()->GetContentNativeView();
|
||||
NSView* parent_view =
|
||||
browser->web_contents()->GetContentNativeView().GetNativeNSView();
|
||||
|
||||
// Synthesize an event for the click, as there is no certainty that
|
||||
// [NSApp currentEvent] will return a valid event.
|
||||
|
@@ -30,6 +30,9 @@
|
||||
|
||||
namespace {
|
||||
|
||||
const void* kAuthCallbackHolderUserDataKey =
|
||||
static_cast<const void*>(&kAuthCallbackHolderUserDataKey);
|
||||
|
||||
class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
public:
|
||||
typedef net::CompletionOnceCallback CallbackType;
|
||||
@@ -223,18 +226,18 @@ class CefAuthCallbackImpl : public CefAuthCallback {
|
||||
IMPLEMENT_REFCOUNTING(CefAuthCallbackImpl);
|
||||
};
|
||||
|
||||
// Match the logic from ChromeNetworkDelegate and
|
||||
// RenderFrameMessageFilter::OnSetCookie.
|
||||
bool AreExperimentalCookieFeaturesEnabled() {
|
||||
static bool initialized = false;
|
||||
static bool enabled = false;
|
||||
if (!initialized) {
|
||||
enabled = base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableExperimentalWebPlatformFeatures);
|
||||
initialized = true;
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
// Invalidates CefAuthCallbackImpl::callback_ if the URLRequest is deleted
|
||||
// before the callback.
|
||||
class AuthCallbackHolder : public base::SupportsUserData::Data {
|
||||
public:
|
||||
explicit AuthCallbackHolder(CefRefPtr<CefAuthCallbackImpl> callback)
|
||||
: callback_(callback) {}
|
||||
|
||||
~AuthCallbackHolder() override { callback_->Disconnect().Reset(); }
|
||||
|
||||
private:
|
||||
CefRefPtr<CefAuthCallbackImpl> callback_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -414,6 +417,9 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
|
||||
browser.get(), frame, auth_info.is_proxy,
|
||||
auth_info.challenger.host(), auth_info.challenger.port(),
|
||||
auth_info.realm, auth_info.scheme, callbackPtr.get())) {
|
||||
request->SetUserData(
|
||||
kAuthCallbackHolderUserDataKey,
|
||||
std::make_unique<AuthCallbackHolder>(callbackPtr));
|
||||
return AUTH_REQUIRED_RESPONSE_IO_PENDING;
|
||||
} else {
|
||||
callback = callbackPtr->Disconnect();
|
||||
@@ -434,6 +440,8 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
|
||||
auth_info.is_proxy, auth_info.challenger.host(),
|
||||
auth_info.challenger.port(), auth_info.realm, auth_info.scheme,
|
||||
callbackPtr.get())) {
|
||||
request->SetUserData(kAuthCallbackHolderUserDataKey,
|
||||
std::make_unique<AuthCallbackHolder>(callbackPtr));
|
||||
return AUTH_REQUIRED_RESPONSE_IO_PENDING;
|
||||
} else {
|
||||
callback = callbackPtr->Disconnect();
|
||||
@@ -514,7 +522,3 @@ bool CefNetworkDelegate::OnCanAccessFile(
|
||||
const base::FilePath& absolute_path) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CefNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
|
||||
return ::AreExperimentalCookieFeaturesEnabled();
|
||||
}
|
||||
|
@@ -50,7 +50,6 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
|
||||
bool OnCanAccessFile(const net::URLRequest& request,
|
||||
const base::FilePath& original_path,
|
||||
const base::FilePath& absolute_path) const override;
|
||||
bool OnAreExperimentalCookieFeaturesEnabled() const override;
|
||||
|
||||
// Weak, owned by our owner (CefURLRequestContextGetterImpl).
|
||||
BooleanPrefMember* force_google_safesearch_;
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "libcef/common/response_impl.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "net/base/io_buffer.h"
|
||||
#include "net/base/load_flags.h"
|
||||
#include "net/base/mime_util.h"
|
||||
@@ -27,6 +28,21 @@ using net::URLRequestStatus;
|
||||
|
||||
namespace {
|
||||
|
||||
using HeaderMap = std::multimap<CefString, CefString>;
|
||||
|
||||
struct CaseInsensitiveComparator {
|
||||
base::StringPiece search;
|
||||
CaseInsensitiveComparator(const std::string& s) : search(s) {}
|
||||
bool operator()(const HeaderMap::value_type& p) const {
|
||||
return base::EqualsCaseInsensitiveASCII(search, p.first.ToString());
|
||||
}
|
||||
};
|
||||
|
||||
HeaderMap::const_iterator FindHeader(const HeaderMap& m,
|
||||
const std::string& name) {
|
||||
return std::find_if(m.begin(), m.end(), CaseInsensitiveComparator(name));
|
||||
}
|
||||
|
||||
bool SetHeaderIfMissing(CefRequest::HeaderMap& headerMap,
|
||||
const std::string& name,
|
||||
const std::string& value) {
|
||||
@@ -299,15 +315,18 @@ bool CefResourceRequestJob::IsRedirectResponse(
|
||||
} else if (response_.get()) {
|
||||
// Check for HTTP 302 or HTTP 303 redirect.
|
||||
int status = response_->GetStatus();
|
||||
if (status == 302 || status == 303) {
|
||||
if (net::HttpResponseHeaders::IsRedirectResponseCode(status)) {
|
||||
CefResponse::HeaderMap headerMap;
|
||||
response_->GetHeaderMap(headerMap);
|
||||
CefRequest::HeaderMap::iterator iter = headerMap.find("Location");
|
||||
CefRequest::HeaderMap::const_iterator iter =
|
||||
FindHeader(headerMap, "Location");
|
||||
if (iter != headerMap.end()) {
|
||||
GURL new_url = GURL(std::string(iter->second));
|
||||
*http_status_code = status;
|
||||
location->Swap(&new_url);
|
||||
redirect = true;
|
||||
GURL new_url = request_->url().Resolve(std::string(iter->second));
|
||||
if (new_url.is_valid()) {
|
||||
*http_status_code = status;
|
||||
*location = new_url;
|
||||
redirect = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,7 +411,7 @@ void CefResourceRequestJob::SendHeaders() {
|
||||
|
||||
if (!redirectUrl.empty()) {
|
||||
std::string redirectUrlStr = redirectUrl;
|
||||
redirect_url_ = GURL(redirectUrlStr);
|
||||
redirect_url_ = request_->url().Resolve(redirectUrlStr);
|
||||
}
|
||||
|
||||
if (remaining_bytes_ > 0)
|
||||
|
@@ -364,7 +364,12 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
||||
io_state_->storage_->set_http_auth_handler_factory(
|
||||
net::HttpAuthHandlerRegistryFactory::Create(
|
||||
io_state_->url_request_context_->host_resolver(),
|
||||
io_state_->http_auth_preferences_.get(), supported_schemes));
|
||||
io_state_->http_auth_preferences_.get(), supported_schemes
|
||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||
,
|
||||
io_state_->gsapi_library_name_
|
||||
#endif
|
||||
));
|
||||
io_state_->storage_->set_http_server_properties(
|
||||
base::WrapUnique(new net::HttpServerPropertiesImpl));
|
||||
|
||||
|
@@ -132,9 +132,9 @@ void CefBrowserPlatformDelegateOsr::ViewText(const std::string& text) {
|
||||
native_delegate_->ViewText(text);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::HandleKeyboardEvent(
|
||||
bool CefBrowserPlatformDelegateOsr::HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
native_delegate_->HandleKeyboardEvent(event);
|
||||
return native_delegate_->HandleKeyboardEvent(event);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::HandleExternalProtocol(const GURL& url) {
|
||||
|
@@ -38,7 +38,7 @@ class CefBrowserPlatformDelegateOsr
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void HandleExternalProtocol(const GURL& url) override;
|
||||
void TranslateKeyEvent(content::NativeWebKeyboardEvent& result,
|
||||
|
@@ -176,15 +176,10 @@ struct PopulateAxNodeAttributes {
|
||||
}
|
||||
} break;
|
||||
case ax::mojom::IntAttribute::kTextStyle: {
|
||||
auto text_style = static_cast<ax::mojom::TextStyle>(attr.second);
|
||||
if (text_style == ax::mojom::TextStyle::kNone)
|
||||
break;
|
||||
|
||||
static ax::mojom::TextStyle textStyleArr[] = {
|
||||
ax::mojom::TextStyle::kTextStyleBold,
|
||||
ax::mojom::TextStyle::kTextStyleItalic,
|
||||
ax::mojom::TextStyle::kTextStyleUnderline,
|
||||
ax::mojom::TextStyle::kTextStyleLineThrough};
|
||||
ax::mojom::TextStyle::kBold, ax::mojom::TextStyle::kItalic,
|
||||
ax::mojom::TextStyle::kUnderline,
|
||||
ax::mojom::TextStyle::kLineThrough};
|
||||
|
||||
CefRefPtr<CefListValue> list = CefListValue::Create();
|
||||
int index = 0;
|
||||
@@ -258,18 +253,23 @@ CefRefPtr<CefDictionaryValue> ToCefValue(const ui::AXNodeData& node) {
|
||||
value->SetString("role", ToString(node.role));
|
||||
value->SetList("state", ToCefValue(node.state));
|
||||
|
||||
if (node.offset_container_id != -1)
|
||||
value->SetInt("offset_container_id", node.offset_container_id);
|
||||
if (node.relative_bounds.offset_container_id != -1) {
|
||||
value->SetInt("offset_container_id",
|
||||
node.relative_bounds.offset_container_id);
|
||||
}
|
||||
|
||||
value->SetDictionary("location", ToCefValue(node.location));
|
||||
value->SetDictionary("location", ToCefValue(node.relative_bounds.bounds));
|
||||
|
||||
// Transform matrix is private, so we set the string that Clients can parse
|
||||
// and use if needed.
|
||||
if (node.transform && !node.transform->IsIdentity())
|
||||
value->SetString("transform", node.transform->ToString());
|
||||
if (node.relative_bounds.transform &&
|
||||
!node.relative_bounds.transform->IsIdentity()) {
|
||||
value->SetString("transform", node.relative_bounds.transform->ToString());
|
||||
}
|
||||
|
||||
if (!node.child_ids.empty())
|
||||
if (!node.child_ids.empty()) {
|
||||
value->SetList("child_ids", ToCefValue(node.child_ids));
|
||||
}
|
||||
|
||||
CefRefPtr<CefListValue> actions_strings;
|
||||
size_t actions_idx = 0;
|
||||
|
@@ -84,17 +84,13 @@ class CefCompositorFrameSinkClient
|
||||
forward_->DidReceiveCompositorFrameAck(resources);
|
||||
}
|
||||
|
||||
void DidPresentCompositorFrame(
|
||||
uint32_t presentation_token,
|
||||
const gfx::PresentationFeedback& feedback) override {
|
||||
forward_->DidPresentCompositorFrame(presentation_token, feedback);
|
||||
void OnBeginFrame(const viz::BeginFrameArgs& args,
|
||||
const base::flat_map<uint32_t, gfx::PresentationFeedback>&
|
||||
feedbacks) override {
|
||||
if (render_widget_host_view_) {
|
||||
render_widget_host_view_->OnPresentCompositorFrame(presentation_token);
|
||||
render_widget_host_view_->OnPresentCompositorFrame();
|
||||
}
|
||||
}
|
||||
|
||||
void OnBeginFrame(const viz::BeginFrameArgs& args) override {
|
||||
forward_->OnBeginFrame(args);
|
||||
forward_->OnBeginFrame(args, feedbacks);
|
||||
}
|
||||
|
||||
void OnBeginFramePausedChanged(bool paused) override {
|
||||
@@ -138,9 +134,6 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
|
||||
return *view_->GetBackgroundColor();
|
||||
}
|
||||
|
||||
void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override {
|
||||
}
|
||||
|
||||
void OnBeginFrame(base::TimeTicks frame_time) override {
|
||||
// TODO(cef): Maybe we can use this method in combination with
|
||||
// OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer.
|
||||
@@ -155,6 +148,12 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
|
||||
return view_->GetDeviceScaleFactor();
|
||||
}
|
||||
|
||||
std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() override {
|
||||
return view_->render_widget_host()->CollectSurfaceIdsForEviction();
|
||||
}
|
||||
|
||||
void InvalidateLocalSurfaceIdOnEviction() override {}
|
||||
|
||||
private:
|
||||
CefRenderWidgetHostViewOSR* const view_;
|
||||
|
||||
@@ -343,7 +342,9 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
local_surface_id_ = local_surface_id_allocator_.GenerateId();
|
||||
local_surface_id_allocator_.GenerateId();
|
||||
local_surface_id_allocation_ =
|
||||
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
|
||||
delegated_frame_host_client_.reset(new CefDelegatedFrameHostClient(this));
|
||||
|
||||
// Matching the attributes from BrowserCompositorMac.
|
||||
@@ -487,8 +488,9 @@ void CefRenderWidgetHostViewOSR::Show() {
|
||||
browser_compositor_->SetRenderWidgetHostIsHidden(false);
|
||||
#else
|
||||
delegated_frame_host_->AttachToCompositor(compositor_.get());
|
||||
delegated_frame_host_->WasShown(GetLocalSurfaceId(),
|
||||
GetRootLayer()->bounds().size(), false);
|
||||
delegated_frame_host_->WasShown(
|
||||
GetLocalSurfaceIdAllocation().local_surface_id(),
|
||||
GetRootLayer()->bounds().size(), false);
|
||||
#endif
|
||||
|
||||
// Note that |render_widget_host_| will retrieve size parameters from the
|
||||
@@ -598,8 +600,7 @@ void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink(
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame(
|
||||
uint32_t presentation_token) {
|
||||
void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame() {
|
||||
// Is Chromium rendering to a shared texture?
|
||||
void* shared_texture = nullptr;
|
||||
ui::Compositor* compositor = GetCompositor();
|
||||
@@ -619,10 +620,13 @@ void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame(
|
||||
// view size for a full redraw.
|
||||
base::AutoLock lock_scope(damage_rect_lock_);
|
||||
|
||||
// TODO: in the future we need to correlate the presentation
|
||||
// notification with the sequence number from BeginFrame
|
||||
gfx::Rect damage;
|
||||
auto const i = damage_rects_.find(presentation_token);
|
||||
auto const i = damage_rects_.begin();
|
||||
if (i != damage_rects_.end()) {
|
||||
damage = i->second;
|
||||
damage_rects_.erase(i);
|
||||
} else {
|
||||
damage = GetViewBounds();
|
||||
}
|
||||
@@ -636,7 +640,7 @@ void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame(
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::AddDamageRect(uint32_t presentation_token,
|
||||
void CefRenderWidgetHostViewOSR::AddDamageRect(uint32_t sequence,
|
||||
const gfx::Rect& rect) {
|
||||
// Associate the given damage rect with the presentation token.
|
||||
// For OnAcceleratedPaint we'll lookup the corresponding damage area based on
|
||||
@@ -649,14 +653,14 @@ void CefRenderWidgetHostViewOSR::AddDamageRect(uint32_t presentation_token,
|
||||
while (damage_rects_.size() >= kMaxDamageRects) {
|
||||
damage_rects_.erase(damage_rects_.begin());
|
||||
}
|
||||
damage_rects_[presentation_token] = rect;
|
||||
damage_rects_[sequence] = rect;
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
|
||||
const viz::LocalSurfaceId& local_surface_id,
|
||||
viz::CompositorFrame frame,
|
||||
base::Optional<viz::HitTestRegionList> hit_test_region_list) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnSwapCompositorFrame");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnSwapCompositorFrame");
|
||||
|
||||
// Update the frame rate. At this point we should have a valid connection back
|
||||
// to the Synthetic Frame Source, which is important so we can actually modify
|
||||
@@ -713,14 +717,8 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
|
||||
damage_rect.Intersect(gfx::Rect(frame_size));
|
||||
|
||||
if (shared_texture) {
|
||||
// Indicate that we want feedback every frame.
|
||||
if (!++presentation_token_)
|
||||
++presentation_token_;
|
||||
|
||||
AddDamageRect(presentation_token_, damage_rect);
|
||||
|
||||
frame.metadata.frame_token = presentation_token_;
|
||||
frame.metadata.request_presentation_feedback = true;
|
||||
AddDamageRect(frame.metadata.begin_frame_ack.sequence_number,
|
||||
damage_rect);
|
||||
}
|
||||
|
||||
// We would normally call BrowserCompositorMac::SubmitCompositorFrame on
|
||||
@@ -745,7 +743,9 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::ClearCompositorFrame() {
|
||||
GetDelegatedFrameHost()->ClearDelegatedFrame();
|
||||
// This method is only used for content rendering timeout when surface sync is
|
||||
// off.
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::ResetFallbackToFirstNavigationSurface() {
|
||||
@@ -800,7 +800,7 @@ void CefRenderWidgetHostViewOSR::InitAsGuest(
|
||||
|
||||
void CefRenderWidgetHostViewOSR::UpdateCursor(
|
||||
const content::WebCursor& cursor) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::UpdateCursor");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::UpdateCursor");
|
||||
if (!browser_impl_.get())
|
||||
return;
|
||||
|
||||
@@ -828,8 +828,18 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(
|
||||
|
||||
ui::PlatformCursor platform_cursor;
|
||||
if (web_cursor.IsCustom()) {
|
||||
ui::Cursor ui_cursor(ui::CursorType::kCustom);
|
||||
SkBitmap bitmap;
|
||||
gfx::Point hotspot;
|
||||
float scale_factor;
|
||||
web_cursor.CreateScaledBitmapAndHotspotFromCustomData(&bitmap, &hotspot,
|
||||
&scale_factor);
|
||||
ui_cursor.set_custom_bitmap(bitmap);
|
||||
ui_cursor.set_custom_hotspot(hotspot);
|
||||
ui_cursor.set_device_scale_factor(scale_factor);
|
||||
|
||||
// |web_cursor| owns the resulting |platform_cursor|.
|
||||
platform_cursor = web_cursor.GetPlatformCursor();
|
||||
platform_cursor = web_cursor.GetPlatformCursor(ui_cursor);
|
||||
} else {
|
||||
platform_cursor = GetPlatformCursor(cursor_info.type);
|
||||
}
|
||||
@@ -987,7 +997,7 @@ void CefRenderWidgetHostViewOSR::ImeSetComposition(
|
||||
const std::vector<CefCompositionUnderline>& underlines,
|
||||
const CefRange& replacement_range,
|
||||
const CefRange& selection_range) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeSetComposition");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeSetComposition");
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
@@ -1013,7 +1023,7 @@ void CefRenderWidgetHostViewOSR::ImeCommitText(
|
||||
const CefString& text,
|
||||
const CefRange& replacement_range,
|
||||
int relative_cursor_pos) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeCommitText");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeCommitText");
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
@@ -1026,7 +1036,7 @@ void CefRenderWidgetHostViewOSR::ImeCommitText(
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::ImeFinishComposingText(bool keep_selection) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeFinishComposingText");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeFinishComposingText");
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
@@ -1037,7 +1047,7 @@ void CefRenderWidgetHostViewOSR::ImeFinishComposingText(bool keep_selection) {
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeCancelComposition");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeCancelComposition");
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
@@ -1073,9 +1083,9 @@ void CefRenderWidgetHostViewOSR::SelectionChanged(const base::string16& text,
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
const viz::LocalSurfaceId& CefRenderWidgetHostViewOSR::GetLocalSurfaceId()
|
||||
const {
|
||||
return local_surface_id_;
|
||||
const viz::LocalSurfaceIdAllocation&
|
||||
CefRenderWidgetHostViewOSR::GetLocalSurfaceIdAllocation() const {
|
||||
return local_surface_id_allocation_;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1195,7 +1205,7 @@ void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties() {
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnScreenInfoChanged");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnScreenInfoChanged");
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
@@ -1228,8 +1238,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
|
||||
|
||||
void CefRenderWidgetHostViewOSR::Invalidate(
|
||||
CefBrowserHost::PaintElementType type) {
|
||||
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::Invalidate", "type",
|
||||
type);
|
||||
TRACE_EVENT1("cef", "CefRenderWidgetHostViewOSR::Invalidate", "type", type);
|
||||
if (!IsPopupWidget() && type == PET_POPUP) {
|
||||
if (popup_host_view_)
|
||||
popup_host_view_->Invalidate(type);
|
||||
@@ -1256,7 +1265,7 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
|
||||
|
||||
if (renderer_compositor_frame_sink_) {
|
||||
GetCompositor()->IssueExternalBeginFrame(begin_frame_args);
|
||||
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args);
|
||||
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args, {});
|
||||
}
|
||||
|
||||
if (!IsPopupWidget() && popup_host_view_) {
|
||||
@@ -1266,7 +1275,7 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendKeyEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
|
||||
if (render_widget_host_ && render_widget_host_->GetView()) {
|
||||
// Direct routing requires that events go directly to the View.
|
||||
render_widget_host_->ForwardKeyboardEventWithLatencyInfo(
|
||||
@@ -1280,7 +1289,7 @@ void CefRenderWidgetHostViewOSR::SendKeyEvent(
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendMouseEvent(
|
||||
const blink::WebMouseEvent& event) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseEvent");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendMouseEvent");
|
||||
if (!IsPopupWidget()) {
|
||||
if (browser_impl_.get() &&
|
||||
event.GetType() == blink::WebMouseEvent::kMouseDown) {
|
||||
@@ -1333,7 +1342,7 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
|
||||
const blink::WebMouseWheelEvent& event) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseWheelEvent");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendMouseWheelEvent");
|
||||
|
||||
blink::WebMouseWheelEvent mouse_wheel_event(event);
|
||||
|
||||
@@ -1452,7 +1461,7 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
|
||||
int bitmap_width,
|
||||
int bitmap_height,
|
||||
void* bitmap_pixels) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnPaint");
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnPaint");
|
||||
|
||||
CefRefPtr<CefRenderHandler> handler =
|
||||
browser_impl_->client()->GetRenderHandler();
|
||||
@@ -1597,17 +1606,21 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer(bool force) {
|
||||
const gfx::Size& size_in_pixels =
|
||||
gfx::ConvertSizeToPixel(current_device_scale_factor_, size);
|
||||
|
||||
local_surface_id_ = local_surface_id_allocator_.GenerateId();
|
||||
local_surface_id_allocator_.GenerateId();
|
||||
local_surface_id_allocation_ =
|
||||
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
|
||||
|
||||
if (GetCompositor()) {
|
||||
GetCompositor()->SetScaleAndSize(current_device_scale_factor_,
|
||||
size_in_pixels, local_surface_id_);
|
||||
size_in_pixels,
|
||||
local_surface_id_allocation_);
|
||||
}
|
||||
PlatformResizeCompositorWidget(size_in_pixels);
|
||||
|
||||
bool resized = true;
|
||||
GetDelegatedFrameHost()->EmbedSurface(
|
||||
local_surface_id_, size, cc::DeadlinePolicy::UseDefaultDeadline());
|
||||
local_surface_id_allocation_.local_surface_id(), size,
|
||||
cc::DeadlinePolicy::UseDefaultDeadline());
|
||||
#endif // !defined(OS_MACOSX)
|
||||
|
||||
// Note that |render_widget_host_| will retrieve resize parameters from the
|
||||
@@ -1626,7 +1639,7 @@ void CefRenderWidgetHostViewOSR::OnBeginFrameTimerTick() {
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time,
|
||||
base::TimeDelta vsync_period) {
|
||||
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::SendBeginFrame",
|
||||
TRACE_EVENT1("cef", "CefRenderWidgetHostViewOSR::SendBeginFrame",
|
||||
"frame_time_us", frame_time.ToInternalValue());
|
||||
|
||||
base::TimeTicks display_time = frame_time + vsync_period;
|
||||
@@ -1645,8 +1658,9 @@ void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time,
|
||||
DCHECK(begin_frame_args.IsValid());
|
||||
begin_frame_number_++;
|
||||
|
||||
if (renderer_compositor_frame_sink_)
|
||||
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args);
|
||||
if (renderer_compositor_frame_sink_) {
|
||||
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args, {});
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::CancelWidget() {
|
||||
|
@@ -132,7 +132,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
void SetActive(bool active) override;
|
||||
void ShowDefinitionForSelection() override;
|
||||
void SpeakSelection() override;
|
||||
bool ShouldContinueToPauseForFrame() override;
|
||||
#endif // defined(OS_MACOSX)
|
||||
|
||||
// RenderWidgetHostViewBase implementation.
|
||||
@@ -198,7 +197,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
size_t offset,
|
||||
const gfx::Range& range) override;
|
||||
|
||||
const viz::LocalSurfaceId& GetLocalSurfaceId() const override;
|
||||
const viz::LocalSurfaceIdAllocation& GetLocalSurfaceIdAllocation()
|
||||
const override;
|
||||
const viz::FrameSinkId& GetFrameSinkId() const override;
|
||||
|
||||
// ui::ExternalBeginFrameClient implementation:
|
||||
@@ -267,7 +267,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
}
|
||||
#endif
|
||||
|
||||
void OnPresentCompositorFrame(uint32_t presentation_token);
|
||||
void OnPresentCompositorFrame();
|
||||
|
||||
private:
|
||||
content::DelegatedFrameHost* GetDelegatedFrameHost() const;
|
||||
@@ -301,7 +301,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
|
||||
viz::FrameSinkId AllocateFrameSinkId(bool is_guest_view_hack);
|
||||
|
||||
void AddDamageRect(uint32_t presentation_token, const gfx::Rect& rect);
|
||||
void AddDamageRect(uint32_t sequence, const gfx::Rect& rect);
|
||||
|
||||
// Applies background color without notifying the RenderWidget about
|
||||
// opaqueness changes.
|
||||
@@ -338,7 +338,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
std::unique_ptr<content::DelegatedFrameHostClient>
|
||||
delegated_frame_host_client_;
|
||||
std::unique_ptr<ui::Layer> root_layer_;
|
||||
viz::LocalSurfaceId local_surface_id_;
|
||||
viz::LocalSurfaceIdAllocation local_surface_id_allocation_;
|
||||
viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_;
|
||||
#endif
|
||||
|
||||
@@ -394,7 +394,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
bool is_showing_;
|
||||
bool is_destroyed_;
|
||||
gfx::Rect popup_position_;
|
||||
uint32_t presentation_token_ = 0;
|
||||
base::Lock damage_rect_lock_;
|
||||
std::map<uint32_t, gfx::Rect> damage_rects_;
|
||||
|
||||
|
@@ -47,26 +47,14 @@ class MacHelper : public content::BrowserCompositorMacClient,
|
||||
|
||||
void DestroyCompositorForShutdown() override {}
|
||||
|
||||
bool SynchronizeVisualProperties(
|
||||
const base::Optional<viz::LocalSurfaceId>&
|
||||
child_allocated_local_surface_id) override {
|
||||
auto* browser_compositor = view_->browser_compositor();
|
||||
if (child_allocated_local_surface_id) {
|
||||
browser_compositor->UpdateRendererLocalSurfaceIdFromChild(
|
||||
*child_allocated_local_surface_id);
|
||||
} else {
|
||||
browser_compositor->AllocateNewRendererLocalSurfaceId();
|
||||
}
|
||||
|
||||
if (auto* host = browser_compositor->GetDelegatedFrameHost()) {
|
||||
host->EmbedSurface(browser_compositor->GetRendererLocalSurfaceId(),
|
||||
browser_compositor->GetRendererSize(),
|
||||
cc::DeadlinePolicy::UseDefaultDeadline());
|
||||
}
|
||||
|
||||
bool OnBrowserCompositorSurfaceIdChanged() override {
|
||||
return view_->render_widget_host()->SynchronizeVisualProperties();
|
||||
}
|
||||
|
||||
std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() override {
|
||||
return view_->render_widget_host()->CollectSurfaceIdsForEviction();
|
||||
}
|
||||
|
||||
// AcceleratedWidgetMacNSView methods:
|
||||
|
||||
void AcceleratedWidgetCALayerParamsUpdated() override {}
|
||||
@@ -84,10 +72,6 @@ void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SpeakSelection() {}
|
||||
|
||||
bool CefRenderWidgetHostViewOSR::ShouldContinueToPauseForFrame() {
|
||||
return browser_compositor_->ShouldContinueToPauseForFrame();
|
||||
}
|
||||
|
||||
viz::ScopedSurfaceIdAllocator
|
||||
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
|
||||
const cc::RenderFrameMetadata& metadata) {
|
||||
@@ -123,14 +107,15 @@ display::Display CefRenderWidgetHostViewOSR::GetDisplay() {
|
||||
void CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete(
|
||||
const cc::RenderFrameMetadata& metadata) {
|
||||
DCHECK_EQ(current_device_scale_factor_, metadata.device_scale_factor);
|
||||
browser_compositor_->SynchronizeVisualProperties(
|
||||
browser_compositor_->UpdateSurfaceFromChild(
|
||||
metadata.device_scale_factor, metadata.viewport_size_in_pixels,
|
||||
metadata.local_surface_id.value_or(viz::LocalSurfaceId()));
|
||||
metadata.local_surface_id_allocation.value_or(
|
||||
viz::LocalSurfaceIdAllocation()));
|
||||
}
|
||||
|
||||
const viz::LocalSurfaceId& CefRenderWidgetHostViewOSR::GetLocalSurfaceId()
|
||||
const {
|
||||
return browser_compositor_->GetRendererLocalSurfaceId();
|
||||
const viz::LocalSurfaceIdAllocation&
|
||||
CefRenderWidgetHostViewOSR::GetLocalSurfaceIdAllocation() const {
|
||||
return browser_compositor_->GetRendererLocalSurfaceIdAllocation();
|
||||
}
|
||||
|
||||
ui::Compositor* CefRenderWidgetHostViewOSR::GetCompositor() const {
|
||||
@@ -147,7 +132,7 @@ content::DelegatedFrameHost* CefRenderWidgetHostViewOSR::GetDelegatedFrameHost()
|
||||
}
|
||||
|
||||
bool CefRenderWidgetHostViewOSR::UpdateNSViewAndDisplay() {
|
||||
return browser_compositor_->UpdateNSViewAndDisplay(
|
||||
return browser_compositor_->UpdateSurfaceFromNSView(
|
||||
GetRootLayer()->bounds().size(), GetDisplay());
|
||||
}
|
||||
|
||||
|
@@ -66,11 +66,6 @@ void CefResourceContext::RemoveUserData(const void* key) {
|
||||
content::ResourceContext::RemoveUserData(key);
|
||||
}
|
||||
|
||||
net::URLRequestContext* CefResourceContext::GetRequestContext() {
|
||||
CHECK(getter_.get());
|
||||
return getter_->GetURLRequestContext();
|
||||
}
|
||||
|
||||
std::unique_ptr<net::ClientCertStore>
|
||||
CefResourceContext::CreateClientCertStore() {
|
||||
#if defined(USE_NSS_CERTS)
|
||||
@@ -96,12 +91,6 @@ void CefResourceContext::set_extensions_info_map(
|
||||
extension_info_map_ = extensions_info_map;
|
||||
}
|
||||
|
||||
void CefResourceContext::set_url_request_context_getter(
|
||||
CefURLRequestContextGetter* getter) {
|
||||
DCHECK(!getter_.get());
|
||||
getter_ = getter;
|
||||
}
|
||||
|
||||
void CefResourceContext::set_parent(CefResourceContext* parent) {
|
||||
DCHECK(!parent_);
|
||||
DCHECK(parent);
|
||||
|
@@ -37,13 +37,9 @@ class CefResourceContext : public content::ResourceContext {
|
||||
void SetUserData(const void* key, std::unique_ptr<Data> data) override;
|
||||
void RemoveUserData(const void* key) override;
|
||||
|
||||
// ResourceContext implementation.
|
||||
net::URLRequestContext* GetRequestContext() override;
|
||||
|
||||
std::unique_ptr<net::ClientCertStore> CreateClientCertStore();
|
||||
|
||||
void set_extensions_info_map(extensions::InfoMap* extensions_info_map);
|
||||
void set_url_request_context_getter(CefURLRequestContextGetter* getter);
|
||||
void set_parent(CefResourceContext* parent);
|
||||
|
||||
// Remember the plugin load decision for plugin status requests that arrive
|
||||
@@ -71,8 +67,6 @@ class CefResourceContext : public content::ResourceContext {
|
||||
CefRefPtr<CefRequestContextHandler> GetHandler() const { return handler_; }
|
||||
|
||||
private:
|
||||
scoped_refptr<CefURLRequestContextGetter> getter_;
|
||||
|
||||
// Non-NULL when this object is owned by a CefBrowserContextProxy. |parent_|
|
||||
// is guaranteed to outlive this object because CefBrowserContextProxy has a
|
||||
// refptr to the CefBrowserContextImpl that owns |parent_|.
|
||||
|
@@ -111,10 +111,6 @@ CefStoragePartitionProxy::GetPlatformNotificationContext() {
|
||||
return parent_->GetPlatformNotificationContext();
|
||||
}
|
||||
|
||||
content::WebPackageContext* CefStoragePartitionProxy::GetWebPackageContext() {
|
||||
return parent_->GetWebPackageContext();
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::ClearDataForOrigin(
|
||||
uint32_t remove_mask,
|
||||
uint32_t quota_storage_remove_mask,
|
||||
@@ -123,16 +119,14 @@ void CefStoragePartitionProxy::ClearDataForOrigin(
|
||||
storage_origin);
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::ClearData(
|
||||
uint32_t remove_mask,
|
||||
uint32_t quota_storage_remove_mask,
|
||||
const GURL& storage_origin,
|
||||
const OriginMatcherFunction& origin_matcher,
|
||||
const base::Time begin,
|
||||
const base::Time end,
|
||||
base::OnceClosure callback) {
|
||||
void CefStoragePartitionProxy::ClearData(uint32_t remove_mask,
|
||||
uint32_t quota_storage_remove_mask,
|
||||
const GURL& storage_origin,
|
||||
const base::Time begin,
|
||||
const base::Time end,
|
||||
base::OnceClosure callback) {
|
||||
parent_->ClearData(remove_mask, quota_storage_remove_mask, storage_origin,
|
||||
origin_matcher, begin, end, std::move(callback));
|
||||
begin, end, std::move(callback));
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::ClearData(
|
||||
@@ -140,12 +134,13 @@ void CefStoragePartitionProxy::ClearData(
|
||||
uint32_t quota_storage_remove_mask,
|
||||
const OriginMatcherFunction& origin_matcher,
|
||||
network::mojom::CookieDeletionFilterPtr cookie_deletion_filter,
|
||||
bool perform_cleanup,
|
||||
const base::Time begin,
|
||||
const base::Time end,
|
||||
base::OnceClosure callback) {
|
||||
parent_->ClearData(remove_mask, quota_storage_remove_mask, origin_matcher,
|
||||
std::move(cookie_deletion_filter), begin, end,
|
||||
std::move(callback));
|
||||
std::move(cookie_deletion_filter), perform_cleanup, begin,
|
||||
end, std::move(callback));
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::ClearHttpAndMediaCaches(
|
||||
@@ -157,6 +152,10 @@ void CefStoragePartitionProxy::ClearHttpAndMediaCaches(
|
||||
std::move(callback));
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::ClearCodeCaches(base::OnceClosure callback) {
|
||||
parent_->ClearCodeCaches(std::move(callback));
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::Flush() {
|
||||
parent_->Flush();
|
||||
}
|
||||
|
@@ -46,14 +46,12 @@ class CefStoragePartitionProxy : public content::StoragePartition {
|
||||
content::ZoomLevelDelegate* GetZoomLevelDelegate() override;
|
||||
content::PlatformNotificationContext* GetPlatformNotificationContext()
|
||||
override;
|
||||
content::WebPackageContext* GetWebPackageContext() override;
|
||||
void ClearDataForOrigin(uint32_t remove_mask,
|
||||
uint32_t quota_storage_remove_mask,
|
||||
const GURL& storage_origin) override;
|
||||
void ClearData(uint32_t remove_mask,
|
||||
uint32_t quota_storage_remove_mask,
|
||||
const GURL& storage_origin,
|
||||
const OriginMatcherFunction& origin_matcher,
|
||||
const base::Time begin,
|
||||
const base::Time end,
|
||||
base::OnceClosure callback) override;
|
||||
@@ -61,6 +59,7 @@ class CefStoragePartitionProxy : public content::StoragePartition {
|
||||
uint32_t quota_storage_remove_mask,
|
||||
const OriginMatcherFunction& origin_matcher,
|
||||
network::mojom::CookieDeletionFilterPtr cookie_deletion_filter,
|
||||
bool perform_cleanup,
|
||||
const base::Time begin,
|
||||
const base::Time end,
|
||||
base::OnceClosure callback) override;
|
||||
@@ -69,6 +68,7 @@ class CefStoragePartitionProxy : public content::StoragePartition {
|
||||
const base::Time end,
|
||||
const base::Callback<bool(const GURL&)>& url_matcher,
|
||||
base::OnceClosure callback) override;
|
||||
void ClearCodeCaches(base::OnceClosure callback) override;
|
||||
void Flush() override;
|
||||
void ResetURLLoaderFactories() override;
|
||||
void ClearBluetoothAllowedDevicesMapForTesting() override;
|
||||
|
@@ -73,7 +73,7 @@
|
||||
CEF_POST_BLOCKING_TASK(base::TaskPriority::BEST_EFFORT, task)
|
||||
|
||||
// Assert that blocking is allowed on the current thread.
|
||||
#define CEF_REQUIRE_BLOCKING() base::AssertBlockingAllowed()
|
||||
#define CEF_REQUIRE_BLOCKING() base::AssertBlockingAllowedDeprecated()
|
||||
|
||||
// Same as IMPLEMENT_REFCOUNTING() but using the specified Destructor.
|
||||
#define IMPLEMENT_REFCOUNTING_EX(ClassName, Destructor) \
|
||||
|
@@ -225,10 +225,10 @@ void CefBrowserPlatformDelegateViews::ViewText(const std::string& text) {
|
||||
native_delegate_->ViewText(text);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::HandleKeyboardEvent(
|
||||
bool CefBrowserPlatformDelegateViews::HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
// The BrowserView will handle accelerators.
|
||||
browser_view_->HandleKeyboardEvent(event);
|
||||
return browser_view_->HandleKeyboardEvent(event);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::HandleExternalProtocol(const GURL& url) {
|
||||
|
@@ -51,7 +51,7 @@ class CefBrowserPlatformDelegateViews
|
||||
void SendFocusEvent(bool setFocus) override;
|
||||
gfx::Point GetScreenPoint(const gfx::Point& view) const override;
|
||||
void ViewText(const std::string& text) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
void HandleExternalProtocol(const GURL& url) override;
|
||||
void TranslateKeyEvent(content::NativeWebKeyboardEvent& result,
|
||||
|
@@ -80,17 +80,17 @@ void CefBrowserViewImpl::BrowserDestroyed(CefBrowserHostImpl* browser) {
|
||||
root_view()->SetWebContents(nullptr);
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::HandleKeyboardEvent(
|
||||
bool CefBrowserViewImpl::HandleKeyboardEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
if (!root_view())
|
||||
return;
|
||||
return false;
|
||||
|
||||
views::FocusManager* focus_manager = root_view()->GetFocusManager();
|
||||
if (!focus_manager)
|
||||
return;
|
||||
return false;
|
||||
|
||||
if (HandleAccelerator(event, focus_manager))
|
||||
return;
|
||||
return true;
|
||||
|
||||
// Give the CefWindowDelegate a chance to handle the event.
|
||||
CefRefPtr<CefWindow> window =
|
||||
@@ -100,12 +100,13 @@ void CefBrowserViewImpl::HandleKeyboardEvent(
|
||||
CefKeyEvent cef_event;
|
||||
if (browser_util::GetCefKeyEvent(event, cef_event) &&
|
||||
window_impl->OnKeyEvent(cef_event)) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Proceed with default native handling.
|
||||
unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, focus_manager);
|
||||
return unhandled_keyboard_event_handler_.HandleKeyboardEvent(event,
|
||||
focus_manager);
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowser> CefBrowserViewImpl::GetBrowser() {
|
||||
|
@@ -47,7 +47,7 @@ class CefBrowserViewImpl : public CefViewImpl<CefBrowserViewView,
|
||||
|
||||
// Called to handle accelerators when the event is unhandled by the web
|
||||
// content and the browser client.
|
||||
void HandleKeyboardEvent(const content::NativeWebKeyboardEvent& event);
|
||||
bool HandleKeyboardEvent(const content::NativeWebKeyboardEvent& event);
|
||||
|
||||
// CefBrowserView methods:
|
||||
CefRefPtr<CefBrowser> GetBrowser() override;
|
||||
|
@@ -13,18 +13,15 @@
|
||||
CefRefPtr<CefMenuButton> CefMenuButton::CreateMenuButton(
|
||||
CefRefPtr<CefMenuButtonDelegate> delegate,
|
||||
const CefString& text,
|
||||
bool with_frame,
|
||||
bool with_menu_marker) {
|
||||
return CefMenuButtonImpl::Create(delegate, text, with_frame,
|
||||
with_menu_marker);
|
||||
bool with_frame) {
|
||||
return CefMenuButtonImpl::Create(delegate, text, with_frame);
|
||||
}
|
||||
|
||||
// static
|
||||
CefRefPtr<CefMenuButtonImpl> CefMenuButtonImpl::Create(
|
||||
CefRefPtr<CefMenuButtonDelegate> delegate,
|
||||
const CefString& text,
|
||||
bool with_frame,
|
||||
bool with_menu_marker) {
|
||||
bool with_frame) {
|
||||
CEF_REQUIRE_UIT_RETURN(nullptr);
|
||||
DCHECK(delegate);
|
||||
if (!delegate)
|
||||
@@ -36,7 +33,6 @@ CefRefPtr<CefMenuButtonImpl> CefMenuButtonImpl::Create(
|
||||
if (with_frame) {
|
||||
menu_button->root_view()->SetStyleDeprecated(views::Button::STYLE_BUTTON);
|
||||
}
|
||||
menu_button->root_view()->set_show_menu_marker(with_menu_marker);
|
||||
return menu_button;
|
||||
}
|
||||
|
||||
|
@@ -27,8 +27,7 @@ class CefMenuButtonImpl : public CefLabelButtonImpl<views::MenuButton,
|
||||
static CefRefPtr<CefMenuButtonImpl> Create(
|
||||
CefRefPtr<CefMenuButtonDelegate> delegate,
|
||||
const CefString& text,
|
||||
bool with_frame,
|
||||
bool with_menu_marker);
|
||||
bool with_frame);
|
||||
|
||||
// CefMenuButton methods:
|
||||
void ShowMenu(CefRefPtr<CefMenuModel> menu_model,
|
||||
|
@@ -14,10 +14,10 @@ namespace {
|
||||
class ButtonPressedLock : public CefMenuButtonPressedLock {
|
||||
public:
|
||||
explicit ButtonPressedLock(views::MenuButton* menu_button)
|
||||
: pressed_lock_(menu_button) {}
|
||||
: pressed_lock_(menu_button->menu_button_event_handler()) {}
|
||||
|
||||
private:
|
||||
views::MenuButton::PressedLock pressed_lock_;
|
||||
views::MenuButtonEventHandler::PressedLock pressed_lock_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(ButtonPressedLock);
|
||||
DISALLOW_COPY_AND_ASSIGN(ButtonPressedLock);
|
||||
|
@@ -21,7 +21,7 @@ class MenuButtonEx : public views::MenuButton,
|
||||
public views::ButtonListener,
|
||||
public views::MenuButtonListener {
|
||||
public:
|
||||
MenuButtonEx() : views::MenuButton(base::string16(), this, true) {
|
||||
MenuButtonEx() : views::MenuButton(base::string16(), this) {
|
||||
// TODO(cef): MenuButton should not use ButtonListener. See
|
||||
// http://crbug.com/585252 for details.
|
||||
Button::listener_ = this;
|
||||
|
@@ -16,6 +16,12 @@
|
||||
#include "base/win/win_util.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr const char kCategory[] = "cef.client";
|
||||
|
||||
} // namespace
|
||||
|
||||
// The contents of this file are a compilation unit that is not called by other
|
||||
// functions in the the library. Consiquently MSVS will exclude it during the
|
||||
// linker stage if we don't call a stub function.
|
||||
@@ -29,137 +35,133 @@ void base_impl_stub() {}
|
||||
#pragma optimize("", on)
|
||||
#endif
|
||||
|
||||
CEF_EXPORT void cef_trace_event_instant(const char* category,
|
||||
CEF_EXPORT void cef_trace_event_instant(const char* /* category */,
|
||||
const char* name,
|
||||
const char* arg1_name,
|
||||
uint64 arg1_val,
|
||||
const char* arg2_name,
|
||||
uint64 arg2_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_INSTANT0(category, name, TRACE_EVENT_SCOPE_THREAD);
|
||||
TRACE_EVENT_COPY_INSTANT0(kCategory, name, TRACE_EVENT_SCOPE_THREAD);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_INSTANT1(category, name, TRACE_EVENT_SCOPE_THREAD,
|
||||
TRACE_EVENT_COPY_INSTANT1(kCategory, name, TRACE_EVENT_SCOPE_THREAD,
|
||||
arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_COPY_INSTANT2(category, name, TRACE_EVENT_SCOPE_THREAD,
|
||||
TRACE_EVENT_COPY_INSTANT2(kCategory, name, TRACE_EVENT_SCOPE_THREAD,
|
||||
arg1_name, arg1_val, arg2_name, arg2_val);
|
||||
}
|
||||
} else {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_INSTANT0(category, name, TRACE_EVENT_SCOPE_THREAD);
|
||||
TRACE_EVENT_INSTANT0(kCategory, name, TRACE_EVENT_SCOPE_THREAD);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_INSTANT1(category, name, TRACE_EVENT_SCOPE_THREAD, arg1_name,
|
||||
TRACE_EVENT_INSTANT1(kCategory, name, TRACE_EVENT_SCOPE_THREAD, arg1_name,
|
||||
arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_INSTANT2(category, name, TRACE_EVENT_SCOPE_THREAD, arg1_name,
|
||||
TRACE_EVENT_INSTANT2(kCategory, name, TRACE_EVENT_SCOPE_THREAD, arg1_name,
|
||||
arg1_val, arg2_name, arg2_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_event_begin(const char* category,
|
||||
CEF_EXPORT void cef_trace_event_begin(const char* /* category */,
|
||||
const char* name,
|
||||
const char* arg1_name,
|
||||
uint64 arg1_val,
|
||||
const char* arg2_name,
|
||||
uint64 arg2_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_BEGIN0(category, name);
|
||||
TRACE_EVENT_COPY_BEGIN0(kCategory, name);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val);
|
||||
TRACE_EVENT_COPY_BEGIN1(kCategory, name, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, arg2_name,
|
||||
TRACE_EVENT_COPY_BEGIN2(kCategory, name, arg1_name, arg1_val, arg2_name,
|
||||
arg2_val);
|
||||
}
|
||||
} else {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_BEGIN0(category, name);
|
||||
TRACE_EVENT_BEGIN0(kCategory, name);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val);
|
||||
TRACE_EVENT_BEGIN1(kCategory, name, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name,
|
||||
TRACE_EVENT_BEGIN2(kCategory, name, arg1_name, arg1_val, arg2_name,
|
||||
arg2_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_event_end(const char* category,
|
||||
CEF_EXPORT void cef_trace_event_end(const char* /* category */,
|
||||
const char* name,
|
||||
const char* arg1_name,
|
||||
uint64 arg1_val,
|
||||
const char* arg2_name,
|
||||
uint64 arg2_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_END0(category, name);
|
||||
TRACE_EVENT_COPY_END0(kCategory, name);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val);
|
||||
TRACE_EVENT_COPY_END1(kCategory, name, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, arg2_name,
|
||||
TRACE_EVENT_COPY_END2(kCategory, name, arg1_name, arg1_val, arg2_name,
|
||||
arg2_val);
|
||||
}
|
||||
} else {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_END0(category, name);
|
||||
TRACE_EVENT_END0(kCategory, name);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_END1(category, name, arg1_name, arg1_val);
|
||||
TRACE_EVENT_END1(kCategory, name, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name,
|
||||
TRACE_EVENT_END2(kCategory, name, arg1_name, arg1_val, arg2_name,
|
||||
arg2_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_counter(const char* category,
|
||||
CEF_EXPORT void cef_trace_counter(const char* /* category */,
|
||||
const char* name,
|
||||
const char* value1_name,
|
||||
uint64 value1_val,
|
||||
const char* value2_name,
|
||||
uint64 value2_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (value1_name == NULL && value2_name == NULL) {
|
||||
TRACE_COPY_COUNTER1(category, name, value1_val);
|
||||
TRACE_COPY_COUNTER1(kCategory, name, value1_val);
|
||||
} else {
|
||||
TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, value2_name,
|
||||
TRACE_COPY_COUNTER2(kCategory, name, value1_name, value1_val, value2_name,
|
||||
value2_val);
|
||||
}
|
||||
} else {
|
||||
if (value1_name == NULL && value2_name == NULL) {
|
||||
TRACE_COUNTER1(category, name, value1_val);
|
||||
TRACE_COUNTER1(kCategory, name, value1_val);
|
||||
} else {
|
||||
TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name,
|
||||
TRACE_COUNTER2(kCategory, name, value1_name, value1_val, value2_name,
|
||||
value2_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_counter_id(const char* category,
|
||||
CEF_EXPORT void cef_trace_counter_id(const char* /* category */,
|
||||
const char* name,
|
||||
uint64 id,
|
||||
const char* value1_name,
|
||||
@@ -167,29 +169,28 @@ CEF_EXPORT void cef_trace_counter_id(const char* category,
|
||||
const char* value2_name,
|
||||
uint64 value2_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (value1_name == NULL && value2_name == NULL) {
|
||||
TRACE_COPY_COUNTER_ID1(category, name, id, value1_val);
|
||||
TRACE_COPY_COUNTER_ID1(kCategory, name, id, value1_val);
|
||||
} else {
|
||||
TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val,
|
||||
TRACE_COPY_COUNTER_ID2(kCategory, name, id, value1_name, value1_val,
|
||||
value2_name, value2_val);
|
||||
}
|
||||
} else {
|
||||
if (value1_name == NULL && value2_name == NULL) {
|
||||
TRACE_COUNTER_ID1(category, name, id, value1_val);
|
||||
TRACE_COUNTER_ID1(kCategory, name, id, value1_val);
|
||||
} else {
|
||||
TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val,
|
||||
TRACE_COUNTER_ID2(kCategory, name, id, value1_name, value1_val,
|
||||
value2_name, value2_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_event_async_begin(const char* category,
|
||||
CEF_EXPORT void cef_trace_event_async_begin(const char* /* category */,
|
||||
const char* name,
|
||||
uint64 id,
|
||||
const char* arg1_name,
|
||||
@@ -197,97 +198,94 @@ CEF_EXPORT void cef_trace_event_async_begin(const char* category,
|
||||
const char* arg2_name,
|
||||
uint64 arg2_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id);
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN0(kCategory, name, id);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val);
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN1(kCategory, name, id, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val,
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN2(kCategory, name, id, arg1_name, arg1_val,
|
||||
arg2_name, arg2_val);
|
||||
}
|
||||
} else {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_ASYNC_BEGIN0(category, name, id);
|
||||
TRACE_EVENT_ASYNC_BEGIN0(kCategory, name, id);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val);
|
||||
TRACE_EVENT_ASYNC_BEGIN1(kCategory, name, id, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val,
|
||||
TRACE_EVENT_ASYNC_BEGIN2(kCategory, name, id, arg1_name, arg1_val,
|
||||
arg2_name, arg2_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_event_async_step_into(const char* category,
|
||||
CEF_EXPORT void cef_trace_event_async_step_into(const char* /* category */,
|
||||
const char* name,
|
||||
uint64 id,
|
||||
uint64 step,
|
||||
const char* arg1_name,
|
||||
uint64 arg1_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (arg1_name == NULL) {
|
||||
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO,
|
||||
category, name, id,
|
||||
kCategory, name, id,
|
||||
TRACE_EVENT_FLAG_COPY, "step", step);
|
||||
} else {
|
||||
INTERNAL_TRACE_EVENT_ADD_WITH_ID(
|
||||
TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category, name, id,
|
||||
TRACE_EVENT_PHASE_ASYNC_STEP_INTO, kCategory, name, id,
|
||||
TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val);
|
||||
}
|
||||
} else {
|
||||
if (arg1_name == NULL) {
|
||||
TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step);
|
||||
TRACE_EVENT_ASYNC_STEP_INTO0(kCategory, name, id, step);
|
||||
} else {
|
||||
TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name,
|
||||
TRACE_EVENT_ASYNC_STEP_INTO1(kCategory, name, id, step, arg1_name,
|
||||
arg1_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_event_async_step_past(const char* category,
|
||||
CEF_EXPORT void cef_trace_event_async_step_past(const char* /* category */,
|
||||
const char* name,
|
||||
uint64 id,
|
||||
uint64 step,
|
||||
const char* arg1_name,
|
||||
uint64 arg1_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (arg1_name == NULL) {
|
||||
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST,
|
||||
category, name, id,
|
||||
kCategory, name, id,
|
||||
TRACE_EVENT_FLAG_COPY, "step", step);
|
||||
} else {
|
||||
INTERNAL_TRACE_EVENT_ADD_WITH_ID(
|
||||
TRACE_EVENT_PHASE_ASYNC_STEP_PAST, category, name, id,
|
||||
TRACE_EVENT_PHASE_ASYNC_STEP_PAST, kCategory, name, id,
|
||||
TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val);
|
||||
}
|
||||
} else {
|
||||
if (arg1_name == NULL) {
|
||||
TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step);
|
||||
TRACE_EVENT_ASYNC_STEP_PAST0(kCategory, name, id, step);
|
||||
} else {
|
||||
TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name,
|
||||
TRACE_EVENT_ASYNC_STEP_PAST1(kCategory, name, id, step, arg1_name,
|
||||
arg1_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CEF_EXPORT void cef_trace_event_async_end(const char* category,
|
||||
CEF_EXPORT void cef_trace_event_async_end(const char* /* category */,
|
||||
const char* name,
|
||||
uint64 id,
|
||||
const char* arg1_name,
|
||||
@@ -295,28 +293,27 @@ CEF_EXPORT void cef_trace_event_async_end(const char* category,
|
||||
const char* arg2_name,
|
||||
uint64 arg2_val,
|
||||
int copy) {
|
||||
DCHECK(category);
|
||||
DCHECK(name);
|
||||
if (!category || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (copy) {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_ASYNC_END0(category, name, id);
|
||||
TRACE_EVENT_COPY_ASYNC_END0(kCategory, name, id);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val);
|
||||
TRACE_EVENT_COPY_ASYNC_END1(kCategory, name, id, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val,
|
||||
TRACE_EVENT_COPY_ASYNC_END2(kCategory, name, id, arg1_name, arg1_val,
|
||||
arg2_name, arg2_val);
|
||||
}
|
||||
} else {
|
||||
if (arg1_name == NULL && arg2_name == NULL) {
|
||||
TRACE_EVENT_ASYNC_END0(category, name, id);
|
||||
TRACE_EVENT_ASYNC_END0(kCategory, name, id);
|
||||
} else if (arg2_name == NULL) {
|
||||
TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val);
|
||||
TRACE_EVENT_ASYNC_END1(kCategory, name, id, arg1_name, arg1_val);
|
||||
} else {
|
||||
TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, arg2_name,
|
||||
arg2_val);
|
||||
TRACE_EVENT_ASYNC_END2(kCategory, name, id, arg1_name, arg1_val,
|
||||
arg2_name, arg2_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,11 +11,6 @@
|
||||
#include "ipc/struct_constructor_macros.h"
|
||||
#include "libcef/common/cef_message_generator.h"
|
||||
|
||||
// Generate destructors.
|
||||
#include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h"
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
#include "libcef/common/cef_message_generator.h"
|
||||
|
||||
// Generate param traits write methods.
|
||||
#include "chrome/common/safe_browsing/protobuf_message_write_macros.h"
|
||||
#include "ipc/param_traits_write_macros.h"
|
||||
|
@@ -259,21 +259,24 @@ bool IsScaleFactorSupported(ui::ScaleFactor scale_factor) {
|
||||
// Used to run the UI on a separate thread.
|
||||
class CefUIThread : public base::Thread {
|
||||
public:
|
||||
CefUIThread(const content::MainFunctionParams& main_function_params)
|
||||
: base::Thread("CefUIThread"),
|
||||
main_function_params_(main_function_params) {}
|
||||
CefUIThread() : base::Thread("CefUIThread") {}
|
||||
|
||||
void Init() override {
|
||||
#if defined(OS_WIN)
|
||||
// Initializes the COM library on the current thread.
|
||||
CoInitialize(NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void InitializeBrowserRunner(
|
||||
const content::MainFunctionParams& main_function_params) {
|
||||
DCHECK(task_runner()->BelongsToCurrentThread());
|
||||
|
||||
// Use our own browser process runner.
|
||||
browser_runner_.reset(content::BrowserMainRunner::Create());
|
||||
|
||||
// Initialize browser process state. Uses the current thread's mesage loop.
|
||||
int exit_code = browser_runner_->Initialize(main_function_params_);
|
||||
// Initialize browser process state. Uses the current thread's message loop.
|
||||
int exit_code = browser_runner_->Initialize(main_function_params);
|
||||
CHECK_EQ(exit_code, -1);
|
||||
}
|
||||
|
||||
@@ -283,7 +286,8 @@ class CefUIThread : public base::Thread {
|
||||
|
||||
// Release MessagePump resources registered with the AtExitManager.
|
||||
base::MessageLoop* ml = const_cast<base::MessageLoop*>(message_loop());
|
||||
base::MessageLoopCurrent::UnbindFromCurrentThreadInternal(ml);
|
||||
base::MessageLoopCurrent::UnbindFromCurrentThreadInternal(
|
||||
ml->GetMessageLoopBase());
|
||||
ml->ReleasePump();
|
||||
|
||||
// Run exit callbacks on the UI thread to avoid sequence check failures.
|
||||
@@ -297,7 +301,6 @@ class CefUIThread : public base::Thread {
|
||||
}
|
||||
|
||||
protected:
|
||||
content::MainFunctionParams main_function_params_;
|
||||
std::unique_ptr<content::BrowserMainRunner> browser_runner_;
|
||||
};
|
||||
|
||||
@@ -314,8 +317,10 @@ CefMainDelegate::CefMainDelegate(CefRefPtr<CefApp> application)
|
||||
CefMainDelegate::~CefMainDelegate() {}
|
||||
|
||||
void CefMainDelegate::PreCreateMainMessageLoop() {
|
||||
// Create the main message loop.
|
||||
message_loop_.reset(new CefBrowserMessageLoop());
|
||||
if (!message_loop_) {
|
||||
// Create the main message loop.
|
||||
message_loop_.reset(new CefBrowserMessageLoop());
|
||||
}
|
||||
}
|
||||
|
||||
bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||
@@ -600,17 +605,10 @@ int CefMainDelegate::RunProcess(
|
||||
if (exit_code >= 0)
|
||||
return exit_code;
|
||||
} else {
|
||||
// Run the UI on a separate thread.
|
||||
std::unique_ptr<base::Thread> thread;
|
||||
thread.reset(new CefUIThread(main_function_params));
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
if (!thread->StartWithOptions(options)) {
|
||||
NOTREACHED() << "failed to start UI thread";
|
||||
return 1;
|
||||
}
|
||||
thread->WaitUntilThreadStarted();
|
||||
ui_thread_.swap(thread);
|
||||
// Running on the separate UI thread.
|
||||
DCHECK(ui_thread_);
|
||||
static_cast<CefUIThread*>(ui_thread_.get())
|
||||
->InitializeBrowserRunner(main_function_params);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -619,6 +617,25 @@ int CefMainDelegate::RunProcess(
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool CefMainDelegate::CreateUIThread() {
|
||||
DCHECK(!ui_thread_);
|
||||
DCHECK(!message_loop_);
|
||||
|
||||
std::unique_ptr<base::Thread> thread;
|
||||
thread.reset(new CefUIThread());
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
if (!thread->StartWithOptions(options)) {
|
||||
NOTREACHED() << "failed to start UI thread";
|
||||
return false;
|
||||
}
|
||||
thread->WaitUntilThreadStarted();
|
||||
ui_thread_.swap(thread);
|
||||
|
||||
message_loop_.reset(new CefBrowserMessageLoop());
|
||||
return true;
|
||||
}
|
||||
|
||||
void CefMainDelegate::ProcessExiting(const std::string& process_type) {
|
||||
ui::ResourceBundle::CleanupSharedInstance();
|
||||
}
|
||||
|
@@ -48,11 +48,14 @@ class CefMainDelegate : public content::ContentMainDelegate {
|
||||
content::ContentRendererClient* CreateContentRendererClient() override;
|
||||
content::ContentUtilityClient* CreateContentUtilityClient() override;
|
||||
|
||||
bool CreateUIThread();
|
||||
|
||||
// Shut down the browser runner.
|
||||
void ShutdownBrowser();
|
||||
|
||||
CefContentBrowserClient* browser_client() { return browser_client_.get(); }
|
||||
CefContentClient* content_client() { return &content_client_; }
|
||||
base::Thread* ui_thread() { return ui_thread_.get(); }
|
||||
|
||||
private:
|
||||
void InitializeResourceBundle();
|
||||
|
@@ -804,55 +804,57 @@ uint8_t CefRequestImpl::GetChanges() const {
|
||||
|
||||
// From content/child/web_url_loader_impl.cc
|
||||
// static
|
||||
blink::WebReferrerPolicy CefRequestImpl::NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
network::mojom::ReferrerPolicy
|
||||
CefRequestImpl::NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
cef_referrer_policy_t net_policy) {
|
||||
switch (net_policy) {
|
||||
case REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
||||
return blink::kWebReferrerPolicyNoReferrerWhenDowngrade;
|
||||
return network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade;
|
||||
case REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN:
|
||||
return blink::
|
||||
kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin;
|
||||
return network::mojom::ReferrerPolicy::
|
||||
kNoReferrerWhenDowngradeOriginWhenCrossOrigin;
|
||||
case REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN:
|
||||
return blink::kWebReferrerPolicyOriginWhenCrossOrigin;
|
||||
return network::mojom::ReferrerPolicy::kOriginWhenCrossOrigin;
|
||||
case REFERRER_POLICY_NEVER_CLEAR_REFERRER:
|
||||
return blink::kWebReferrerPolicyAlways;
|
||||
return network::mojom::ReferrerPolicy::kAlways;
|
||||
case REFERRER_POLICY_ORIGIN:
|
||||
return blink::kWebReferrerPolicyOrigin;
|
||||
return network::mojom::ReferrerPolicy::kOrigin;
|
||||
case REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN:
|
||||
return blink::kWebReferrerPolicySameOrigin;
|
||||
return network::mojom::ReferrerPolicy::kSameOrigin;
|
||||
case REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
||||
return blink::kWebReferrerPolicyStrictOrigin;
|
||||
return network::mojom::ReferrerPolicy::kStrictOrigin;
|
||||
case REFERRER_POLICY_NO_REFERRER:
|
||||
return blink::kWebReferrerPolicyNever;
|
||||
return network::mojom::ReferrerPolicy::kNever;
|
||||
case REFERRER_POLICY_LAST_VALUE:
|
||||
NOTREACHED();
|
||||
return blink::kWebReferrerPolicyDefault;
|
||||
return network::mojom::ReferrerPolicy::kDefault;
|
||||
}
|
||||
NOTREACHED();
|
||||
return blink::kWebReferrerPolicyDefault;
|
||||
return network::mojom::ReferrerPolicy::kDefault;
|
||||
}
|
||||
|
||||
// static
|
||||
cef_referrer_policy_t CefRequestImpl::BlinkReferrerPolicyToNetReferrerPolicy(
|
||||
blink::WebReferrerPolicy blink_policy) {
|
||||
network::mojom::ReferrerPolicy blink_policy) {
|
||||
switch (blink_policy) {
|
||||
case blink::kWebReferrerPolicyNoReferrerWhenDowngrade:
|
||||
case network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade:
|
||||
return REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
|
||||
case blink::kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin:
|
||||
case network::mojom::ReferrerPolicy::
|
||||
kNoReferrerWhenDowngradeOriginWhenCrossOrigin:
|
||||
return REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN;
|
||||
case blink::kWebReferrerPolicyOriginWhenCrossOrigin:
|
||||
case network::mojom::ReferrerPolicy::kOriginWhenCrossOrigin:
|
||||
return REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN;
|
||||
case blink::kWebReferrerPolicyAlways:
|
||||
case network::mojom::ReferrerPolicy::kAlways:
|
||||
return REFERRER_POLICY_NEVER_CLEAR_REFERRER;
|
||||
case blink::kWebReferrerPolicyOrigin:
|
||||
case network::mojom::ReferrerPolicy::kOrigin:
|
||||
return REFERRER_POLICY_ORIGIN;
|
||||
case blink::kWebReferrerPolicySameOrigin:
|
||||
case network::mojom::ReferrerPolicy::kSameOrigin:
|
||||
return REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN;
|
||||
case blink::kWebReferrerPolicyStrictOrigin:
|
||||
case network::mojom::ReferrerPolicy::kStrictOrigin:
|
||||
return REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
|
||||
case blink::kWebReferrerPolicyNever:
|
||||
case network::mojom::ReferrerPolicy::kNever:
|
||||
return REFERRER_POLICY_NO_REFERRER;
|
||||
case blink::kWebReferrerPolicyDefault:
|
||||
case network::mojom::ReferrerPolicy::kDefault:
|
||||
return REFERRER_POLICY_DEFAULT;
|
||||
}
|
||||
NOTREACHED();
|
||||
|
@@ -13,8 +13,8 @@
|
||||
#include "include/cef_request.h"
|
||||
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "services/network/public/mojom/referrer_policy.mojom-shared.h"
|
||||
#include "third_party/blink/public/platform/web_http_body.h"
|
||||
#include "third_party/blink/public/platform/web_referrer_policy.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace navigation_interception {
|
||||
@@ -115,10 +115,10 @@ class CefRequestImpl : public CefRequest {
|
||||
void SetTrackChanges(bool track_changes);
|
||||
uint8_t GetChanges() const;
|
||||
|
||||
static blink::WebReferrerPolicy NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
static network::mojom::ReferrerPolicy NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
cef_referrer_policy_t net_policy);
|
||||
static cef_referrer_policy_t BlinkReferrerPolicyToNetReferrerPolicy(
|
||||
blink::WebReferrerPolicy blink_policy);
|
||||
network::mojom::ReferrerPolicy blink_policy);
|
||||
|
||||
private:
|
||||
void Changed(uint8_t changes);
|
||||
|
@@ -17,7 +17,7 @@ int CefResponseManager::GetNextRequestId() {
|
||||
int CefResponseManager::RegisterHandler(CefRefPtr<Handler> handler) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
int request_id = GetNextRequestId();
|
||||
TRACE_EVENT_ASYNC_BEGIN1("libcef", "CefResponseManager::Handler", request_id,
|
||||
TRACE_EVENT_ASYNC_BEGIN1("cef", "CefResponseManager::Handler", request_id,
|
||||
"request_id", request_id);
|
||||
handlers_.insert(std::make_pair(request_id, handler));
|
||||
return request_id;
|
||||
@@ -28,14 +28,14 @@ bool CefResponseManager::RunHandler(const Cef_Response_Params& params) {
|
||||
DCHECK_GT(params.request_id, 0);
|
||||
HandlerMap::iterator it = handlers_.find(params.request_id);
|
||||
if (it != handlers_.end()) {
|
||||
TRACE_EVENT0("libcef", "CefResponseManager::RunHandler");
|
||||
TRACE_EVENT0("cef", "CefResponseManager::RunHandler");
|
||||
it->second->OnResponse(params);
|
||||
handlers_.erase(it);
|
||||
TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler",
|
||||
TRACE_EVENT_ASYNC_END1("cef", "CefResponseManager::Handler",
|
||||
params.request_id, "success", 1);
|
||||
return true;
|
||||
}
|
||||
TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler",
|
||||
TRACE_EVENT_ASYNC_END1("cef", "CefResponseManager::Handler",
|
||||
params.request_id, "success", 0);
|
||||
return false;
|
||||
}
|
||||
|
@@ -86,8 +86,11 @@ scoped_refptr<base::SingleThreadTaskRunner> CefTaskRunnerImpl::GetTaskRunner(
|
||||
|
||||
if (id >= 0 &&
|
||||
BrowserThread::IsThreadInitialized(static_cast<BrowserThread::ID>(id))) {
|
||||
// Specify USER_BLOCKING so that BrowserTaskExecutor::GetTaskRunner always
|
||||
// gives us the same TaskRunner object.
|
||||
return base::CreateSingleThreadTaskRunnerWithTraits(
|
||||
{static_cast<BrowserThread::ID>(id)});
|
||||
{static_cast<BrowserThread::ID>(id),
|
||||
base::TaskPriority::USER_BLOCKING});
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -103,7 +106,10 @@ CefTaskRunnerImpl::GetCurrentTaskRunner() {
|
||||
BrowserThread::ID current_id;
|
||||
if (BrowserThread::GetCurrentThreadIdentifier(¤t_id) &&
|
||||
BrowserThread::IsThreadInitialized(current_id)) {
|
||||
task_runner = base::CreateSingleThreadTaskRunnerWithTraits({current_id});
|
||||
// Specify USER_BLOCKING so that BrowserTaskExecutor::GetTaskRunner always
|
||||
// gives us the same TaskRunner object.
|
||||
task_runner = base::CreateSingleThreadTaskRunnerWithTraits(
|
||||
{current_id, base::TaskPriority::USER_BLOCKING});
|
||||
}
|
||||
|
||||
if (!task_runner.get()) {
|
||||
|
@@ -152,7 +152,7 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||
v8::Local<v8::Context> context,
|
||||
v8::Isolate* isolate,
|
||||
v8::TryCatch& tryCatch,
|
||||
blink::AccessControlStatus accessControlStatus) {
|
||||
blink::SanitizeScriptErrors sanitizeScriptErrors) {
|
||||
// Based on ScriptController::executeScriptAndReturnValue
|
||||
DCHECK(isolate);
|
||||
|
||||
@@ -193,7 +193,7 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||
// - nonce: empty for internal script, and
|
||||
// - parser_state: always "not parser inserted" for internal scripts.
|
||||
if (!blink::V8ScriptRunner::CompileScript(
|
||||
blink::ScriptState::From(context), ssc, accessControlStatus,
|
||||
blink::ScriptState::From(context), ssc, sanitizeScriptErrors,
|
||||
compile_options, no_cache_reason, blink::ReferrerScriptInfo())
|
||||
.ToLocal(&script)) {
|
||||
DCHECK(tryCatch.HasCaught());
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#include "include/internal/cef_types.h"
|
||||
|
||||
#include "third_party/blink/public/platform/web_common.h"
|
||||
#include "third_party/blink/renderer/platform/loader/fetch/access_control_status.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace blink {
|
||||
@@ -62,7 +62,7 @@ BLINK_EXPORT v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||
v8::Local<v8::Context> context,
|
||||
v8::Isolate* isolate,
|
||||
v8::TryCatch& tryCatch,
|
||||
blink::AccessControlStatus accessControlStatus);
|
||||
blink::SanitizeScriptErrors sanitizeScriptErrors);
|
||||
|
||||
BLINK_EXPORT bool IsScriptForbidden();
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "content/public/renderer/document_state.h"
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
#include "content/public/renderer/render_view.h"
|
||||
#include "content/renderer/navigation_state.h"
|
||||
#include "third_party/blink/public/platform/web_string.h"
|
||||
@@ -538,7 +539,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
||||
std::string response;
|
||||
bool expect_response_ack = false;
|
||||
|
||||
TRACE_EVENT2("libcef", "CefBrowserImpl::OnRequest", "request_id",
|
||||
TRACE_EVENT2("cef", "CefBrowserImpl::OnRequest", "request_id",
|
||||
params.request_id, "expect_response",
|
||||
params.expect_response ? 1 : 0);
|
||||
|
||||
@@ -625,7 +626,9 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
||||
params.arguments.GetString(0, &string);
|
||||
params.arguments.GetString(1, &url);
|
||||
|
||||
web_frame->LoadHTMLString(string, GURL(url));
|
||||
content::RenderFrame::FromWebFrame(web_frame)->LoadHTMLString(
|
||||
string, GURL(url), "UTF-8", GURL(),
|
||||
false /* replace_current_item */);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@@ -87,7 +87,7 @@
|
||||
#include "services/service_manager/public/cpp/service_context.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/scheduler/renderer_process_type.h"
|
||||
#include "third_party/blink/public/platform/scheduler/web_renderer_process_type.h"
|
||||
#include "third_party/blink/public/platform/url_conversion.h"
|
||||
#include "third_party/blink/public/platform/web_prerendering_support.h"
|
||||
#include "third_party/blink/public/platform/web_runtime_features.h"
|
||||
@@ -283,7 +283,7 @@ void CefContentRendererClient::WebKitInitialized() {
|
||||
gurl, blink::WebString::FromUTF8(entry.target_protocol),
|
||||
blink::WebString::FromUTF8(entry.target_domain),
|
||||
entry.allow_target_subdomains,
|
||||
network::mojom::CORSOriginAccessMatchPriority::kDefaultPriority);
|
||||
network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
|
||||
}
|
||||
cross_origin_whitelist_entries_.clear();
|
||||
}
|
||||
@@ -364,8 +364,8 @@ void CefContentRendererClient::RenderThreadStarted() {
|
||||
|
||||
thread->SetRendererProcessType(
|
||||
IsStandaloneExtensionProcess()
|
||||
? blink::scheduler::RendererProcessType::kExtensionRenderer
|
||||
: blink::scheduler::RendererProcessType::kRenderer);
|
||||
? blink::scheduler::WebRendererProcessType::kExtensionRenderer
|
||||
: blink::scheduler::WebRendererProcessType::kRenderer);
|
||||
|
||||
{
|
||||
startup_metric_utils::mojom::StartupMetricHostPtr startup_metric_host;
|
||||
@@ -384,7 +384,7 @@ void CefContentRendererClient::RenderThreadStarted() {
|
||||
if (content::RenderProcessHost::run_renderer_in_process()) {
|
||||
// When running in single-process mode register as a destruction observer
|
||||
// on the render thread's MessageLoop.
|
||||
base::MessageLoop::current()->AddDestructionObserver(this);
|
||||
base::MessageLoopCurrent::Get()->AddDestructionObserver(this);
|
||||
}
|
||||
|
||||
blink::WebPrerenderingSupport::Initialize(new CefPrerenderingSupport());
|
||||
@@ -602,13 +602,8 @@ void CefContentRendererClient::DevToolsAgentDetached() {
|
||||
|
||||
void CefContentRendererClient::CreateRendererService(
|
||||
service_manager::mojom::ServiceRequest service_request) {
|
||||
service_context_ = std::make_unique<service_manager::ServiceContext>(
|
||||
std::make_unique<service_manager::ForwardingService>(this),
|
||||
std::move(service_request));
|
||||
}
|
||||
|
||||
void CefContentRendererClient::OnStart() {
|
||||
context()->connector()->BindConnectorRequest(std::move(connector_request_));
|
||||
DCHECK(!service_binding_.is_bound());
|
||||
service_binding_.Bind(std::move(service_request));
|
||||
}
|
||||
|
||||
void CefContentRendererClient::OnBindInterface(
|
||||
@@ -621,9 +616,9 @@ void CefContentRendererClient::OnBindInterface(
|
||||
void CefContentRendererClient::GetInterface(
|
||||
const std::string& interface_name,
|
||||
mojo::ScopedMessagePipeHandle interface_pipe) {
|
||||
connector_->BindInterface(
|
||||
service_manager::Identity(chrome::mojom::kServiceName), interface_name,
|
||||
std::move(interface_pipe));
|
||||
service_binding_.GetConnector()->BindInterface(
|
||||
service_manager::ServiceFilter::ByName(chrome::mojom::kServiceName),
|
||||
interface_name, std::move(interface_pipe));
|
||||
}
|
||||
|
||||
void CefContentRendererClient::WillDestroyCurrentMessageLoop() {
|
||||
@@ -714,9 +709,7 @@ void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() {
|
||||
}
|
||||
|
||||
service_manager::Connector* CefContentRendererClient::GetConnector() {
|
||||
if (!connector_)
|
||||
connector_ = service_manager::Connector::Create(&connector_request_);
|
||||
return connector_.get();
|
||||
return service_binding_.GetConnector();
|
||||
}
|
||||
|
||||
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "services/service_manager/public/cpp/connector.h"
|
||||
#include "services/service_manager/public/cpp/local_interface_provider.h"
|
||||
#include "services/service_manager/public/cpp/service.h"
|
||||
#include "services/service_manager/public/cpp/service_binding.h"
|
||||
|
||||
namespace blink {
|
||||
class WebURLLoaderFactory;
|
||||
@@ -50,10 +51,11 @@ struct Cef_CrossOriginWhiteListEntry_Params;
|
||||
class ChromePDFPrintClient;
|
||||
class SpellCheck;
|
||||
|
||||
class CefContentRendererClient : public content::ContentRendererClient,
|
||||
public service_manager::Service,
|
||||
public service_manager::LocalInterfaceProvider,
|
||||
public base::MessageLoop::DestructionObserver {
|
||||
class CefContentRendererClient
|
||||
: public content::ContentRendererClient,
|
||||
public service_manager::Service,
|
||||
public service_manager::LocalInterfaceProvider,
|
||||
public base::MessageLoopCurrent::DestructionObserver {
|
||||
public:
|
||||
CefContentRendererClient();
|
||||
~CefContentRendererClient() override;
|
||||
@@ -140,7 +142,6 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
||||
service_manager::mojom::ServiceRequest service_request) override;
|
||||
|
||||
// service_manager::Service implementation.
|
||||
void OnStart() override;
|
||||
void OnBindInterface(const service_manager::BindSourceInfo& remote_info,
|
||||
const std::string& name,
|
||||
mojo::ScopedMessagePipeHandle handle) override;
|
||||
@@ -149,7 +150,7 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
||||
void GetInterface(const std::string& name,
|
||||
mojo::ScopedMessagePipeHandle request_handle) override;
|
||||
|
||||
// MessageLoop::DestructionObserver implementation.
|
||||
// MessageLoopCurrent::DestructionObserver implementation.
|
||||
void WillDestroyCurrentMessageLoop() override;
|
||||
|
||||
private:
|
||||
@@ -198,9 +199,7 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
||||
bool single_process_cleanup_complete_;
|
||||
base::Lock single_process_cleanup_lock_;
|
||||
|
||||
std::unique_ptr<service_manager::Connector> connector_;
|
||||
service_manager::mojom::ConnectorRequest connector_request_;
|
||||
std::unique_ptr<service_manager::ServiceContext> service_context_;
|
||||
service_manager::ServiceBinding service_binding_{this};
|
||||
service_manager::BinderRegistry registry_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefContentRendererClient);
|
||||
|
@@ -132,6 +132,7 @@ void CefExtensionsRendererClient::RenderThreadStarted() {
|
||||
|
||||
extension_dispatcher_.reset(new extensions::Dispatcher(
|
||||
std::make_unique<extensions::CefExtensionsDispatcherDelegate>()));
|
||||
extension_dispatcher_->OnRenderThreadStarted(thread);
|
||||
resource_request_policy_.reset(
|
||||
new extensions::ResourceRequestPolicy(extension_dispatcher_.get()));
|
||||
guest_view_container_dispatcher_.reset(
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "libcef/renderer/thread_util.h"
|
||||
#include "libcef/renderer/v8_impl.h"
|
||||
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
#include "third_party/blink/public/platform/web_data.h"
|
||||
#include "third_party/blink/public/platform/web_string.h"
|
||||
#include "third_party/blink/public/platform/web_url.h"
|
||||
@@ -35,6 +36,7 @@
|
||||
#include "third_party/blink/public/web/web_document_loader.h"
|
||||
#include "third_party/blink/public/web/web_frame_content_dumper.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/blink/public/web/web_navigation_control.h"
|
||||
#include "third_party/blink/public/web/web_script_source.h"
|
||||
#include "third_party/blink/public/web/web_view.h"
|
||||
|
||||
@@ -152,7 +154,9 @@ void CefFrameImpl::LoadString(const CefString& string, const CefString& url) {
|
||||
|
||||
if (frame_) {
|
||||
GURL gurl = GURL(url.ToString());
|
||||
frame_->LoadHTMLString(string.ToString(), gurl);
|
||||
content::RenderFrame::FromWebFrame(frame_)->LoadHTMLString(
|
||||
string.ToString(), gurl, "UTF-8", GURL(),
|
||||
false /* replace_current_item */);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -69,12 +69,12 @@ void CefRenderThreadObserver::OnModifyCrossOriginWhitelistEntry(
|
||||
gurl, blink::WebString::FromUTF8(params.target_protocol),
|
||||
blink::WebString::FromUTF8(params.target_domain),
|
||||
params.allow_target_subdomains,
|
||||
network::mojom::CORSOriginAccessMatchPriority::kDefaultPriority);
|
||||
network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
|
||||
} else {
|
||||
blink::WebSecurityPolicy::ClearOriginAccessAllowListForOrigin(gurl);
|
||||
blink::WebSecurityPolicy::ClearOriginAccessListForOrigin(gurl);
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderThreadObserver::OnClearCrossOriginWhitelist() {
|
||||
blink::WebSecurityPolicy::ClearOriginAccessAllowList();
|
||||
blink::WebSecurityPolicy::ClearOriginAccessList();
|
||||
}
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include "third_party/blink/public/platform/web_url_request.h"
|
||||
#include "third_party/blink/public/platform/web_url_response.h"
|
||||
|
||||
using blink::WebReferrerPolicy;
|
||||
using blink::WebString;
|
||||
using blink::WebURL;
|
||||
using blink::WebURLError;
|
||||
@@ -59,7 +58,7 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
|
||||
bool WillFollowRedirect(const WebURL& new_url,
|
||||
const WebURL& new_site_for_cookies,
|
||||
const WebString& new_referrer,
|
||||
WebReferrerPolicy new_referrer_policy,
|
||||
network::mojom::ReferrerPolicy new_referrer_policy,
|
||||
const WebString& new_method,
|
||||
const WebURLResponse& passed_redirect_response,
|
||||
bool& report_raw_headers) override;
|
||||
@@ -317,7 +316,7 @@ bool CefWebURLLoaderClient::WillFollowRedirect(
|
||||
const WebURL& new_url,
|
||||
const WebURL& new_site_for_cookies,
|
||||
const WebString& new_referrer,
|
||||
WebReferrerPolicy new_referrer_policy,
|
||||
network::mojom::ReferrerPolicy new_referrer_policy,
|
||||
const WebString& new_method,
|
||||
const WebURLResponse& passed_redirect_response,
|
||||
bool& report_raw_headers) {
|
||||
|
@@ -1091,7 +1091,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
|
||||
|
||||
v8::MaybeLocal<v8::Value> func_rv = blink_glue::ExecuteV8ScriptAndReturnValue(
|
||||
source, source_url, start_line, context, isolate, try_catch,
|
||||
blink::AccessControlStatus::kOpaqueResource);
|
||||
blink::SanitizeScriptErrors::kSanitize);
|
||||
|
||||
if (try_catch.HasCaught()) {
|
||||
exception = new CefV8ExceptionImpl(context, try_catch.Message());
|
||||
@@ -1330,7 +1330,12 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
|
||||
|
||||
tmpl->SetIndexedPropertyHandler(InterceptorGetterCallbackImpl<uint32_t>,
|
||||
InterceptorSetterCallbackImpl<uint32_t>);
|
||||
obj = tmpl->NewInstance();
|
||||
|
||||
v8::MaybeLocal<v8::Object> maybe_object = tmpl->NewInstance(context);
|
||||
if (!maybe_object.ToLocal<v8::Object>(&obj)) {
|
||||
NOTREACHED() << "Failed to create V8 Object with interceptor";
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
obj = v8::Object::New(isolate);
|
||||
}
|
||||
@@ -1435,8 +1440,9 @@ CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
|
||||
v8::FunctionTemplate::New(isolate, FunctionCallbackImpl, function_data);
|
||||
|
||||
// Retrieve the function object and set the name.
|
||||
v8::Local<v8::Function> func = tmpl->GetFunction();
|
||||
if (func.IsEmpty()) {
|
||||
v8::MaybeLocal<v8::Function> maybe_func = tmpl->GetFunction(context);
|
||||
v8::Local<v8::Function> func;
|
||||
if (!maybe_func.ToLocal(&func)) {
|
||||
NOTREACHED() << "failed to create V8 function";
|
||||
return NULL;
|
||||
}
|
||||
@@ -1880,8 +1886,8 @@ bool CefV8ValueImpl::DeleteValue(const CefString& key) {
|
||||
|
||||
v8::TryCatch try_catch(isolate);
|
||||
try_catch.SetVerbose(true);
|
||||
bool del = obj->Delete(GetV8String(isolate, key));
|
||||
return (!HasCaught(context, try_catch) && del);
|
||||
v8::Maybe<bool> del = obj->Delete(context, GetV8String(isolate, key));
|
||||
return (!HasCaught(context, try_catch) && del.FromJust());
|
||||
}
|
||||
|
||||
bool CefV8ValueImpl::DeleteValue(int index) {
|
||||
|
@@ -60,11 +60,6 @@ bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) {
|
||||
}
|
||||
|
||||
void CefContentUtilityClient::RegisterServices(StaticServiceMap* services) {
|
||||
service_manager::EmbeddedServiceInfo pdf_compositor_info;
|
||||
pdf_compositor_info.factory =
|
||||
base::Bind(&printing::CreatePdfCompositorService, std::string());
|
||||
services->emplace(printing::mojom::kServiceName, pdf_compositor_info);
|
||||
|
||||
{
|
||||
service_manager::EmbeddedServiceInfo printing_info;
|
||||
printing_info.factory =
|
||||
@@ -81,3 +76,14 @@ void CefContentUtilityClient::RegisterServices(StaticServiceMap* services) {
|
||||
services->emplace(proxy_resolver::mojom::kProxyResolverServiceName,
|
||||
proxy_resolver_info);
|
||||
}
|
||||
|
||||
std::unique_ptr<service_manager::Service>
|
||||
CefContentUtilityClient::HandleServiceRequest(
|
||||
const std::string& service_name,
|
||||
service_manager::mojom::ServiceRequest request) {
|
||||
if (service_name == printing::mojom::kServiceName) {
|
||||
return printing::CreatePdfCompositorService(std::string(),
|
||||
std::move(request));
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@@ -25,6 +25,9 @@ class CefContentUtilityClient : public content::ContentUtilityClient {
|
||||
void UtilityThreadStarted() override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
void RegisterServices(StaticServiceMap* services) override;
|
||||
std::unique_ptr<service_manager::Service> HandleServiceRequest(
|
||||
const std::string& service_name,
|
||||
service_manager::mojom::ServiceRequest request) override;
|
||||
|
||||
private:
|
||||
#if defined(OS_WIN)
|
||||
|
@@ -182,7 +182,6 @@ LogMessage::LogMessage(const char* file,
|
||||
}
|
||||
|
||||
LogMessage::~LogMessage() {
|
||||
stream_ << std::endl;
|
||||
std::string str_newline(stream_.str());
|
||||
cef_log(file_, line_, severity_, str_newline.c_str());
|
||||
}
|
||||
@@ -253,6 +252,9 @@ ErrnoLogMessage::~ErrnoLogMessage() {
|
||||
}
|
||||
#endif // OS_WIN
|
||||
|
||||
} // namespace logging
|
||||
} // namespace cef
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
|
||||
cef_string_utf8_t str = {0};
|
||||
std::wstring tmp_str(wstr);
|
||||
@@ -261,6 +263,3 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
|
||||
cef_string_utf8_clear(&str);
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace logging
|
||||
} // namespace cef
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=cc0282396c2314d38106a13e09500f6c33308aa2$
|
||||
// $hash=cb2373876547c8f8e0315043a37b80b9f3d91d48$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/views/menu_button_cpptoc.h"
|
||||
@@ -31,8 +31,7 @@
|
||||
CEF_EXPORT cef_menu_button_t* cef_menu_button_create(
|
||||
cef_menu_button_delegate_t* delegate,
|
||||
const cef_string_t* text,
|
||||
int with_frame,
|
||||
int with_menu_marker) {
|
||||
int with_frame) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: delegate; type: refptr_diff
|
||||
@@ -44,7 +43,7 @@ CEF_EXPORT cef_menu_button_t* cef_menu_button_create(
|
||||
// Execute
|
||||
CefRefPtr<CefMenuButton> _retval = CefMenuButton::CreateMenuButton(
|
||||
CefMenuButtonDelegateCToCpp::Wrap(delegate), CefString(text),
|
||||
with_frame ? true : false, with_menu_marker ? true : false);
|
||||
with_frame ? true : false);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMenuButtonCppToC::Wrap(_retval);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=47a59c17dbc244818b316431511ee8f8e4e176d4$
|
||||
// $hash=75a8c7434e17ea5b527795202ad215733f7c75b1$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/menu_button_ctocpp.h"
|
||||
@@ -32,8 +32,7 @@ NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefMenuButton> CefMenuButton::CreateMenuButton(
|
||||
CefRefPtr<CefMenuButtonDelegate> delegate,
|
||||
const CefString& text,
|
||||
bool with_frame,
|
||||
bool with_menu_marker) {
|
||||
bool with_frame) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: delegate; type: refptr_diff
|
||||
@@ -45,7 +44,7 @@ CefRefPtr<CefMenuButton> CefMenuButton::CreateMenuButton(
|
||||
// Execute
|
||||
cef_menu_button_t* _retval =
|
||||
cef_menu_button_create(CefMenuButtonDelegateCppToC::Wrap(delegate),
|
||||
text.GetStruct(), with_frame, with_menu_marker);
|
||||
text.GetStruct(), with_frame);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMenuButtonCToCpp::Wrap(_retval);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=c97869e39dcae705a39d0e47afdf17381a2ae787$
|
||||
// $hash=3639cede4bdba16cae273a2137867f9c5ac53fe8$
|
||||
//
|
||||
|
||||
#include "include/views/cef_browser_view.h"
|
||||
@@ -87,8 +87,7 @@ NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefMenuButton> CefMenuButton::CreateMenuButton(
|
||||
CefRefPtr<CefMenuButtonDelegate> delegate,
|
||||
const CefString& text,
|
||||
bool with_frame,
|
||||
bool with_menu_marker) {
|
||||
bool with_frame) {
|
||||
NOTIMPLEMENTED();
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=25bad84a44dd0bae48fdf56376893ae7f0e7dd27$
|
||||
// $hash=ef8269462464beba6718a2e0d03e0f1cb41901bf$
|
||||
//
|
||||
|
||||
#include <dlfcn.h>
|
||||
@@ -324,7 +324,6 @@ typedef struct _cef_label_button_t* (*cef_label_button_create_ptr)(
|
||||
typedef struct _cef_menu_button_t* (*cef_menu_button_create_ptr)(
|
||||
struct _cef_menu_button_delegate_t*,
|
||||
const cef_string_t*,
|
||||
int,
|
||||
int);
|
||||
typedef struct _cef_panel_t* (*cef_panel_create_ptr)(
|
||||
struct _cef_panel_delegate_t*);
|
||||
@@ -1701,10 +1700,8 @@ NO_SANITIZE("cfi-icall")
|
||||
struct _cef_menu_button_t* cef_menu_button_create(
|
||||
struct _cef_menu_button_delegate_t* delegate,
|
||||
const cef_string_t* text,
|
||||
int with_frame,
|
||||
int with_menu_marker) {
|
||||
return g_libcef_pointers.cef_menu_button_create(delegate, text, with_frame,
|
||||
with_menu_marker);
|
||||
int with_frame) {
|
||||
return g_libcef_pointers.cef_menu_button_create(delegate, text, with_frame);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
|
@@ -53,6 +53,11 @@ patches = [
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2362
|
||||
'name': 'message_loop',
|
||||
},
|
||||
{
|
||||
# Add builtin trace event categories for CEF.
|
||||
# Required due to https://crrev.com/331266377d.
|
||||
'name': 'trace_event',
|
||||
},
|
||||
{
|
||||
# Enable popups in offscreen rendering on OS X.
|
||||
#
|
||||
@@ -186,7 +191,6 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Modify views::View to extend SupportsUserData.
|
||||
# Modify views::MenuButton behavior.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1749
|
||||
#
|
||||
# Don't add TestDesktopScreenX11 dependency on Linux.
|
||||
@@ -237,6 +241,9 @@ patches = [
|
||||
# of adding a dependency on SystemNetworkContextManager (see
|
||||
# https://crrev.com/6ed14d99e9).
|
||||
# TODO(cef): Consider removing this once we support NetworkService.
|
||||
#
|
||||
# Show the CEF Save As dialog.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2613
|
||||
'name': 'chrome_browser_net_export',
|
||||
},
|
||||
{
|
||||
@@ -367,16 +374,21 @@ patches = [
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=757974#c23
|
||||
'name': 'mac_gpu',
|
||||
},
|
||||
{
|
||||
# macOS: Make the NativeEventProcessor protocol dependency optional.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2539
|
||||
'name': 'mac_event_observer_2539',
|
||||
},
|
||||
{
|
||||
# macOS: Fix crash when scrolling in OSR mode.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2540
|
||||
'name': 'mac_fling_scheduler_2540',
|
||||
},
|
||||
{
|
||||
# Support rendering to a hardware GL/D3D texture/surface provided by the client
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1006
|
||||
'name': 'external_textures_1006',
|
||||
},
|
||||
{
|
||||
# Fix crash in CookieMonsterChangeDispatcher::Subscription destructor.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=729800#c48
|
||||
'name': 'net_cookies_729800',
|
||||
},
|
||||
{
|
||||
# Linux: Use poll instead of select to fix crash during startup.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2466
|
||||
@@ -396,16 +408,12 @@ patches = [
|
||||
{
|
||||
# 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
|
||||
'name': 'message_pump_mac_2495',
|
||||
},
|
||||
{
|
||||
# Fix CVE-2019-5786: Use-after-free in FileReader.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=936448
|
||||
'name': 'blink_filereader_936448',
|
||||
}
|
||||
]
|
||||
|
@@ -1,28 +0,0 @@
|
||||
diff --git third_party/blink/renderer/core/fileapi/file_reader_loader.cc third_party/blink/renderer/core/fileapi/file_reader_loader.cc
|
||||
index 173a43dfbd05..f7f0154954d0 100644
|
||||
--- third_party/blink/renderer/core/fileapi/file_reader_loader.cc
|
||||
+++ third_party/blink/renderer/core/fileapi/file_reader_loader.cc
|
||||
@@ -142,14 +142,16 @@ DOMArrayBuffer* FileReaderLoader::ArrayBufferResult() {
|
||||
if (!raw_data_ || error_code_)
|
||||
return nullptr;
|
||||
|
||||
- DOMArrayBuffer* result = DOMArrayBuffer::Create(raw_data_->ToArrayBuffer());
|
||||
- if (finished_loading_) {
|
||||
- array_buffer_result_ = result;
|
||||
- AdjustReportedMemoryUsageToV8(
|
||||
- -1 * static_cast<int64_t>(raw_data_->ByteLength()));
|
||||
- raw_data_.reset();
|
||||
+ if (!finished_loading_) {
|
||||
+ return DOMArrayBuffer::Create(
|
||||
+ ArrayBuffer::Create(raw_data_->Data(), raw_data_->ByteLength()));
|
||||
}
|
||||
- return result;
|
||||
+
|
||||
+ array_buffer_result_ = DOMArrayBuffer::Create(raw_data_->ToArrayBuffer());
|
||||
+ AdjustReportedMemoryUsageToV8(-1 *
|
||||
+ static_cast<int64_t>(raw_data_->ByteLength()));
|
||||
+ raw_data_.reset();
|
||||
+ return array_buffer_result_;
|
||||
}
|
||||
|
||||
String FileReaderLoader::StringResult() {
|
@@ -1,8 +1,8 @@
|
||||
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 99d980ac4ca9..b7d2b3f10bfb 100644
|
||||
index ab1f2d3dacca..df2dff420e32 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_child_frame.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_child_frame.cc
|
||||
@@ -665,6 +665,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
|
||||
@@ -641,6 +641,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
|
||||
"RenderWidgetHostViewChildFrame::OnSwapCompositorFrame");
|
||||
support_->SubmitCompositorFrame(local_surface_id, std::move(frame),
|
||||
std::move(hit_test_region_list));
|
||||
@@ -10,11 +10,31 @@ index 99d980ac4ca9..b7d2b3f10bfb 100644
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
|
||||
@@ -942,7 +943,6 @@ void RenderWidgetHostViewChildFrame::OnFirstSurfaceActivation(
|
||||
last_activated_surface_info_ = surface_info;
|
||||
has_frame_ = true;
|
||||
FirstSurfaceActivation(surface_info);
|
||||
- ProcessFrameSwappedCallbacks();
|
||||
@@ -649,6 +650,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
|
||||
support_->DidNotProduceFrame(ack);
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewChildFrame::OnFrameTokenChanged(uint32_t frame_token) {
|
||||
+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
|
||||
@@ -834,6 +844,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,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
index 71a9e1024b60..504c6b98bfa3 100644
|
||||
index da7e3391774e..7ac32ff70a5a 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,
|
||||
@@ -9,10 +9,10 @@ index 71a9e1024b60..504c6b98bfa3 100644
|
||||
+ ui::Layer* GetRootLayer() { return root_layer_.get(); }
|
||||
+ ui::Compositor* GetCompositor();
|
||||
|
||||
// Ensure that the currect compositor frame be cleared (even if it is
|
||||
// potentially visible).
|
||||
// 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 65670cccb503..6dc30c945f1f 100644
|
||||
index 21d3b34cc13f..0e281eaf06d9 100644
|
||||
--- content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
@@ -84,6 +84,12 @@ DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() {
|
||||
@@ -25,6 +25,6 @@ index 65670cccb503..6dc30c945f1f 100644
|
||||
+ return nullptr;
|
||||
+}
|
||||
+
|
||||
void BrowserCompositorMac::ClearCompositorFrame() {
|
||||
// Make sure that we no longer hold a compositor lock by un-suspending the
|
||||
// compositor. This ensures that we are able to swap in a new blank frame to
|
||||
bool BrowserCompositorMac::ForceNewSurfaceId() {
|
||||
dfh_local_surface_id_allocator_.GenerateId();
|
||||
delegated_frame_host_->EmbedSurface(
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
index 2c585e36dff5..ee7234381aae 100644
|
||||
index e706efbc6219..3b6f60660650 100644
|
||||
--- content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
+++ content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
@@ -314,8 +314,11 @@ void BrowserPluginGuest::InitInternal(
|
||||
@@ -347,8 +347,11 @@ void BrowserPluginGuest::InitInternal(
|
||||
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ index 2c585e36dff5..ee7234381aae 100644
|
||||
|
||||
// Once a BrowserPluginGuest has an embedder WebContents, it's considered to
|
||||
// be attached.
|
||||
@@ -785,10 +788,19 @@ void BrowserPluginGuest::OnWillAttachComplete(
|
||||
@@ -861,10 +864,19 @@ void BrowserPluginGuest::OnWillAttachComplete(
|
||||
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
|
||||
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) {
|
||||
web_contents_view->CreateViewForWidget(
|
||||
@@ -37,10 +37,10 @@ index 2c585e36dff5..ee7234381aae 100644
|
||||
|
||||
attached_ = true;
|
||||
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
|
||||
index f206f1e547ab..97e18dc1a742 100644
|
||||
index a97648ef717b..b82895c89f77 100644
|
||||
--- content/browser/frame_host/interstitial_page_impl.cc
|
||||
+++ content/browser/frame_host/interstitial_page_impl.cc
|
||||
@@ -633,7 +633,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
|
||||
@@ -632,7 +632,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
|
||||
WebContentsView* wcv =
|
||||
static_cast<WebContentsImpl*>(web_contents())->GetView();
|
||||
RenderWidgetHostViewBase* view =
|
||||
@@ -79,7 +79,7 @@ index 5426d600906c..4bf4537514eb 100644
|
||||
// Creates a new View that holds a non-top-level widget and receives messages
|
||||
// for it.
|
||||
diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc
|
||||
index ce5602b1cc38..b4189ae15ded 100644
|
||||
index 12d8f9bd7cc5..f228b39902bb 100644
|
||||
--- content/browser/web_contents/web_contents_view_aura.cc
|
||||
+++ content/browser/web_contents/web_contents_view_aura.cc
|
||||
@@ -809,7 +809,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size,
|
||||
@@ -101,7 +101,7 @@ index ce5602b1cc38..b4189ae15ded 100644
|
||||
g_create_render_widget_host_view
|
||||
? g_create_render_widget_host_view(render_widget_host,
|
||||
diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h
|
||||
index 0c4a3d2e0d72..e69f663cd1c9 100644
|
||||
index 3c0b73d6f72d..4c9e0f3b7d3a 100644
|
||||
--- content/browser/web_contents/web_contents_view_aura.h
|
||||
+++ content/browser/web_contents/web_contents_view_aura.h
|
||||
@@ -121,7 +121,7 @@ class CONTENT_EXPORT WebContentsViewAura
|
||||
@@ -208,10 +208,10 @@ index 1f0e661628aa..f896c842ff0d 100644
|
||||
RenderWidgetHost* render_widget_host) override;
|
||||
void SetPageTitle(const base::string16& title) override;
|
||||
diff --git content/browser/web_contents/web_contents_view_mac.h content/browser/web_contents/web_contents_view_mac.h
|
||||
index d08876fc503a..bad24076b16f 100644
|
||||
index 5317a1895671..770d05a9c4a9 100644
|
||||
--- content/browser/web_contents/web_contents_view_mac.h
|
||||
+++ content/browser/web_contents/web_contents_view_mac.h
|
||||
@@ -101,7 +101,7 @@ class WebContentsViewMac : public WebContentsView,
|
||||
@@ -102,7 +102,7 @@ class WebContentsViewMac : public WebContentsView,
|
||||
gfx::NativeView context) override;
|
||||
RenderWidgetHostViewBase* CreateViewForWidget(
|
||||
RenderWidgetHost* render_widget_host,
|
||||
@@ -221,10 +221,10 @@ index d08876fc503a..bad24076b16f 100644
|
||||
RenderWidgetHost* render_widget_host) override;
|
||||
void SetPageTitle(const base::string16& title) override;
|
||||
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
|
||||
index 3374d2b122d9..fa222a6ffb13 100644
|
||||
index 18f85330beaf..bf220383e368 100644
|
||||
--- content/browser/web_contents/web_contents_view_mac.mm
|
||||
+++ content/browser/web_contents/web_contents_view_mac.mm
|
||||
@@ -336,7 +336,8 @@ void WebContentsViewMac::CreateView(
|
||||
@@ -337,7 +337,8 @@ void WebContentsViewMac::CreateView(
|
||||
}
|
||||
|
||||
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@@ -234,7 +234,7 @@ index 3374d2b122d9..fa222a6ffb13 100644
|
||||
if (render_widget_host->GetView()) {
|
||||
// During testing, the view will already be set up in most cases to the
|
||||
// test view, so we don't want to clobber it with a real one. To verify that
|
||||
@@ -348,6 +349,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@@ -349,6 +350,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
render_widget_host->GetView());
|
||||
}
|
||||
|
||||
@@ -266,10 +266,10 @@ index bf2226b53dd7..782a320ab788 100644
|
||||
// a BrowserPlugin even when we are using cross process frames for guests. It
|
||||
// should be removed after resolving https://crbug.com/642826).
|
||||
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
index b7a9609ef426..f02c6df27fcc 100644
|
||||
index ad0dae9b1494..80251026a27b 100644
|
||||
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
@@ -199,6 +199,8 @@ void MimeHandlerViewGuest::CreateWebContents(
|
||||
@@ -207,6 +207,8 @@ void MimeHandlerViewGuest::CreateWebContents(
|
||||
WebContents::CreateParams params(browser_context(),
|
||||
guest_site_instance.get());
|
||||
params.guest_delegate = this;
|
||||
@@ -278,7 +278,7 @@ index b7a9609ef426..f02c6df27fcc 100644
|
||||
// TODO(erikchen): Fix ownership semantics for guest views.
|
||||
// https://crbug.com/832879.
|
||||
std::move(callback).Run(
|
||||
@@ -243,6 +245,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const {
|
||||
@@ -251,6 +253,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -298,10 +298,10 @@ index b7a9609ef426..f02c6df27fcc 100644
|
||||
WebContents* source,
|
||||
const content::OpenURLParams& params) {
|
||||
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
index ebca89ac6256..ea1e2707cb21 100644
|
||||
index cfa759b4b826..4d53d6bcc492 100644
|
||||
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
@@ -112,6 +112,10 @@ class MimeHandlerViewGuest
|
||||
@@ -114,6 +114,10 @@ class MimeHandlerViewGuest
|
||||
bool ZoomPropagatesFromEmbedderToGuest() const final;
|
||||
bool ShouldDestroyOnDetach() const final;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
|
||||
index 8947045aed93..ae92887ad635 100644
|
||||
index f79e53e96253..280cde01e3ca 100644
|
||||
--- chrome/browser/BUILD.gn
|
||||
+++ chrome/browser/BUILD.gn
|
||||
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
|
||||
@@ -10,7 +10,7 @@ index 8947045aed93..ae92887ad635 100644
|
||||
import("//chrome/common/features.gni")
|
||||
import("//components/feature_engagement/features.gni")
|
||||
import("//components/feed/features.gni")
|
||||
@@ -1714,6 +1715,7 @@ jumbo_split_static_library("browser") {
|
||||
@@ -1727,6 +1728,7 @@ jumbo_split_static_library("browser") {
|
||||
"//base:i18n",
|
||||
"//base/allocator:buildflags",
|
||||
"//cc",
|
||||
@@ -18,7 +18,7 @@ index 8947045aed93..ae92887ad635 100644
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -1990,6 +1992,10 @@ jumbo_split_static_library("browser") {
|
||||
@@ -2006,6 +2008,10 @@ jumbo_split_static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ index 8947045aed93..ae92887ad635 100644
|
||||
if (is_android) {
|
||||
sources += [
|
||||
"after_startup_task_utils_android.cc",
|
||||
@@ -3596,7 +3602,7 @@ jumbo_split_static_library("browser") {
|
||||
@@ -3638,7 +3644,7 @@ jumbo_split_static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h
|
||||
index 9b52c6682024..f188476b45ee 100644
|
||||
index cac72c6a2fd1..2ed83a4af1b3 100644
|
||||
--- chrome/browser/browser_process.h
|
||||
+++ chrome/browser/browser_process.h
|
||||
@@ -39,6 +39,10 @@ class SystemNetworkContextManager;
|
||||
@@ -13,7 +13,7 @@ index 9b52c6682024..f188476b45ee 100644
|
||||
namespace network {
|
||||
class NetworkQualityTracker;
|
||||
class SharedURLLoaderFactory;
|
||||
@@ -182,6 +186,9 @@ class BrowserProcess {
|
||||
@@ -183,6 +187,9 @@ class BrowserProcess {
|
||||
// backed by the IOThread's URLRequestContext.
|
||||
virtual SystemNetworkContextManager* system_network_context_manager() = 0;
|
||||
|
||||
@@ -24,7 +24,7 @@ index 9b52c6682024..f188476b45ee 100644
|
||||
// network quality change events.
|
||||
virtual network::NetworkQualityTracker* network_quality_tracker() = 0;
|
||||
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
|
||||
index 0c18c4e54307..bc816cfae4d0 100644
|
||||
index 9178909e6ce3..7656cbbb99c0 100644
|
||||
--- chrome/browser/browser_process_impl.cc
|
||||
+++ chrome/browser/browser_process_impl.cc
|
||||
@@ -665,6 +665,10 @@ BrowserProcessImpl::system_network_context_manager() {
|
||||
@@ -39,10 +39,10 @@ index 0c18c4e54307..bc816cfae4d0 100644
|
||||
BrowserProcessImpl::shared_url_loader_factory() {
|
||||
return system_network_context_manager()->GetSharedURLLoaderFactory();
|
||||
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
|
||||
index ab192b468f53..d0864716dcfe 100644
|
||||
index 143e7442ca05..896829d2836f 100644
|
||||
--- chrome/browser/browser_process_impl.h
|
||||
+++ chrome/browser/browser_process_impl.h
|
||||
@@ -143,6 +143,7 @@ class BrowserProcessImpl : public BrowserProcess,
|
||||
@@ -140,6 +140,7 @@ class BrowserProcessImpl : public BrowserProcess,
|
||||
// TODO(qinmin): Remove this method as callers can retrieve the global
|
||||
// instance from SystemNetworkContextManager directly.
|
||||
SystemNetworkContextManager* system_network_context_manager() override;
|
||||
@@ -50,11 +50,149 @@ index ab192b468f53..d0864716dcfe 100644
|
||||
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory()
|
||||
override;
|
||||
network::NetworkQualityTracker* network_quality_tracker() override;
|
||||
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
|
||||
index c57b1a02a1fc..69721fb988a4 100644
|
||||
--- chrome/browser/ui/BUILD.gn
|
||||
+++ chrome/browser/ui/BUILD.gn
|
||||
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
|
||||
import("//build/config/jumbo.gni")
|
||||
import("//build/config/ui.gni")
|
||||
import("//build/split_static_library.gni")
|
||||
+import("//cef/libcef/features/features.gni")
|
||||
import("//chrome/common/features.gni")
|
||||
import("//chromeos/assistant/assistant.gni")
|
||||
import("//components/feature_engagement/features.gni")
|
||||
@@ -354,6 +355,10 @@ jumbo_split_static_library("ui") {
|
||||
"//build/config/compiler:wexit_time_destructors",
|
||||
]
|
||||
|
||||
+ if (enable_cef) {
|
||||
+ configs += [ "//cef/libcef/features:config" ]
|
||||
+ }
|
||||
+
|
||||
# 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
|
||||
@@ -370,6 +375,7 @@ jumbo_split_static_library("ui") {
|
||||
"//base:i18n",
|
||||
"//base/allocator:buildflags",
|
||||
"//cc/paint",
|
||||
+ "//cef/libcef/features",
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -2267,7 +2273,7 @@ jumbo_split_static_library("ui") {
|
||||
"views/frame/native_browser_frame_factory_ozone.cc",
|
||||
]
|
||||
} else {
|
||||
- if (use_aura) {
|
||||
+ if (use_aura && use_gtk) {
|
||||
# This is the only component that can interact with gtk.
|
||||
deps += [ "//chrome/browser/ui/libgtkui" ]
|
||||
}
|
||||
diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc
|
||||
index 38c8ac0ed0e1..e759d3ebebf2 100644
|
||||
index 62796358a2a7..8ba23a87b982 100644
|
||||
--- chrome/browser/ui/webui/net_export_ui.cc
|
||||
+++ chrome/browser/ui/webui/net_export_ui.cc
|
||||
@@ -159,8 +159,7 @@ class NetExportMessageHandler
|
||||
@@ -20,14 +20,13 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
-#include "chrome/browser/download/download_prefs.h"
|
||||
#include "chrome/browser/io_thread.h"
|
||||
#include "chrome/browser/net/net_export_helper.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
#include "chrome/browser/platform_util.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
-#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"
|
||||
@@ -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"
|
||||
+
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
+#include "chrome/browser/download/download_prefs.h"
|
||||
+#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
+#else
|
||||
+#include "cef/libcef/browser/browser_host_impl.h"
|
||||
+#endif
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
#include "chrome/browser/android/intent_helper.h"
|
||||
@@ -69,6 +75,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
void SetIfNotNull(base::DictionaryValue* dict,
|
||||
const base::StringPiece& path,
|
||||
std::unique_ptr<base::Value> in_value) {
|
||||
@@ -76,6 +83,7 @@ void SetIfNotNull(base::DictionaryValue* dict,
|
||||
dict->Set(path, std::move(in_value));
|
||||
}
|
||||
}
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
// This class receives javascript messages from the renderer.
|
||||
// Note that the WebUI infrastructure runs on the UI thread, therefore all of
|
||||
@@ -83,7 +91,9 @@ void SetIfNotNull(base::DictionaryValue* dict,
|
||||
class NetExportMessageHandler
|
||||
: public WebUIMessageHandler,
|
||||
public base::SupportsWeakPtr<NetExportMessageHandler>,
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
public ui::SelectFileDialog::Listener,
|
||||
+#endif
|
||||
public net_log::NetExportFileWriter::StateObserver {
|
||||
public:
|
||||
NetExportMessageHandler();
|
||||
@@ -99,11 +109,13 @@ class NetExportMessageHandler
|
||||
void OnSendNetLog(const base::ListValue* list);
|
||||
void OnShowFile(const base::ListValue* list);
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
// ui::SelectFileDialog::Listener implementation.
|
||||
void FileSelected(const base::FilePath& path,
|
||||
int index,
|
||||
void* params) override;
|
||||
void FileSelectionCanceled(void* params) override;
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
// net_log::NetExportFileWriter::StateObserver implementation.
|
||||
void OnNewState(const base::DictionaryValue& state) override;
|
||||
@@ -133,9 +145,16 @@ class NetExportMessageHandler
|
||||
// renderer.
|
||||
void NotifyUIWithState(std::unique_ptr<base::DictionaryValue> state);
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
// Opens the SelectFileDialog UI with the default path to save a
|
||||
// NetLog file.
|
||||
void ShowSelectFileDialog(const base::FilePath& default_path);
|
||||
+#else
|
||||
+ void ShowCefSaveAsDialog(content::WebContents* web_contents);
|
||||
+ void SaveAsDialogDismissed(
|
||||
+ int selected_accept_filter,
|
||||
+ const std::vector<base::FilePath>& file_paths);
|
||||
+#endif
|
||||
|
||||
// Cached pointer to SystemNetworkContextManager's NetExportFileWriter.
|
||||
net_log::NetExportFileWriter* file_writer_;
|
||||
@@ -151,7 +170,9 @@ class NetExportMessageHandler
|
||||
net::NetLogCaptureMode capture_mode_;
|
||||
uint64_t max_log_file_size_;
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
|
||||
+#endif
|
||||
|
||||
base::WeakPtrFactory<NetExportMessageHandler> weak_ptr_factory_;
|
||||
|
||||
@@ -159,8 +180,7 @@ class NetExportMessageHandler
|
||||
};
|
||||
|
||||
NetExportMessageHandler::NetExportMessageHandler()
|
||||
@@ -64,3 +202,116 @@ index 38c8ac0ed0e1..e759d3ebebf2 100644
|
||||
state_observer_manager_(this),
|
||||
weak_ptr_factory_(this) {
|
||||
file_writer_->Initialize();
|
||||
@@ -169,8 +189,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.
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
if (select_file_dialog_)
|
||||
select_file_dialog_->ListenerDestroyed();
|
||||
+#endif
|
||||
|
||||
file_writer_->StopNetLog(nullptr);
|
||||
}
|
||||
@@ -233,6 +255,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
|
||||
if (UsingMobileUI()) {
|
||||
StartNetLog(base::FilePath());
|
||||
} else {
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
base::FilePath initial_dir = last_save_dir.Pointer()->empty() ?
|
||||
DownloadPrefs::FromBrowserContext(
|
||||
web_ui()->GetWebContents()->GetBrowserContext())->DownloadPath() :
|
||||
@@ -240,6 +263,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);
|
||||
+#else // BUILDFLAG(ENABLE_CEF)
|
||||
+ ShowCefSaveAsDialog(web_ui()->GetWebContents());
|
||||
+#endif // BUILDFLAG(ENABLE_CEF)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,6 +275,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
|
||||
std::unique_ptr<base::DictionaryValue> ui_thread_polled_data(
|
||||
new base::DictionaryValue());
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
Profile* profile = Profile::FromWebUI(web_ui());
|
||||
SetIfNotNull(ui_thread_polled_data.get(), "prerenderInfo",
|
||||
chrome_browser_net::GetPrerenderInfo(profile));
|
||||
@@ -258,6 +285,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
|
||||
SetIfNotNull(ui_thread_polled_data.get(), "serviceProviders",
|
||||
chrome_browser_net::GetWindowsServiceProviders());
|
||||
#endif
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
file_writer_->StopNetLog(std::move(ui_thread_polled_data));
|
||||
}
|
||||
@@ -274,6 +302,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) {
|
||||
base::Bind(&NetExportMessageHandler::ShowFileInShell, AsWeakPtr()));
|
||||
}
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
void NetExportMessageHandler::FileSelected(const base::FilePath& path,
|
||||
int index,
|
||||
void* params) {
|
||||
@@ -292,6 +321,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) {
|
||||
DCHECK(select_file_dialog_);
|
||||
select_file_dialog_ = nullptr;
|
||||
}
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
void NetExportMessageHandler::OnNewState(const base::DictionaryValue& state) {
|
||||
NotifyUIWithState(state.CreateDeepCopy());
|
||||
@@ -356,6 +386,7 @@ void NetExportMessageHandler::NotifyUIWithState(
|
||||
*state);
|
||||
}
|
||||
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
void NetExportMessageHandler::ShowSelectFileDialog(
|
||||
const base::FilePath& default_path) {
|
||||
// User may have clicked more than once before the save dialog appears.
|
||||
@@ -374,6 +405,43 @@ void NetExportMessageHandler::ShowSelectFileDialog(
|
||||
ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), default_path,
|
||||
&file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr);
|
||||
}
|
||||
+#endif // !BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
+void NetExportMessageHandler::ShowCefSaveAsDialog(
|
||||
+ content::WebContents* web_contents) {
|
||||
+ CefRefPtr<CefBrowserHostImpl> cef_browser =
|
||||
+ CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
+ if (!cef_browser)
|
||||
+ return;
|
||||
+
|
||||
+ base::FilePath initial_dir;
|
||||
+ if (!last_save_dir.Pointer()->empty())
|
||||
+ initial_dir = *last_save_dir.Pointer();
|
||||
+ base::FilePath initial_path =
|
||||
+ initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json"));
|
||||
+
|
||||
+ CefFileDialogRunner::FileChooserParams params;
|
||||
+ params.mode = blink::mojom::FileChooserParams::Mode::kSave;
|
||||
+ params.default_file_name = initial_path;
|
||||
+ params.accept_types.push_back(CefString(initial_path.Extension()));
|
||||
+
|
||||
+ cef_browser->RunFileChooser(
|
||||
+ params, base::Bind(&NetExportMessageHandler::SaveAsDialogDismissed,
|
||||
+ weak_ptr_factory_.GetWeakPtr()));
|
||||
+}
|
||||
+
|
||||
+void NetExportMessageHandler::SaveAsDialogDismissed(
|
||||
+ int selected_accept_filter,
|
||||
+ const std::vector<base::FilePath>& file_paths) {
|
||||
+ if (file_paths.size() == 1) {
|
||||
+ *last_save_dir.Pointer() = file_paths[0].DirName();
|
||||
+ StartNetLog(file_paths[0]);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#endif // BUILDFLAG(ENABLE_CEF)
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@@ -71,10 +71,10 @@ index e8e76ce5b954..1dd338dd0142 100644
|
||||
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
|
||||
content::BrowserContext* context);
|
||||
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
|
||||
index 08c6c70aea17..ac157a1afc78 100644
|
||||
index e00b581b90d3..1ffa2e8f18da 100644
|
||||
--- chrome/browser/profiles/profile_manager.cc
|
||||
+++ chrome/browser/profiles/profile_manager.cc
|
||||
@@ -388,7 +388,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
|
||||
@@ -381,7 +381,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
|
||||
chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
|
@@ -125,10 +125,10 @@ index 989d5d02cedb..e05810db6824 100644
|
||||
// If we broke out of the loop, we have found an enabled plugin.
|
||||
bool enabled = i < matching_plugins.size();
|
||||
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
|
||||
index 2d9e1bbe419e..e297e3b9abe3 100644
|
||||
index 488d0ec60a81..9d817080555a 100644
|
||||
--- chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -801,6 +801,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -804,6 +804,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
|
||||
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
|
||||
status == chrome::mojom::PluginStatus::kBlocked) &&
|
||||
@@ -136,7 +136,7 @@ index 2d9e1bbe419e..e297e3b9abe3 100644
|
||||
observer->IsPluginTemporarilyAllowed(identifier)) {
|
||||
status = chrome::mojom::PluginStatus::kAllowed;
|
||||
}
|
||||
@@ -988,7 +989,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -991,7 +992,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
|
||||
&plugin_auth_host);
|
||||
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
|
||||
@@ -146,7 +146,7 @@ index 2d9e1bbe419e..e297e3b9abe3 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlocked: {
|
||||
@@ -997,7 +999,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -1000,7 +1002,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
|
||||
placeholder->AllowLoading();
|
||||
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
|
||||
@@ -156,7 +156,7 @@ index 2d9e1bbe419e..e297e3b9abe3 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
|
||||
@@ -1007,7 +1010,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -1010,7 +1013,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
group_name));
|
||||
RenderThread::Get()->RecordAction(
|
||||
UserMetricsAction("Plugin_BlockedByPolicy"));
|
||||
@@ -166,7 +166,7 @@ index 2d9e1bbe419e..e297e3b9abe3 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
|
||||
@@ -1015,7 +1019,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -1018,7 +1022,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
IDR_BLOCKED_PLUGIN_HTML,
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
|
||||
group_name));
|
||||
@@ -177,7 +177,7 @@ index 2d9e1bbe419e..e297e3b9abe3 100644
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
|
||||
diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||
index 7052b1d68246..ba05a591ebf5 100644
|
||||
index ddec5604dc24..d91befbf6e2c 100644
|
||||
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||
@@ -350,8 +350,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
|
||||
index 45e6cbde8603..a49f2b2632b9 100644
|
||||
index c5166e854238..e0493a44eb26 100644
|
||||
--- chrome/renderer/BUILD.gn
|
||||
+++ chrome/renderer/BUILD.gn
|
||||
@@ -4,6 +4,7 @@
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
|
||||
index d93b738c2424..1e3d6d3eb4df 100644
|
||||
index 310971aadad2..1c9f77745f09 100644
|
||||
--- chrome/common/chrome_content_client.cc
|
||||
+++ chrome/common/chrome_content_client.cc
|
||||
@@ -99,7 +99,8 @@
|
||||
@@ -13,7 +13,7 @@ index d93b738c2424..1e3d6d3eb4df 100644
|
||||
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
|
||||
// TODO(crbug.com/663554): Needed for WIDEVINE_CDM_VERSION_STRING. Support
|
||||
diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn
|
||||
index 00d201e178c0..c37de789d5b2 100644
|
||||
index 4826777cffd2..a5835928dbad 100644
|
||||
--- third_party/widevine/cdm/BUILD.gn
|
||||
+++ third_party/widevine/cdm/BUILD.gn
|
||||
@@ -5,6 +5,7 @@
|
||||
|
@@ -50,21 +50,8 @@ index b6da8e846a2a..dd7ec1be2556 100644
|
||||
&pdf_plugin_info)) {
|
||||
return nullptr;
|
||||
}
|
||||
diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm
|
||||
index a132d1e4ff71..a328ee26f320 100644
|
||||
--- chrome/browser/ui/cocoa/drag_util.mm
|
||||
+++ chrome/browser/ui/cocoa/drag_util.mm
|
||||
@@ -45,7 +45,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
|
||||
return PluginService::GetInstance()->GetPluginInfo(
|
||||
-1, // process ID
|
||||
MSG_ROUTING_NONE, // routing ID
|
||||
- profile->GetResourceContext(), url, url::Origin(), mime_type,
|
||||
+ profile->GetResourceContext(), url, true, url::Origin(), mime_type,
|
||||
allow_wildcard, NULL, &plugin, NULL);
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
|
||||
index 11db808fdefb..99cad779ec08 100644
|
||||
index 8b08e6168124..7ea95c421b91 100644
|
||||
--- chrome/browser/ui/views/frame/browser_root_view.cc
|
||||
+++ chrome/browser/ui/views/frame/browser_root_view.cc
|
||||
@@ -69,7 +69,7 @@ void OnFindURLMimeType(const GURL& url,
|
||||
@@ -77,10 +64,10 @@ index 11db808fdefb..99cad779ec08 100644
|
||||
}
|
||||
|
||||
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
|
||||
index f8a86851d334..542f6eb61c53 100644
|
||||
index b8e933d665cf..ef41dae49b39 100644
|
||||
--- content/browser/frame_host/navigation_handle_impl.cc
|
||||
+++ content/browser/frame_host/navigation_handle_impl.cc
|
||||
@@ -423,12 +423,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
|
||||
@@ -427,12 +427,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
|
||||
}
|
||||
|
||||
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
|
||||
@@ -94,10 +81,10 @@ index f8a86851d334..542f6eb61c53 100644
|
||||
"WillFailRequest state should come before WillProcessResponse");
|
||||
return render_frame_host_;
|
||||
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
|
||||
index a17ae7ca0c07..c80e30494698 100644
|
||||
index eeb80f8b0763..ded6478fb29c 100644
|
||||
--- content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -1863,6 +1863,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
|
||||
@@ -2002,6 +2002,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
|
||||
if (GetNavigationHandle()) {
|
||||
GetNavigationHandle()->set_net_error_code(
|
||||
static_cast<net::Error>(params.error_code));
|
||||
@@ -105,7 +92,7 @@ index a17ae7ca0c07..c80e30494698 100644
|
||||
}
|
||||
|
||||
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
|
||||
@@ -4350,9 +4351,9 @@ void RenderFrameHostImpl::CommitNavigation(
|
||||
@@ -4611,9 +4612,9 @@ void RenderFrameHostImpl::CommitNavigation(
|
||||
DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService) ||
|
||||
base::FeatureList::IsEnabled(
|
||||
blink::features::kServiceWorkerServicification));
|
||||
@@ -118,10 +105,10 @@ index a17ae7ca0c07..c80e30494698 100644
|
||||
FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&PrefetchURLLoaderService::GetFactory,
|
||||
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
|
||||
index f1db4db0d671..18ca2f2e1604 100644
|
||||
index 541ce8cfca70..fce9bc74a3ad 100644
|
||||
--- content/browser/frame_host/render_frame_message_filter.cc
|
||||
+++ content/browser/frame_host/render_frame_message_filter.cc
|
||||
@@ -652,6 +652,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
||||
@@ -680,6 +680,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
||||
void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
int render_frame_id,
|
||||
const GURL& url,
|
||||
@@ -129,7 +116,7 @@ index f1db4db0d671..18ca2f2e1604 100644
|
||||
const url::Origin& main_frame_origin,
|
||||
const std::string& mime_type,
|
||||
bool* found,
|
||||
@@ -660,8 +661,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
@@ -691,8 +692,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
||||
bool allow_wildcard = true;
|
||||
*found = plugin_service_->GetPluginInfo(
|
||||
render_process_id_, render_frame_id, resource_context_, url,
|
||||
@@ -141,10 +128,10 @@ index f1db4db0d671..18ca2f2e1604 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 91a7d32dbe78..f99bc501c8b1 100644
|
||||
index 8280d104a6d9..ba3a682fdcee 100644
|
||||
--- content/browser/frame_host/render_frame_message_filter.h
|
||||
+++ content/browser/frame_host/render_frame_message_filter.h
|
||||
@@ -146,6 +146,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter
|
||||
@@ -149,6 +149,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter
|
||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
||||
void OnGetPluginInfo(int render_frame_id,
|
||||
const GURL& url,
|
||||
@@ -274,10 +261,10 @@ index 3009401dac6b..b4c5a9e2db50 100644
|
||||
};
|
||||
|
||||
diff --git content/common/frame_messages.h content/common/frame_messages.h
|
||||
index eee8d28ea50f..d5c92ad27fd0 100644
|
||||
index 17be42a1b675..fb093e0edb23 100644
|
||||
--- content/common/frame_messages.h
|
||||
+++ content/common/frame_messages.h
|
||||
@@ -1344,9 +1344,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
||||
@@ -1349,9 +1349,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.
|
||||
@@ -314,7 +301,7 @@ index 3b610b1f554e..7c439e060779 100644
|
||||
WebPluginInfo* plugin) = 0;
|
||||
|
||||
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
|
||||
index 3166cbe259da..e4bb34de7350 100644
|
||||
index f3bd63d89128..cfe1b01313cb 100644
|
||||
--- content/public/renderer/content_renderer_client.h
|
||||
+++ content/public/renderer/content_renderer_client.h
|
||||
@@ -76,6 +76,9 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -327,7 +314,7 @@ index 3166cbe259da..e4bb34de7350 100644
|
||||
// Notifies that a new RenderFrame has been created.
|
||||
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
|
||||
|
||||
@@ -341,6 +344,10 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -336,6 +339,10 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
// This method may invalidate the frame.
|
||||
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
|
||||
|
||||
@@ -339,10 +326,10 @@ index 3166cbe259da..e4bb34de7350 100644
|
||||
// started.
|
||||
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
|
||||
diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
|
||||
index ce1f26c0ab1d..d575eb38e116 100644
|
||||
index 8136604d267a..be7fde2f1a38 100644
|
||||
--- content/public/renderer/render_frame_observer.h
|
||||
+++ content/public/renderer/render_frame_observer.h
|
||||
@@ -152,6 +152,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
@@ -161,6 +161,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
virtual void DidReceiveTransferSizeUpdate(int resource_id,
|
||||
int received_data_length) {}
|
||||
|
||||
@@ -353,10 +340,10 @@ index ce1f26c0ab1d..d575eb38e116 100644
|
||||
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
|
||||
|
||||
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
|
||||
index cf3e520475a5..b21f22084186 100644
|
||||
index 692bf7f87256..ec510db56534 100644
|
||||
--- content/renderer/render_frame_impl.cc
|
||||
+++ content/renderer/render_frame_impl.cc
|
||||
@@ -3664,7 +3664,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
@@ -3645,7 +3645,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
std::string mime_type;
|
||||
bool found = false;
|
||||
Send(new FrameHostMsg_GetPluginInfo(
|
||||
@@ -376,10 +363,10 @@ index cf3e520475a5..b21f22084186 100644
|
||||
|
||||
void RenderFrameImpl::WillCommitProvisionalLoad() {
|
||||
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
|
||||
index f2d704c09e6e..f55ee220d817 100644
|
||||
index 68682fd876dd..8140654e82b1 100644
|
||||
--- content/renderer/render_thread_impl.cc
|
||||
+++ content/renderer/render_thread_impl.cc
|
||||
@@ -821,6 +821,8 @@ void RenderThreadImpl::Init() {
|
||||
@@ -819,6 +819,8 @@ void RenderThreadImpl::Init() {
|
||||
|
||||
StartServiceManagerConnection();
|
||||
|
||||
@@ -389,10 +376,10 @@ index f2d704c09e6e..f55ee220d817 100644
|
||||
base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest,
|
||||
base::Unretained(this)));
|
||||
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
|
||||
index 907fd2f4f856..716d5fc06316 100644
|
||||
index d80d269e5cb4..6444ad872a31 100644
|
||||
--- content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -1191,6 +1191,14 @@ void RendererBlinkPlatformImpl::SetMemoryPressureNotificationsSuppressed(
|
||||
@@ -1153,6 +1153,14 @@ void RendererBlinkPlatformImpl::SetMemoryPressureNotificationsSuppressed(
|
||||
base::MemoryPressureListener::SetNotificationsSuppressed(suppressed);
|
||||
}
|
||||
|
||||
@@ -408,10 +395,10 @@ index 907fd2f4f856..716d5fc06316 100644
|
||||
if (!web_database_host_) {
|
||||
web_database_host_ = blink::mojom::ThreadSafeWebDatabaseHostPtr::Create(
|
||||
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
|
||||
index 4ec814fd92c5..e1d21f399a30 100644
|
||||
index 63e86af7430a..3c1286d7133b 100644
|
||||
--- content/renderer/renderer_blink_platform_impl.h
|
||||
+++ content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -234,6 +234,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -232,6 +232,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void RequestPurgeMemory() override;
|
||||
void SetMemoryPressureNotificationsSuppressed(bool suppressed) override;
|
||||
|
||||
|
@@ -45,7 +45,7 @@ index bcf172e645a2..f879aa745adf 100644
|
||||
// on the given |command_line|.
|
||||
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
|
||||
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
|
||||
index d0949dc9693e..afe19e4f3ec4 100644
|
||||
index 61efc526eed9..b8d101eda7fd 100644
|
||||
--- chrome_elf/BUILD.gn
|
||||
+++ chrome_elf/BUILD.gn
|
||||
@@ -7,6 +7,7 @@
|
||||
@@ -56,7 +56,7 @@ index d0949dc9693e..afe19e4f3ec4 100644
|
||||
import("//chrome/process_version_rc_template.gni")
|
||||
import("//testing/test.gni")
|
||||
|
||||
@@ -124,9 +125,6 @@ source_set("constants") {
|
||||
@@ -126,9 +127,6 @@ source_set("constants") {
|
||||
|
||||
static_library("crash") {
|
||||
sources = [
|
||||
@@ -66,7 +66,7 @@ index d0949dc9693e..afe19e4f3ec4 100644
|
||||
"crash/crash_helper.cc",
|
||||
"crash/crash_helper.h",
|
||||
]
|
||||
@@ -134,6 +132,7 @@ static_library("crash") {
|
||||
@@ -136,6 +134,7 @@ static_library("crash") {
|
||||
":hook_util",
|
||||
"//base", # This needs to go. DEP of app, crash_keys, client.
|
||||
"//base:base_static", # pe_image
|
||||
@@ -74,7 +74,7 @@ index d0949dc9693e..afe19e4f3ec4 100644
|
||||
"//chrome/install_static:install_static_util",
|
||||
"//components/crash/content/app",
|
||||
"//components/crash/core/common", # crash_keys
|
||||
@@ -141,6 +140,17 @@ static_library("crash") {
|
||||
@@ -143,6 +142,17 @@ static_library("crash") {
|
||||
"//content/public/common:result_codes",
|
||||
"//third_party/crashpad/crashpad/client", # DumpWithoutCrash
|
||||
]
|
||||
@@ -388,10 +388,10 @@ index 485c2c8bf638..7eb175c43b6c 100644
|
||||
|
||||
} // namespace crash_reporter
|
||||
diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc
|
||||
index c6a98292bb5e..7cf360d3b340 100644
|
||||
index 5cf5818c879d..c085c84c8a16 100644
|
||||
--- components/crash/content/app/crashpad.cc
|
||||
+++ components/crash/content/app/crashpad.cc
|
||||
@@ -147,7 +147,8 @@ void InitializeCrashpadImpl(bool initial_client,
|
||||
@@ -149,7 +149,8 @@ void InitializeCrashpadImpl(bool initial_client,
|
||||
// fallback. Forwarding is turned off for debug-mode builds even for the
|
||||
// browser process, because the system's crash reporter can take a very long
|
||||
// time to chew on symbols.
|
||||
@@ -402,7 +402,7 @@ index c6a98292bb5e..7cf360d3b340 100644
|
||||
->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled);
|
||||
}
|
||||
diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm
|
||||
index f06d903c2f41..6ec1442323e9 100644
|
||||
index f079174b3586..ff9a19e259fb 100644
|
||||
--- components/crash/content/app/crashpad_mac.mm
|
||||
+++ components/crash/content/app/crashpad_mac.mm
|
||||
@@ -16,11 +16,14 @@
|
||||
@@ -472,7 +472,7 @@ index f06d903c2f41..6ec1442323e9 100644
|
||||
} // @autoreleasepool
|
||||
return process_annotations;
|
||||
}();
|
||||
@@ -119,9 +139,10 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -122,9 +142,10 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
|
||||
if (initial_client) {
|
||||
@autoreleasepool {
|
||||
@@ -486,7 +486,7 @@ index f06d903c2f41..6ec1442323e9 100644
|
||||
|
||||
// Is there a way to recover if this fails?
|
||||
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
|
||||
@@ -133,7 +154,7 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -136,7 +157,7 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
// crash server won't have symbols for any other build types.
|
||||
std::string url = "https://clients2.google.com/cr/report";
|
||||
#else
|
||||
@@ -495,7 +495,7 @@ index f06d903c2f41..6ec1442323e9 100644
|
||||
#endif
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
@@ -156,6 +177,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -159,6 +180,12 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
"--reset-own-crash-exception-port-to-system-default");
|
||||
}
|
||||
|
||||
@@ -509,7 +509,7 @@ index f06d903c2f41..6ec1442323e9 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 4902d87bd171..a573e9557666 100644
|
||||
index 8b55f0a521f1..d58dcbce5af4 100644
|
||||
--- components/crash/content/app/crashpad_win.cc
|
||||
+++ components/crash/content/app/crashpad_win.cc
|
||||
@@ -34,8 +34,8 @@ void GetPlatformCrashpadAnnotations(
|
||||
@@ -535,7 +535,7 @@ index 4902d87bd171..a573e9557666 100644
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -62,7 +62,9 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -64,7 +64,9 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
base::FilePath metrics_path; // Only valid in the browser process.
|
||||
|
||||
const char kPipeNameVar[] = "CHROME_CRASHPAD_PIPE_NAME";
|
||||
@@ -545,7 +545,7 @@ index 4902d87bd171..a573e9557666 100644
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
if (initial_client) {
|
||||
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
|
||||
@@ -82,13 +84,13 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -84,13 +86,13 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
|
||||
#if defined(GOOGLE_CHROME_BUILD)
|
||||
std::string url = "https://clients2.google.com/cr/report";
|
||||
@@ -562,14 +562,14 @@ index 4902d87bd171..a573e9557666 100644
|
||||
|
||||
base::FilePath exe_file(exe_path);
|
||||
if (exe_file.empty()) {
|
||||
@@ -106,13 +108,14 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -108,13 +110,14 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
crashpad::TriState::kEnabled, kIndirectMemoryLimit);
|
||||
}
|
||||
|
||||
- // If the handler is embedded in the binary (e.g. chrome, setup), we
|
||||
- // reinvoke it with --type=crashpad-handler. Otherwise, we use the
|
||||
- // standalone crashpad_handler.exe (for tests, etc.).
|
||||
std::vector<std::string> start_arguments;
|
||||
std::vector<std::string> start_arguments(initial_arguments);
|
||||
+
|
||||
+ // Always add --type=crashpad-handler because the value is expected by
|
||||
+ // CefExecuteProcess.
|
||||
@@ -582,7 +582,7 @@ index 4902d87bd171..a573e9557666 100644
|
||||
if (!user_data_dir.empty()) {
|
||||
start_arguments.push_back(std::string("--user-data-dir=") +
|
||||
user_data_dir);
|
||||
@@ -123,9 +126,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
|
||||
@@ -125,9 +128,12 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
start_arguments.push_back("/prefetch:7");
|
||||
} else {
|
||||
base::FilePath exe_dir = exe_file.DirName();
|
||||
@@ -597,7 +597,7 @@ index 4902d87bd171..a573e9557666 100644
|
||||
|
||||
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
|
||||
diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc
|
||||
index 85db4c8396c0..717df9763c95 100644
|
||||
index d396b2fc0309..e1451174d705 100644
|
||||
--- content/browser/frame_host/debug_urls.cc
|
||||
+++ content/browser/frame_host/debug_urls.cc
|
||||
@@ -134,7 +134,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
|
||||
|
@@ -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 9accbfe5fa38..513f64ad708a 100644
|
||||
index 4bc8b7d54053..589ed4027224 100644
|
||||
--- third_party/crashpad/crashpad/handler/BUILD.gn
|
||||
+++ third_party/crashpad/crashpad/handler/BUILD.gn
|
||||
@@ -12,6 +12,7 @@
|
||||
@@ -157,12 +157,9 @@ index 9accbfe5fa38..513f64ad708a 100644
|
||||
import("../build/crashpad_buildconfig.gni")
|
||||
|
||||
static_library("handler") {
|
||||
@@ -75,8 +76,20 @@ static_library("handler") {
|
||||
"../third_party/mini_chromium:base",
|
||||
"../tools:tool_support",
|
||||
"../util",
|
||||
+ "//cef/libcef/features",
|
||||
]
|
||||
@@ -65,6 +66,17 @@ static_library("handler") {
|
||||
]
|
||||
}
|
||||
|
||||
+ if (enable_cef) {
|
||||
+ sources += [
|
||||
@@ -175,9 +172,17 @@ index 9accbfe5fa38..513f64ad708a 100644
|
||||
+ configs += [ "//cef/libcef/features:config" ]
|
||||
+ }
|
||||
+
|
||||
public_configs = [ "..:crashpad_config" ]
|
||||
|
||||
public_deps = [
|
||||
@@ -77,6 +89,7 @@ static_library("handler") {
|
||||
"../minidump",
|
||||
"../snapshot",
|
||||
"../tools:tool_support",
|
||||
+ "//cef/libcef/features",
|
||||
]
|
||||
|
||||
if (crashpad_is_win) {
|
||||
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
|
||||
}
|
||||
diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
|
||||
index 205d860f9139..e077a835a19e 100644
|
||||
--- third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
|
||||
index baa7d79aec2e..06bec45c6538 100644
|
||||
index 53a3e878241c..afcd9feb9d6b 100644
|
||||
--- content/browser/devtools/devtools_http_handler.cc
|
||||
+++ content/browser/devtools/devtools_http_handler.cc
|
||||
@@ -569,7 +569,7 @@ void DevToolsHttpHandler::OnJsonRequest(
|
||||
|
@@ -27,10 +27,10 @@ index 9e81f0a33ede..b796e79ae7ef 100644
|
||||
auto* browser_context = web_contents->GetBrowserContext();
|
||||
|
||||
diff --git content/browser/frame_host/render_frame_host_manager.cc content/browser/frame_host/render_frame_host_manager.cc
|
||||
index 69913022bb19..6850ed9cd735 100644
|
||||
index fd7d05e26fa5..2ddb3a8ec86f 100644
|
||||
--- content/browser/frame_host/render_frame_host_manager.cc
|
||||
+++ content/browser/frame_host/render_frame_host_manager.cc
|
||||
@@ -924,10 +924,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
|
||||
@@ -923,10 +923,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
|
||||
// TODO(alexmos): This check should've been enforced earlier in the
|
||||
// navigation, in chrome::Navigate(). Verify this, and then convert this to
|
||||
// a CHECK and remove the fallback.
|
||||
@@ -46,7 +46,7 @@ index 69913022bb19..6850ed9cd735 100644
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1066,7 +1067,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
|
||||
@@ -1065,7 +1066,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
|
||||
|
||||
// Double-check that the new SiteInstance is associated with the right
|
||||
// BrowserContext.
|
||||
@@ -57,10 +57,10 @@ index 69913022bb19..6850ed9cd735 100644
|
||||
// If |new_instance| is a new SiteInstance for a subframe that requires a
|
||||
// dedicated process, set its process reuse policy so that such subframes are
|
||||
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
|
||||
index b33545b865e4..468ba636b05c 100644
|
||||
index ff83421f2bb8..50bf5d594401 100644
|
||||
--- content/public/browser/content_browser_client.h
|
||||
+++ content/public/browser/content_browser_client.h
|
||||
@@ -446,6 +446,13 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -450,6 +450,13 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
// Returns true if error page should be isolated in its own process.
|
||||
virtual bool ShouldIsolateErrorPage(bool in_main_frame);
|
||||
|
||||
@@ -219,7 +219,7 @@ index 5a2533dc788f..b21e25a9af25 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 5be5c1b09b6d..1222df412848 100644
|
||||
index fde870c09c6e..b5a285cecb86 100644
|
||||
--- extensions/browser/process_manager.cc
|
||||
+++ extensions/browser/process_manager.cc
|
||||
@@ -357,9 +357,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
|
||||
|
@@ -27,10 +27,10 @@ index 941d70bd2a7e..ef14a7dd7d4f 100644
|
||||
virtual void OnReflectorChanged();
|
||||
|
||||
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
|
||||
index e8741caf69a8..1f82cc8c1f29 100644
|
||||
index 97d3236bed17..910dbf64a931 100644
|
||||
--- content/browser/compositor/gpu_process_transport_factory.cc
|
||||
+++ content/browser/compositor/gpu_process_transport_factory.cc
|
||||
@@ -208,6 +208,18 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
|
||||
@@ -215,6 +215,18 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
|
||||
task_graph_runner_->Shutdown();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index e8741caf69a8..1f82cc8c1f29 100644
|
||||
std::unique_ptr<viz::SoftwareOutputDevice>
|
||||
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
|
||||
gfx::AcceleratedWidget widget,
|
||||
@@ -492,11 +504,20 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
||||
@@ -482,11 +494,20 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
||||
// surfaces as they are not following the correct mode.
|
||||
DisableGpuCompositing(compositor.get());
|
||||
}
|
||||
@@ -73,7 +73,7 @@ index e8741caf69a8..1f82cc8c1f29 100644
|
||||
} else {
|
||||
DCHECK(context_provider);
|
||||
const auto& capabilities = context_provider->ContextCapabilities();
|
||||
@@ -504,7 +525,8 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
||||
@@ -494,7 +515,8 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
||||
display_output_surface =
|
||||
std::make_unique<OffscreenBrowserCompositorOutputSurface>(
|
||||
context_provider, std::move(vsync_callback),
|
||||
@@ -83,7 +83,7 @@ index e8741caf69a8..1f82cc8c1f29 100644
|
||||
} else if (capabilities.surfaceless) {
|
||||
#if defined(OS_MACOSX)
|
||||
const auto& gpu_feature_info = context_provider->GetGpuFeatureInfo();
|
||||
@@ -946,7 +968,8 @@ GpuProcessTransportFactory::CreatePerCompositorData(
|
||||
@@ -941,7 +963,8 @@ GpuProcessTransportFactory::CreatePerCompositorData(
|
||||
gfx::AcceleratedWidget widget = compositor->widget();
|
||||
|
||||
auto data = std::make_unique<PerCompositorData>();
|
||||
@@ -94,7 +94,7 @@ index e8741caf69a8..1f82cc8c1f29 100644
|
||||
} else {
|
||||
#if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW)
|
||||
diff --git content/browser/compositor/gpu_process_transport_factory.h content/browser/compositor/gpu_process_transport_factory.h
|
||||
index b9f2cf332cd4..59b2d12aa3b0 100644
|
||||
index 5653f31a8797..910de72d1543 100644
|
||||
--- content/browser/compositor/gpu_process_transport_factory.h
|
||||
+++ content/browser/compositor/gpu_process_transport_factory.h
|
||||
@@ -102,6 +102,7 @@ class GpuProcessTransportFactory : public ui::ContextFactory,
|
||||
@@ -351,10 +351,10 @@ index 582388dd576c..103c9374e535 100644
|
||||
base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface>
|
||||
weak_ptr_factory_;
|
||||
diff --git gpu/GLES2/gl2chromium_autogen.h gpu/GLES2/gl2chromium_autogen.h
|
||||
index dc3f820d88da..1f3d09e169ac 100644
|
||||
index 0fafe61704a0..a9bb72f3494b 100644
|
||||
--- gpu/GLES2/gl2chromium_autogen.h
|
||||
+++ gpu/GLES2/gl2chromium_autogen.h
|
||||
@@ -404,6 +404,10 @@
|
||||
@@ -405,6 +405,10 @@
|
||||
GLES2_GET_FUN(CreateClientGpuFenceCHROMIUM)
|
||||
#define glWaitGpuFenceCHROMIUM GLES2_GET_FUN(WaitGpuFenceCHROMIUM)
|
||||
#define glDestroyGpuFenceCHROMIUM GLES2_GET_FUN(DestroyGpuFenceCHROMIUM)
|
||||
@@ -366,10 +366,10 @@ index dc3f820d88da..1f3d09e169ac 100644
|
||||
GLES2_GET_FUN(InvalidateReadbackBufferShadowDataCHROMIUM)
|
||||
#define glFramebufferTextureMultiviewLayeredANGLE \
|
||||
diff --git gpu/command_buffer/build_gles2_cmd_buffer.py gpu/command_buffer/build_gles2_cmd_buffer.py
|
||||
index 70cae33c1387..06e6061cf654 100755
|
||||
index 34e0d4529183..fa6a28461a73 100755
|
||||
--- gpu/command_buffer/build_gles2_cmd_buffer.py
|
||||
+++ gpu/command_buffer/build_gles2_cmd_buffer.py
|
||||
@@ -4062,6 +4062,35 @@ _FUNCTION_INFO = {
|
||||
@@ -4085,6 +4085,35 @@ _FUNCTION_INFO = {
|
||||
'extension': 'CHROMIUM_gpu_fence',
|
||||
'extension_flag': 'chromium_gpu_fence',
|
||||
},
|
||||
@@ -406,10 +406,10 @@ index 70cae33c1387..06e6061cf654 100755
|
||||
'decoder_func': 'DoUnpremultiplyAndDitherCopyCHROMIUM',
|
||||
'cmd_args': 'GLuint source_id, GLuint dest_id, GLint x, GLint y, '
|
||||
diff --git gpu/command_buffer/client/gles2_c_lib_autogen.h gpu/command_buffer/client/gles2_c_lib_autogen.h
|
||||
index 8955befd7d46..0895962dbf70 100644
|
||||
index 74b68fa62a5f..42f7b3216c9d 100644
|
||||
--- gpu/command_buffer/client/gles2_c_lib_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_c_lib_autogen.h
|
||||
@@ -1815,6 +1815,20 @@ void GL_APIENTRY GLES2WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
@@ -1818,6 +1818,20 @@ void GL_APIENTRY GLES2WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
void GL_APIENTRY GLES2DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
gles2::GetGLContext()->DestroyGpuFenceCHROMIUM(gpu_fence_id);
|
||||
}
|
||||
@@ -430,7 +430,7 @@ index 8955befd7d46..0895962dbf70 100644
|
||||
void GL_APIENTRY
|
||||
GLES2InvalidateReadbackBufferShadowDataCHROMIUM(GLuint buffer_id) {
|
||||
gles2::GetGLContext()->InvalidateReadbackBufferShadowDataCHROMIUM(buffer_id);
|
||||
@@ -3196,6 +3210,22 @@ extern const NameToFunc g_gles2_function_table[] = {
|
||||
@@ -3299,6 +3313,22 @@ extern const NameToFunc g_gles2_function_table[] = {
|
||||
"glDestroyGpuFenceCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glDestroyGpuFenceCHROMIUM),
|
||||
},
|
||||
@@ -454,10 +454,10 @@ index 8955befd7d46..0895962dbf70 100644
|
||||
"glInvalidateReadbackBufferShadowDataCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(
|
||||
diff --git gpu/command_buffer/client/gles2_cmd_helper_autogen.h gpu/command_buffer/client/gles2_cmd_helper_autogen.h
|
||||
index b422c3075ae7..1c4b452d1df5 100644
|
||||
index f2da35b038e1..3989691bda6d 100644
|
||||
--- gpu/command_buffer/client/gles2_cmd_helper_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_cmd_helper_autogen.h
|
||||
@@ -3356,6 +3356,42 @@ void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
@@ -3364,6 +3364,42 @@ void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,10 +501,10 @@ index b422c3075ae7..1c4b452d1df5 100644
|
||||
GLint shm_id,
|
||||
GLuint shm_offset,
|
||||
diff --git gpu/command_buffer/client/gles2_implementation.cc gpu/command_buffer/client/gles2_implementation.cc
|
||||
index 65420b9c8bdb..38bb6176100d 100644
|
||||
index 0e1dd204db7d..c5fc6a8a82b6 100644
|
||||
--- gpu/command_buffer/client/gles2_implementation.cc
|
||||
+++ gpu/command_buffer/client/gles2_implementation.cc
|
||||
@@ -7256,6 +7256,22 @@ void GLES2Implementation::Viewport(GLint x,
|
||||
@@ -7286,6 +7286,22 @@ void GLES2Implementation::Viewport(GLint x,
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
@@ -512,13 +512,13 @@ index 65420b9c8bdb..38bb6176100d 100644
|
||||
+ GLsizei width,
|
||||
+ GLsizei height) {
|
||||
+ typedef cmds::CreateSharedTexture::Result Result;
|
||||
+ Result* result = GetResultAs<Result*>();
|
||||
+ auto result = GetResultAs<Result>();
|
||||
+ if (!result) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ *result = 0;
|
||||
+ helper_->CreateSharedTexture(texture_id, width, height, GetResultShmId(),
|
||||
+ GetResultShmOffset());
|
||||
+ result.offset());
|
||||
+
|
||||
+ WaitForCmd();
|
||||
+ return *result;
|
||||
@@ -528,10 +528,10 @@ index 65420b9c8bdb..38bb6176100d 100644
|
||||
GLuint id,
|
||||
uint32_t sync_data_shm_id,
|
||||
diff --git gpu/command_buffer/client/gles2_implementation_autogen.h gpu/command_buffer/client/gles2_implementation_autogen.h
|
||||
index f99c002a599a..767cd62c1b77 100644
|
||||
index b520b91d1398..d9c1a7ec7cf3 100644
|
||||
--- gpu/command_buffer/client/gles2_implementation_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_implementation_autogen.h
|
||||
@@ -1274,6 +1274,16 @@ void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
|
||||
@@ -1276,6 +1276,16 @@ void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
|
||||
|
||||
void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
|
||||
|
||||
@@ -549,10 +549,10 @@ index f99c002a599a..767cd62c1b77 100644
|
||||
|
||||
void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
|
||||
diff --git gpu/command_buffer/client/gles2_implementation_impl_autogen.h gpu/command_buffer/client/gles2_implementation_impl_autogen.h
|
||||
index 68b2e032a189..e78fab69aa01 100644
|
||||
index 45060ce79d7f..d83ce6e78a04 100644
|
||||
--- gpu/command_buffer/client/gles2_implementation_impl_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_implementation_impl_autogen.h
|
||||
@@ -3664,6 +3664,30 @@ void GLES2Implementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
@@ -3675,6 +3675,30 @@ void GLES2Implementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
@@ -584,10 +584,10 @@ index 68b2e032a189..e78fab69aa01 100644
|
||||
GLenum target,
|
||||
GLenum attachment,
|
||||
diff --git gpu/command_buffer/client/gles2_interface_autogen.h gpu/command_buffer/client/gles2_interface_autogen.h
|
||||
index 3e117895a4fc..ac79f035ecdb 100644
|
||||
index 181c4a60d294..4ce350b3633a 100644
|
||||
--- gpu/command_buffer/client/gles2_interface_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_interface_autogen.h
|
||||
@@ -949,6 +949,12 @@ virtual GLuint CreateGpuFenceCHROMIUM() = 0;
|
||||
@@ -950,6 +950,12 @@ virtual GLuint CreateGpuFenceCHROMIUM() = 0;
|
||||
virtual GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) = 0;
|
||||
virtual void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) = 0;
|
||||
virtual void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) = 0;
|
||||
@@ -601,10 +601,10 @@ index 3e117895a4fc..ac79f035ecdb 100644
|
||||
virtual void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
|
||||
GLenum attachment,
|
||||
diff --git gpu/command_buffer/client/gles2_interface_stub_autogen.h gpu/command_buffer/client/gles2_interface_stub_autogen.h
|
||||
index 79f46804f4ff..57235e0e1dde 100644
|
||||
index 3d4833bb8ff0..43074fe25fd8 100644
|
||||
--- gpu/command_buffer/client/gles2_interface_stub_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_interface_stub_autogen.h
|
||||
@@ -919,6 +919,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
|
||||
@@ -920,6 +920,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
|
||||
GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) override;
|
||||
void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
|
||||
void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
|
||||
@@ -618,10 +618,10 @@ index 79f46804f4ff..57235e0e1dde 100644
|
||||
void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
|
||||
GLenum attachment,
|
||||
diff --git gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
|
||||
index c186b690ed0a..8e2d04caaff6 100644
|
||||
index f5ebca07a38f..94a0a254f5ba 100644
|
||||
--- gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
|
||||
@@ -1234,6 +1234,14 @@ GLuint GLES2InterfaceStub::CreateClientGpuFenceCHROMIUM(
|
||||
@@ -1235,6 +1235,14 @@ GLuint GLES2InterfaceStub::CreateClientGpuFenceCHROMIUM(
|
||||
}
|
||||
void GLES2InterfaceStub::WaitGpuFenceCHROMIUM(GLuint /* gpu_fence_id */) {}
|
||||
void GLES2InterfaceStub::DestroyGpuFenceCHROMIUM(GLuint /* gpu_fence_id */) {}
|
||||
@@ -637,10 +637,10 @@ index c186b690ed0a..8e2d04caaff6 100644
|
||||
GLuint /* buffer_id */) {}
|
||||
void GLES2InterfaceStub::FramebufferTextureMultiviewLayeredANGLE(
|
||||
diff --git gpu/command_buffer/client/gles2_trace_implementation_autogen.h gpu/command_buffer/client/gles2_trace_implementation_autogen.h
|
||||
index 916cf238a69e..6228d124f402 100644
|
||||
index caa12933ef3d..60e009ce03b9 100644
|
||||
--- gpu/command_buffer/client/gles2_trace_implementation_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_trace_implementation_autogen.h
|
||||
@@ -919,6 +919,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
|
||||
@@ -920,6 +920,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
|
||||
GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) override;
|
||||
void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
|
||||
void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
|
||||
@@ -654,10 +654,10 @@ index 916cf238a69e..6228d124f402 100644
|
||||
void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
|
||||
GLenum attachment,
|
||||
diff --git gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
|
||||
index 30f99889c379..b6b16f139df4 100644
|
||||
index 6ddd340314ad..3840254d80d7 100644
|
||||
--- gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
|
||||
+++ gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
|
||||
@@ -2632,6 +2632,28 @@ void GLES2TraceImplementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
@@ -2637,6 +2637,28 @@ void GLES2TraceImplementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
|
||||
gl_->DestroyGpuFenceCHROMIUM(gpu_fence_id);
|
||||
}
|
||||
|
||||
@@ -687,10 +687,10 @@ index 30f99889c379..b6b16f139df4 100644
|
||||
GLuint buffer_id) {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0(
|
||||
diff --git gpu/command_buffer/common/gles2_cmd_format_autogen.h gpu/command_buffer/common/gles2_cmd_format_autogen.h
|
||||
index 29c250c4f82f..8255cacba216 100644
|
||||
index 76ee6074b51a..1644f27a20d6 100644
|
||||
--- gpu/command_buffer/common/gles2_cmd_format_autogen.h
|
||||
+++ gpu/command_buffer/common/gles2_cmd_format_autogen.h
|
||||
@@ -16533,6 +16533,193 @@ static_assert(offsetof(DestroyGpuFenceCHROMIUM, header) == 0,
|
||||
@@ -16576,6 +16576,193 @@ static_assert(offsetof(DestroyGpuFenceCHROMIUM, header) == 0,
|
||||
static_assert(offsetof(DestroyGpuFenceCHROMIUM, gpu_fence_id) == 4,
|
||||
"offset of DestroyGpuFenceCHROMIUM gpu_fence_id should be 4");
|
||||
|
||||
@@ -885,10 +885,10 @@ index 29c250c4f82f..8255cacba216 100644
|
||||
typedef SetReadbackBufferShadowAllocationINTERNAL ValueType;
|
||||
static const CommandId kCmdId = kSetReadbackBufferShadowAllocationINTERNAL;
|
||||
diff --git gpu/command_buffer/common/gles2_cmd_format_test_autogen.h gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
|
||||
index ad5eec73afb5..a014852dac6d 100644
|
||||
index 52f445fe307f..97edefaffa39 100644
|
||||
--- gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
|
||||
+++ gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
|
||||
@@ -5472,6 +5472,52 @@ TEST_F(GLES2FormatTest, DestroyGpuFenceCHROMIUM) {
|
||||
@@ -5514,6 +5514,52 @@ TEST_F(GLES2FormatTest, DestroyGpuFenceCHROMIUM) {
|
||||
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
|
||||
}
|
||||
|
||||
@@ -942,31 +942,27 @@ index ad5eec73afb5..a014852dac6d 100644
|
||||
cmds::SetReadbackBufferShadowAllocationINTERNAL& cmd =
|
||||
*GetBufferAs<cmds::SetReadbackBufferShadowAllocationINTERNAL>();
|
||||
diff --git gpu/command_buffer/common/gles2_cmd_ids_autogen.h gpu/command_buffer/common/gles2_cmd_ids_autogen.h
|
||||
index 5d8a91314bc9..fab65ac82ea2 100644
|
||||
index 753b9c309604..6958e6c5cd00 100644
|
||||
--- gpu/command_buffer/common/gles2_cmd_ids_autogen.h
|
||||
+++ gpu/command_buffer/common/gles2_cmd_ids_autogen.h
|
||||
@@ -345,9 +345,13 @@
|
||||
OP(CreateGpuFenceINTERNAL) /* 586 */ \
|
||||
OP(WaitGpuFenceCHROMIUM) /* 587 */ \
|
||||
OP(DestroyGpuFenceCHROMIUM) /* 588 */ \
|
||||
- OP(SetReadbackBufferShadowAllocationINTERNAL) /* 589 */ \
|
||||
- OP(FramebufferTextureMultiviewLayeredANGLE) /* 590 */ \
|
||||
- OP(MaxShaderCompilerThreadsKHR) /* 591 */
|
||||
+ OP(CreateSharedTexture) /* 589 */ \
|
||||
+ OP(LockSharedTexture) /* 590 */ \
|
||||
+ OP(UnlockSharedTexture) /* 591 */ \
|
||||
+ OP(DeleteSharedTexture) /* 592 */ \
|
||||
+ OP(SetReadbackBufferShadowAllocationINTERNAL) /* 593 */ \
|
||||
+ OP(FramebufferTextureMultiviewLayeredANGLE) /* 594 */ \
|
||||
+ OP(MaxShaderCompilerThreadsKHR) /* 595 */
|
||||
@@ -351,7 +351,11 @@
|
||||
OP(MaxShaderCompilerThreadsKHR) /* 592 */ \
|
||||
OP(CreateAndTexStorage2DSharedImageINTERNALImmediate) /* 593 */ \
|
||||
OP(BeginSharedImageAccessDirectCHROMIUM) /* 594 */ \
|
||||
- OP(EndSharedImageAccessDirectCHROMIUM) /* 595 */
|
||||
+ OP(EndSharedImageAccessDirectCHROMIUM) /* 595 */ \
|
||||
+ OP(CreateSharedTexture) /* 596 */ \
|
||||
+ OP(LockSharedTexture) /* 597 */ \
|
||||
+ OP(UnlockSharedTexture) /* 598 */ \
|
||||
+ OP(DeleteSharedTexture) /* 599 */
|
||||
|
||||
enum CommandId {
|
||||
kOneBeforeStartPoint =
|
||||
diff --git gpu/command_buffer/gles2_cmd_buffer_functions.txt gpu/command_buffer/gles2_cmd_buffer_functions.txt
|
||||
index fcac46f25274..cb39feed2c16 100644
|
||||
index 7a14db0357ad..89258f5ec0dd 100644
|
||||
--- gpu/command_buffer/gles2_cmd_buffer_functions.txt
|
||||
+++ gpu/command_buffer/gles2_cmd_buffer_functions.txt
|
||||
@@ -395,6 +395,12 @@ GL_APICALL GLuint GL_APIENTRY glCreateClientGpuFenceCHROMIUM (ClientGpuFen
|
||||
@@ -396,6 +396,12 @@ GL_APICALL GLuint GL_APIENTRY glCreateClientGpuFenceCHROMIUM (ClientGpuFen
|
||||
GL_APICALL void GL_APIENTRY glWaitGpuFenceCHROMIUM (GLuint gpu_fence_id);
|
||||
GL_APICALL void GL_APIENTRY glDestroyGpuFenceCHROMIUM (GLuint gpu_fence_id);
|
||||
|
||||
@@ -980,10 +976,10 @@ index fcac46f25274..cb39feed2c16 100644
|
||||
GL_APICALL void GL_APIENTRY glInvalidateReadbackBufferShadowDataCHROMIUM (GLidBuffer buffer_id);
|
||||
// (used for CHROMIUM_nonblocking_readback implementation)
|
||||
diff --git gpu/command_buffer/service/BUILD.gn gpu/command_buffer/service/BUILD.gn
|
||||
index 6e83a5675fc3..330107d93f03 100644
|
||||
index 73f1cd7a60af..2bde69b3842b 100644
|
||||
--- gpu/command_buffer/service/BUILD.gn
|
||||
+++ gpu/command_buffer/service/BUILD.gn
|
||||
@@ -105,6 +105,8 @@ target(link_target_type, "gles2_sources") {
|
||||
@@ -106,6 +106,8 @@ target(link_target_type, "gles2_sources") {
|
||||
visibility = [ "//gpu/*" ]
|
||||
|
||||
sources = [
|
||||
@@ -993,7 +989,7 @@ index 6e83a5675fc3..330107d93f03 100644
|
||||
"buffer_manager.cc",
|
||||
"buffer_manager.h",
|
||||
diff --git gpu/command_buffer/service/gles2_cmd_decoder.cc gpu/command_buffer/service/gles2_cmd_decoder.cc
|
||||
index 3cb45cc5b191..f17002799aa6 100644
|
||||
index 4ebebc0ffb74..a99b3065c251 100644
|
||||
--- gpu/command_buffer/service/gles2_cmd_decoder.cc
|
||||
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc
|
||||
@@ -34,6 +34,7 @@
|
||||
@@ -1004,7 +1000,7 @@ index 3cb45cc5b191..f17002799aa6 100644
|
||||
#include "gpu/command_buffer/common/debug_marker_manager.h"
|
||||
#include "gpu/command_buffer/common/gles2_cmd_format.h"
|
||||
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
|
||||
@@ -857,6 +858,13 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
||||
@@ -888,6 +889,13 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
||||
return group_->mailbox_manager();
|
||||
}
|
||||
|
||||
@@ -1018,7 +1014,7 @@ index 3cb45cc5b191..f17002799aa6 100644
|
||||
ImageManager* image_manager() { return group_->image_manager(); }
|
||||
|
||||
VertexArrayManager* vertex_array_manager() {
|
||||
@@ -2497,6 +2505,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
||||
@@ -2533,6 +2541,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
||||
|
||||
std::unique_ptr<VertexArrayManager> vertex_array_manager_;
|
||||
|
||||
@@ -1027,7 +1023,7 @@ index 3cb45cc5b191..f17002799aa6 100644
|
||||
base::flat_set<scoped_refptr<Buffer>> writes_submitted_but_not_completed_;
|
||||
|
||||
// The format of the back buffer_
|
||||
@@ -5353,6 +5363,59 @@ error::Error GLES2DecoderImpl::HandleDestroyGpuFenceCHROMIUM(
|
||||
@@ -5437,6 +5447,59 @@ error::Error GLES2DecoderImpl::HandleDestroyGpuFenceCHROMIUM(
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
@@ -1088,7 +1084,7 @@ index 3cb45cc5b191..f17002799aa6 100644
|
||||
for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end();
|
||||
++it) {
|
||||
diff --git gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
index e4b21a6a1388..c446c9ef3297 100644
|
||||
index b363a2f5849d..5e5404dfb1af 100644
|
||||
--- gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
+++ gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
@@ -1099,7 +1095,7 @@ index e4b21a6a1388..c446c9ef3297 100644
|
||||
#include "gpu/command_buffer/service/command_buffer_service.h"
|
||||
#include "gpu/command_buffer/service/decoder_client.h"
|
||||
#include "gpu/command_buffer/service/feature_info.h"
|
||||
@@ -2275,6 +2276,67 @@ error::Error GLES2DecoderPassthroughImpl::CheckSwapBuffersResult(
|
||||
@@ -2478,6 +2479,67 @@ error::Error GLES2DecoderPassthroughImpl::CheckSwapBuffersResult(
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
@@ -1168,10 +1164,10 @@ index e4b21a6a1388..c446c9ef3297 100644
|
||||
GLES2DecoderPassthroughImpl::TextureTarget
|
||||
GLES2DecoderPassthroughImpl::GLenumToTextureTarget(GLenum target) {
|
||||
diff --git gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
|
||||
index 325918d2264a..cdb97f7dc914 100644
|
||||
index 0a36589dc65d..d5f1732353b6 100644
|
||||
--- gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
|
||||
+++ gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
|
||||
@@ -42,6 +42,7 @@ namespace gpu {
|
||||
@@ -45,6 +45,7 @@ class SharedImageRepresentationGLTexturePassthrough;
|
||||
namespace gles2 {
|
||||
|
||||
class ContextGroup;
|
||||
@@ -1179,7 +1175,7 @@ index 325918d2264a..cdb97f7dc914 100644
|
||||
class GPUTracer;
|
||||
class PassthroughAbstractTextureImpl;
|
||||
|
||||
@@ -361,6 +362,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {
|
||||
@@ -374,6 +375,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {
|
||||
|
||||
void SetOptionalExtensionsRequestedForTesting(bool request_extensions);
|
||||
|
||||
@@ -1188,7 +1184,7 @@ index 325918d2264a..cdb97f7dc914 100644
|
||||
void* GetScratchMemory(size_t size);
|
||||
|
||||
template <typename T>
|
||||
@@ -554,6 +557,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {
|
||||
@@ -575,6 +578,8 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl : public GLES2Decoder {
|
||||
|
||||
std::unique_ptr<GpuFenceManager> gpu_fence_manager_;
|
||||
|
||||
@@ -1198,10 +1194,10 @@ index 325918d2264a..cdb97f7dc914 100644
|
||||
size_t active_texture_unit_;
|
||||
|
||||
diff --git ui/compositor/compositor.cc ui/compositor/compositor.cc
|
||||
index 8ae7efefd62c..9b89edf36be5 100644
|
||||
index 5358941075a4..5ffd2284c437 100644
|
||||
--- ui/compositor/compositor.cc
|
||||
+++ ui/compositor/compositor.cc
|
||||
@@ -540,6 +540,16 @@ void Compositor::OnNeedsExternalBeginFrames(bool needs_begin_frames) {
|
||||
@@ -535,6 +535,16 @@ void Compositor::OnNeedsExternalBeginFrames(bool needs_begin_frames) {
|
||||
needs_external_begin_frames_ = needs_begin_frames;
|
||||
}
|
||||
|
||||
@@ -1219,7 +1215,7 @@ index 8ae7efefd62c..9b89edf36be5 100644
|
||||
observer_list_.AddObserver(observer);
|
||||
}
|
||||
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
|
||||
index b3905bdfa650..dc984321f2b8 100644
|
||||
index 6f46fd5b4b57..f3508ecb257f 100644
|
||||
--- ui/compositor/compositor.h
|
||||
+++ ui/compositor/compositor.h
|
||||
@@ -26,6 +26,7 @@
|
||||
@@ -1230,7 +1226,7 @@ index b3905bdfa650..dc984321f2b8 100644
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "third_party/skia/include/core/SkMatrix44.h"
|
||||
#include "ui/compositor/compositor_animation_observer.h"
|
||||
@@ -160,6 +161,8 @@ class COMPOSITOR_EXPORT ContextFactoryPrivate {
|
||||
@@ -159,6 +160,8 @@ class COMPOSITOR_EXPORT ContextFactoryPrivate {
|
||||
const viz::BeginFrameArgs& args) = 0;
|
||||
|
||||
virtual void SetOutputIsSecure(Compositor* compositor, bool secure) = 0;
|
||||
@@ -1239,7 +1235,7 @@ index b3905bdfa650..dc984321f2b8 100644
|
||||
};
|
||||
|
||||
// This class abstracts the creation of the 3D context for the compositor. It is
|
||||
@@ -198,6 +201,17 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
@@ -194,6 +197,17 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
virtual bool SyncTokensRequiredForDisplayCompositor() = 0;
|
||||
};
|
||||
|
||||
@@ -1257,7 +1253,7 @@ index b3905bdfa650..dc984321f2b8 100644
|
||||
// Compositor object to take care of GPU painting.
|
||||
// A Browser compositor object is responsible for generating the final
|
||||
// displayable form of pixels comprising a single widget's contents. It draws an
|
||||
@@ -237,6 +251,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
@@ -235,6 +249,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
@@ -1267,7 +1263,7 @@ index b3905bdfa650..dc984321f2b8 100644
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -348,6 +365,10 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
@@ -347,6 +364,10 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
return task_runner_;
|
||||
}
|
||||
|
||||
@@ -1287,7 +1283,7 @@ index b3905bdfa650..dc984321f2b8 100644
|
||||
// The root of the Layer tree drawn by this compositor.
|
||||
Layer* root_layer_ = nullptr;
|
||||
|
||||
@@ -486,6 +509,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
@@ -484,6 +507,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
ExternalBeginFrameClient* external_begin_frame_client_ = nullptr;
|
||||
bool needs_external_begin_frames_ = false;
|
||||
|
||||
@@ -1297,10 +1293,10 @@ index b3905bdfa650..dc984321f2b8 100644
|
||||
|
||||
// The device scale factor of the monitor that this compositor is compositing
|
||||
diff --git ui/compositor/host/host_context_factory_private.cc ui/compositor/host/host_context_factory_private.cc
|
||||
index 952525b7f823..871379326bc2 100644
|
||||
index e16c5490bbcb..b4297261c397 100644
|
||||
--- ui/compositor/host/host_context_factory_private.cc
|
||||
+++ ui/compositor/host/host_context_factory_private.cc
|
||||
@@ -245,6 +245,10 @@ void HostContextFactoryPrivate::SetOutputIsSecure(Compositor* compositor,
|
||||
@@ -248,6 +248,10 @@ void HostContextFactoryPrivate::SetOutputIsSecure(Compositor* compositor,
|
||||
iter->second.display_private->SetOutputIsSecure(secure);
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git .gn .gn
|
||||
index 2ae9ab394481..2ff59eb3a2ef 100644
|
||||
index 6f2772973179..34099faa8a27 100644
|
||||
--- .gn
|
||||
+++ .gn
|
||||
@@ -411,6 +411,8 @@ exec_script_whitelist =
|
||||
@@ -677,6 +677,8 @@ exec_script_whitelist =
|
||||
# in the Chromium repo outside of //build.
|
||||
"//build_overrides/build.gni",
|
||||
|
||||
@@ -12,10 +12,10 @@ index 2ae9ab394481..2ff59eb3a2ef 100644
|
||||
# https://crbug.com/474506.
|
||||
"//clank/java/BUILD.gn",
|
||||
diff --git BUILD.gn BUILD.gn
|
||||
index 4283a4f9fce3..b74a2b78f282 100644
|
||||
index dbe4b22ba39a..1cd9399196a7 100644
|
||||
--- BUILD.gn
|
||||
+++ BUILD.gn
|
||||
@@ -186,6 +186,7 @@ group("gn_all") {
|
||||
@@ -185,6 +185,7 @@ group("gn_all") {
|
||||
|
||||
if (!is_ios && !is_fuchsia) {
|
||||
deps += [
|
||||
@@ -56,27 +56,27 @@ index 982fbe8d3f0d..e757be4688f1 100644
|
||||
+ "studio path")
|
||||
}
|
||||
diff --git build/toolchain/win/BUILD.gn build/toolchain/win/BUILD.gn
|
||||
index 3c6c9d05d2c8..d475747fa12d 100644
|
||||
index 07319b798998..27118d68d109 100644
|
||||
--- build/toolchain/win/BUILD.gn
|
||||
+++ build/toolchain/win/BUILD.gn
|
||||
@@ -6,6 +6,7 @@ import("//build/config/clang/clang.gni")
|
||||
import("//build/config/compiler/compiler.gni")
|
||||
@@ -7,6 +7,7 @@ import("//build/config/compiler/compiler.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("//build/config/win/visual_studio_version.gni")
|
||||
import("//build/toolchain/cc_wrapper.gni")
|
||||
+import("//build/toolchain/cc_wrapper.gni")
|
||||
import("//build/toolchain/clang_static_analyzer.gni")
|
||||
import("//build/toolchain/goma.gni")
|
||||
import("//build/toolchain/toolchain.gni")
|
||||
@@ -28,6 +29,8 @@ if (use_goma) {
|
||||
} else {
|
||||
@@ -30,6 +31,8 @@ if (use_goma) {
|
||||
goma_prefix = "$goma_dir/gomacc "
|
||||
}
|
||||
clang_prefix = goma_prefix
|
||||
+} else if (cc_wrapper != "") {
|
||||
+ goma_prefix = "$cc_wrapper "
|
||||
} else {
|
||||
goma_prefix = ""
|
||||
}
|
||||
@@ -108,7 +111,7 @@ template("msvc_toolchain") {
|
||||
if (cc_wrapper != "") {
|
||||
@@ -121,7 +124,7 @@ template("msvc_toolchain") {
|
||||
|
||||
# lld-link includes a replacement for lib.exe that can produce thin
|
||||
# archives and understands bitcode (for lto builds).
|
||||
@@ -86,16 +86,17 @@ index 3c6c9d05d2c8..d475747fa12d 100644
|
||||
if (host_os != "win") {
|
||||
# See comment adding --rsp-quoting to $cl above for more information.
|
||||
diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py
|
||||
index 1ba5533c3efb..abfd55a2c703 100644
|
||||
index 2c8675206f31..d3e419d8fe98 100644
|
||||
--- build/toolchain/win/setup_toolchain.py
|
||||
+++ build/toolchain/win/setup_toolchain.py
|
||||
@@ -134,25 +134,28 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store):
|
||||
@@ -134,22 +134,25 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store):
|
||||
# variable.
|
||||
if 'VSINSTALLDIR' in os.environ:
|
||||
del os.environ['VSINSTALLDIR']
|
||||
- other_path = os.path.normpath(os.path.join(
|
||||
- os.environ['GYP_MSVS_OVERRIDE_PATH'],
|
||||
- 'VC/Auxiliary/Build/vcvarsall.bat'))
|
||||
+ script_path = os.path.normpath(os.path.join(
|
||||
os.environ['GYP_MSVS_OVERRIDE_PATH'],
|
||||
'VC/Auxiliary/Build/vcvarsall.bat'))
|
||||
- if not os.path.exists(other_path):
|
||||
- raise Exception('%s is missing - make sure VC++ tools are installed.' %
|
||||
- script_path)
|
||||
@@ -108,13 +109,7 @@ index 1ba5533c3efb..abfd55a2c703 100644
|
||||
- # Store target must come before any SDK version declaration
|
||||
- if (target_store):
|
||||
- args.append(['store'])
|
||||
- # Chromium requires the 10.0.17134.0 SDK - previous versions don't have
|
||||
- # all of the required declarations.
|
||||
- args.append('10.0.17134.0')
|
||||
- variables = _LoadEnvFromBat(args)
|
||||
+ script_path = os.path.normpath(os.path.join(
|
||||
+ os.environ['GYP_MSVS_OVERRIDE_PATH'],
|
||||
+ 'VC/Auxiliary/Build/vcvarsall.bat'))
|
||||
+ if os.path.exists(script_path):
|
||||
+ cpu_arg = "amd64"
|
||||
+ if (cpu != 'x64'):
|
||||
@@ -124,9 +119,6 @@ index 1ba5533c3efb..abfd55a2c703 100644
|
||||
+ # Store target must come before any SDK version declaration
|
||||
+ if (target_store):
|
||||
+ args.append(['store'])
|
||||
+ # Chromium requires the 10.0.17134.0 SDK - previous versions don't have
|
||||
+ # all of the required declarations.
|
||||
+ args.append('10.0.17134.0')
|
||||
+ variables = _LoadEnvFromBat(args)
|
||||
+ else:
|
||||
+ variables = []
|
||||
@@ -138,10 +130,10 @@ index 1ba5533c3efb..abfd55a2c703 100644
|
||||
|
||||
|
||||
diff --git build/vs_toolchain.py build/vs_toolchain.py
|
||||
index 32bad7f469bd..dcee84f71e5f 100755
|
||||
index e613b88e5351..3f1d4f06f36a 100755
|
||||
--- build/vs_toolchain.py
|
||||
+++ build/vs_toolchain.py
|
||||
@@ -65,11 +65,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
|
||||
@@ -73,11 +73,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
|
||||
runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs)
|
||||
os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH']
|
||||
elif sys.platform == 'win32' and not depot_tools_win_toolchain:
|
||||
@@ -161,10 +153,10 @@ index 32bad7f469bd..dcee84f71e5f 100755
|
||||
# directory in order to run binaries locally, but they are needed in order
|
||||
# to create isolates or the mini_installer. Copying them to the output
|
||||
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
|
||||
index 8b3d1652ae28..9d69220d85df 100644
|
||||
index 8f2e40286155..42bb53db9aa8 100644
|
||||
--- chrome/chrome_paks.gni
|
||||
+++ chrome/chrome_paks.gni
|
||||
@@ -259,7 +259,7 @@ template("chrome_paks") {
|
||||
@@ -263,7 +263,7 @@ template("chrome_paks") {
|
||||
}
|
||||
|
||||
input_locales = locales
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user