Update to Chromium revision ad51088c (#444943)

This commit is contained in:
Marshall Greenblatt
2017-01-23 12:36:54 -05:00
parent 9d48a4f80e
commit b7b145fa4f
117 changed files with 1261 additions and 1254 deletions

View File

@ -634,13 +634,14 @@ static_library("libcef_static") {
"//media/blink", "//media/blink",
"//net", "//net",
"//net:net_browser_services", "//net:net_browser_services",
"//net:net_utility_services",
"//net:net_with_v8", "//net:net_with_v8",
"//pdf", "//pdf",
"//ppapi/features", "//ppapi/features",
"//printing/features", "//printing/features",
"//skia", "//skia",
"//storage/browser", "//storage/browser",
"//third_party/brotli", "//third_party/brotli:dec",
"//third_party/cld", "//third_party/cld",
"//third_party/hunspell", "//third_party/hunspell",
"//third_party/leveldatabase", "//third_party/leveldatabase",

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': '3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a', 'chromium_checkout': 'ad51088c0e8776e8dcd963dbe752c4035ba6dab6',
} }

View File

@ -87,20 +87,30 @@ typedef struct _cef_scheme_registrar_t {
// is. For example, "scheme:///some%20text" will remain the same. Non-standard // is. For example, "scheme:///some%20text" will remain the same. Non-standard
// scheme URLs cannot be used as a target for form submission. // scheme URLs cannot be used as a target for form submission.
// //
// If |is_local| is true (1) the scheme will be treated as local (i.e., with // If |is_local| is true (1) the scheme will be treated with the same security
// the same security rules as those applied to "file" URLs). Normal pages // rules as those applied to "file" URLs. Normal pages cannot link to or
// cannot link to or access local URLs. Also, by default, local URLs can only // access local URLs. Also, by default, local URLs can only perform
// perform XMLHttpRequest calls to the same URL (origin + path) that // XMLHttpRequest calls to the same URL (origin + path) that originated the
// originated the request. To allow XMLHttpRequest calls from a local URL to // request. To allow XMLHttpRequest calls from a local URL to other URLs with
// other URLs with the same origin set the // the same origin set the CefSettings.file_access_from_file_urls_allowed
// CefSettings.file_access_from_file_urls_allowed value to true (1). To allow // value to true (1). To allow XMLHttpRequest calls from a local URL to all
// XMLHttpRequest calls from a local URL to all origins set the // origins set the CefSettings.universal_access_from_file_urls_allowed value
// CefSettings.universal_access_from_file_urls_allowed value to true (1). // to true (1).
// //
// If |is_display_isolated| is true (1) the scheme will be treated as display- // If |is_display_isolated| is true (1) the scheme can only be displayed from
// isolated. This means that pages cannot display these URLs unless they are // other content hosted with the same scheme. For example, pages in other
// from the same scheme. For example, pages in another origin cannot create // origins cannot create iframes or hyperlinks to URLs with the scheme. For
// iframes or hyperlinks to URLs with this scheme. // schemes that must be accessible from other schemes set this value to false
// (0), set |is_cors_enabled| to true (1), and use CORS "Access-Control-Allow-
// Origin" headers to further restrict access.
//
// If |is_secure| is true (1) the scheme will be treated with the same
// security rules as those applied to "https" URLs. For example, loading this
// scheme from other secure schemes will not trigger mixed content warnings.
//
// If |is_cors_enabled| is true (1) the scheme that can be sent CORS requests.
// This value should be true (1) in most cases where |is_standard| is true
// (1).
// //
// This function may be called on any thread. It should only be called once // This function may be called on any thread. It should only be called once
// per unique |scheme_name| value. If |scheme_name| is already registered or // per unique |scheme_name| value. If |scheme_name| is already registered or
@ -108,7 +118,7 @@ typedef struct _cef_scheme_registrar_t {
/// ///
int (CEF_CALLBACK *add_custom_scheme)(struct _cef_scheme_registrar_t* self, int (CEF_CALLBACK *add_custom_scheme)(struct _cef_scheme_registrar_t* self,
const cef_string_t* scheme_name, int is_standard, int is_local, const cef_string_t* scheme_name, int is_standard, int is_local,
int is_display_isolated); int is_display_isolated, int is_secure, int is_cors_enabled);
} cef_scheme_registrar_t; } cef_scheme_registrar_t;

View File

@ -111,9 +111,9 @@ class CefSchemeRegistrar : public virtual CefBase {
// as-is. For example, "scheme:///some%20text" will remain the same. // as-is. For example, "scheme:///some%20text" will remain the same.
// Non-standard scheme URLs cannot be used as a target for form submission. // Non-standard scheme URLs cannot be used as a target for form submission.
// //
// If |is_local| is true the scheme will be treated as local (i.e., with the // If |is_local| is true the scheme will be treated with the same security
// same security rules as those applied to "file" URLs). Normal pages cannot // rules as those applied to "file" URLs. Normal pages cannot link to or
// link to or access local URLs. Also, by default, local URLs can only perform // access local URLs. Also, by default, local URLs can only perform
// XMLHttpRequest calls to the same URL (origin + path) that originated the // XMLHttpRequest calls to the same URL (origin + path) that originated the
// request. To allow XMLHttpRequest calls from a local URL to other URLs with // request. To allow XMLHttpRequest calls from a local URL to other URLs with
// the same origin set the CefSettings.file_access_from_file_urls_allowed // the same origin set the CefSettings.file_access_from_file_urls_allowed
@ -121,10 +121,19 @@ class CefSchemeRegistrar : public virtual CefBase {
// origins set the CefSettings.universal_access_from_file_urls_allowed value // origins set the CefSettings.universal_access_from_file_urls_allowed value
// to true. // to true.
// //
// If |is_display_isolated| is true the scheme will be treated as display- // If |is_display_isolated| is true the scheme can only be displayed from
// isolated. This means that pages cannot display these URLs unless they are // other content hosted with the same scheme. For example, pages in other
// from the same scheme. For example, pages in another origin cannot create // origins cannot create iframes or hyperlinks to URLs with the scheme. For
// iframes or hyperlinks to URLs with this scheme. // schemes that must be accessible from other schemes set this value to false,
// set |is_cors_enabled| to true, and use CORS "Access-Control-Allow-Origin"
// headers to further restrict access.
//
// If |is_secure| is true the scheme will be treated with the same security
// rules as those applied to "https" URLs. For example, loading this scheme
// from other secure schemes will not trigger mixed content warnings.
//
// If |is_cors_enabled| is true the scheme that can be sent CORS requests.
// This value should be true in most cases where |is_standard| is true.
// //
// This function may be called on any thread. It should only be called once // This function may be called on any thread. It should only be called once
// per unique |scheme_name| value. If |scheme_name| is already registered or // per unique |scheme_name| value. If |scheme_name| is already registered or
@ -134,7 +143,9 @@ class CefSchemeRegistrar : public virtual CefBase {
virtual bool AddCustomScheme(const CefString& scheme_name, virtual bool AddCustomScheme(const CefString& scheme_name,
bool is_standard, bool is_standard,
bool is_local, bool is_local,
bool is_display_isolated) =0; bool is_display_isolated,
bool is_secure,
bool is_cors_enabled) =0;
}; };

View File

@ -62,6 +62,7 @@
#include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host.h"
#include "content/public/browser/resource_request_info.h" #include "content/public/browser/resource_request_info.h"
#include "third_party/WebKit/public/web/WebFindOptions.h" #include "third_party/WebKit/public/web/WebFindOptions.h"
#include "ui/events/base_event_utils.h"
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "components/spellcheck/browser/spellcheck_platform.h" #include "components/spellcheck/browser/spellcheck_platform.h"
@ -1035,7 +1036,10 @@ void CefBrowserHostImpl::SendKeyEvent(const CefKeyEvent& event) {
if (!web_contents() || !platform_delegate_) if (!web_contents() || !platform_delegate_)
return; return;
content::NativeWebKeyboardEvent web_event; content::NativeWebKeyboardEvent web_event(
blink::WebInputEvent::Undefined,
blink::WebInputEvent::NoModifiers,
ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
platform_delegate_->TranslateKeyEvent(web_event, event); platform_delegate_->TranslateKeyEvent(web_event, event);
platform_delegate_->SendKeyEvent(web_event); platform_delegate_->SendKeyEvent(web_event);
} }
@ -1214,7 +1218,7 @@ void CefBrowserHostImpl::Reload() {
} }
if (web_contents_.get()) if (web_contents_.get())
web_contents_->GetController().Reload(true); web_contents_->GetController().Reload(content::ReloadType::NORMAL, true);
} else { } else {
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::Reload, this)); base::Bind(&CefBrowserHostImpl::Reload, this));
@ -1230,8 +1234,10 @@ void CefBrowserHostImpl::ReloadIgnoreCache() {
return; return;
} }
if (web_contents_.get()) if (web_contents_.get()) {
web_contents_->GetController().ReloadBypassingCache(true); web_contents_->GetController().Reload(
content::ReloadType::BYPASSING_CACHE, true);
}
} else { } else {
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this)); base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this));
@ -2235,10 +2241,12 @@ bool CefBrowserHostImpl::CanDragEnter(
bool CefBrowserHostImpl::ShouldCreateWebContents( bool CefBrowserHostImpl::ShouldCreateWebContents(
content::WebContents* web_contents, content::WebContents* web_contents,
int route_id, content::SiteInstance* source_site_instance,
int main_frame_route_id, int32_t route_id,
int32_t main_frame_route_id,
int32_t main_frame_widget_route_id, int32_t main_frame_widget_route_id,
WindowContainerType window_container_type, WindowContainerType window_container_type,
const GURL& opener_url,
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,

View File

@ -404,10 +404,12 @@ class CefBrowserHostImpl : public CefBrowserHost,
blink::WebDragOperationsMask operations_allowed) override; blink::WebDragOperationsMask operations_allowed) override;
bool ShouldCreateWebContents( bool ShouldCreateWebContents(
content::WebContents* web_contents, content::WebContents* web_contents,
int route_id, content::SiteInstance* source_site_instance,
int main_frame_route_id, int32_t route_id,
int32_t main_frame_route_id,
int32_t main_frame_widget_route_id, int32_t main_frame_widget_route_id,
WindowContainerType window_container_type, WindowContainerType window_container_type,
const GURL& opener_url,
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,

View File

@ -145,17 +145,16 @@ bool CefBrowserInfoManager::CanCreateWindow(
const blink::WebWindowFeatures& features, const blink::WebWindowFeatures& features,
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
int render_process_id, int opener_render_process_id,
int opener_render_view_id,
int opener_render_frame_id, int opener_render_frame_id,
bool* no_javascript_access) { bool* no_javascript_access) {
DCHECK_NE(render_process_id, content::ChildProcessHost::kInvalidUniqueID); DCHECK_NE(opener_render_process_id,
DCHECK_GT(opener_render_view_id, 0); content::ChildProcessHost::kInvalidUniqueID);
DCHECK_GT(opener_render_frame_id, 0); DCHECK_GT(opener_render_frame_id, 0);
bool is_guest_view = false; bool is_guest_view = false;
CefRefPtr<CefBrowserHostImpl> browser = extensions::GetOwnerBrowserForView( CefRefPtr<CefBrowserHostImpl> browser = extensions::GetOwnerBrowserForFrame(
render_process_id, opener_render_view_id, &is_guest_view); opener_render_process_id, opener_render_frame_id, &is_guest_view);
DCHECK(browser.get()); DCHECK(browser.get());
if (!browser.get()) { if (!browser.get()) {
// Cancel the popup. // Cancel the popup.
@ -190,8 +189,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
auto pending_popup = base::MakeUnique<CefBrowserInfoManager::PendingPopup>(); auto pending_popup = base::MakeUnique<CefBrowserInfoManager::PendingPopup>();
pending_popup->step = CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW; pending_popup->step = CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
pending_popup->opener_process_id = render_process_id; pending_popup->opener_process_id = opener_render_process_id;
pending_popup->opener_view_id = opener_render_view_id;
pending_popup->opener_frame_id = opener_render_frame_id; pending_popup->opener_frame_id = opener_render_frame_id;
pending_popup->target_url = target_url; pending_popup->target_url = target_url;
pending_popup->target_frame_name = frame_name; pending_popup->target_frame_name = frame_name;
@ -250,7 +248,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
// Filtering needs to be done on the UI thread. // Filtering needs to be done on the UI thread.
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
base::Bind(FilterPendingPopupURL, render_process_id, base::Bind(FilterPendingPopupURL, opener_render_process_id,
base::Passed(&pending_popup))); base::Passed(&pending_popup)));
} }
@ -262,10 +260,11 @@ void CefBrowserInfoManager::ShouldCreateWebContents(
const GURL& target_url, const GURL& target_url,
content::WebContentsView** view, content::WebContentsView** view,
content::RenderViewHostDelegateView** delegate_view) { content::RenderViewHostDelegateView** delegate_view) {
content::RenderFrameHost* host =
web_contents->GetRenderViewHost()->GetMainFrame();
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup = std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup(CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW, PopPendingPopup(CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW,
web_contents->GetRenderViewHost()->GetProcess()->GetID(), host->GetProcess()->GetID(), host->GetRoutingID(),
web_contents->GetRenderViewHost()->GetRoutingID(),
target_url); target_url);
DCHECK(pending_popup.get()); DCHECK(pending_popup.get());
DCHECK(pending_popup->platform_delegate.get()); DCHECK(pending_popup->platform_delegate.get());
@ -290,11 +289,12 @@ void CefBrowserInfoManager::WebContentsCreated(
DCHECK(source_contents); DCHECK(source_contents);
DCHECK(new_contents); DCHECK(new_contents);
content::RenderFrameHost* host =
source_contents->GetRenderViewHost()->GetMainFrame();
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup = std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup( PopPendingPopup(
CefBrowserInfoManager::PendingPopup::SHOULD_CREATE_WEB_CONTENTS, CefBrowserInfoManager::PendingPopup::SHOULD_CREATE_WEB_CONTENTS,
source_contents->GetRenderViewHost()->GetProcess()->GetID(), host->GetProcess()->GetID(), host->GetRoutingID(),
source_contents->GetRenderViewHost()->GetRoutingID(),
target_url); target_url);
DCHECK(pending_popup.get()); DCHECK(pending_popup.get());
DCHECK(pending_popup->platform_delegate.get()); DCHECK(pending_popup->platform_delegate.get());
@ -442,10 +442,10 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
} }
void CefBrowserInfoManager::FilterPendingPopupURL( void CefBrowserInfoManager::FilterPendingPopupURL(
int render_process_id, int opener_process_id,
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup) { std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup) {
content::RenderProcessHost* host = content::RenderProcessHost* host =
content::RenderProcessHost::FromID(render_process_id); content::RenderProcessHost::FromID(opener_process_id);
DCHECK(host); DCHECK(host);
host->FilterURL(false, &pending_popup->target_url); host->FilterURL(false, &pending_popup->target_url);
@ -461,10 +461,10 @@ std::unique_ptr<CefBrowserInfoManager::PendingPopup>
CefBrowserInfoManager::PopPendingPopup( CefBrowserInfoManager::PopPendingPopup(
PendingPopup::Step step, PendingPopup::Step step,
int opener_process_id, int opener_process_id,
int opener_view_id, int opener_frame_id,
const GURL& target_url) { const GURL& target_url) {
DCHECK_GT(opener_process_id, 0); DCHECK_GT(opener_process_id, 0);
DCHECK_GT(opener_view_id, 0); DCHECK_GT(opener_frame_id, 0);
base::AutoLock lock_scope(pending_popup_lock_); base::AutoLock lock_scope(pending_popup_lock_);
@ -473,7 +473,7 @@ std::unique_ptr<CefBrowserInfoManager::PendingPopup>
PendingPopup* popup = *it; PendingPopup* popup = *it;
if (popup->step == step && if (popup->step == step &&
popup->opener_process_id == opener_process_id && popup->opener_process_id == opener_process_id &&
popup->opener_view_id == opener_view_id && popup->opener_frame_id == opener_frame_id &&
popup->target_url == target_url) { popup->target_url == target_url) {
pending_popup_list_.weak_erase(it); pending_popup_list_.weak_erase(it);
return base::WrapUnique(popup); return base::WrapUnique(popup);

View File

@ -67,8 +67,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
const blink::WebWindowFeatures& features, const blink::WebWindowFeatures& features,
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
int render_process_id, int opener_render_process_id,
int opener_render_view_id,
int opener_render_frame_id, int opener_render_frame_id,
bool* no_javascript_access); bool* no_javascript_access);
@ -113,7 +112,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// Retrieves the CefBrowserInfo matching the specified IDs or an empty // Retrieves the CefBrowserInfo matching the specified IDs or an empty
// pointer if no match is found. It is allowed to add new callers of this // pointer if no match is found. It is allowed to add new callers of this
// method but consider using CefBrowserHostImpl::GetBrowserFor[View|Frame]() // method but consider using CefBrowserHostImpl::GetBrowserFor[View|Frame]()
// or extensions::GetOwnerBrowserForView() instead. // or extensions::GetOwnerBrowserForFrame() instead.
// |is_guest_view| will be set to true if the IDs match a guest view // |is_guest_view| will be set to true if the IDs match a guest view
// associated with the returned browser info instead of the browser itself. // associated with the returned browser info instead of the browser itself.
scoped_refptr<CefBrowserInfo> GetBrowserInfoForView(int render_process_id, scoped_refptr<CefBrowserInfo> GetBrowserInfoForView(int render_process_id,
@ -157,8 +156,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// |target_url| will be empty if a popup is created via window.open() and // |target_url| will be empty if a popup is created via window.open() and
// never navigated. For example: javascript:window.open(); // never navigated. For example: javascript:window.open();
int opener_process_id; int opener_process_id;
int opener_view_id; int opener_frame_id;
int64 opener_frame_id;
GURL target_url; GURL target_url;
std::string target_frame_name; std::string target_frame_name;
@ -176,7 +174,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// URIs, rewrites the URL to "about:blank". We need to apply the same filter // URIs, rewrites the URL to "about:blank". We need to apply the same filter
// otherwise ShouldCreateWebContents will fail to retrieve the PopupInfo. // otherwise ShouldCreateWebContents will fail to retrieve the PopupInfo.
static void FilterPendingPopupURL( static void FilterPendingPopupURL(
int render_process_id, int opener_process_id,
std::unique_ptr<PendingPopup> pending_popup); std::unique_ptr<PendingPopup> pending_popup);
// Manage pending popups. // Manage pending popups.
@ -184,7 +182,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
std::unique_ptr<PendingPopup> PopPendingPopup( std::unique_ptr<PendingPopup> PopPendingPopup(
PendingPopup::Step step, PendingPopup::Step step,
int opener_process_id, int opener_process_id,
int opener_view_id, int opener_frame_id,
const GURL& target_url); const GURL& target_url);
// Retrieves the BrowserInfo matching the specified IDs. If both sets are // Retrieves the BrowserInfo matching the specified IDs. If both sets are

View File

@ -47,6 +47,7 @@
#include "ui/views/widget/desktop_aura/desktop_screen.h" #include "ui/views/widget/desktop_aura/desktop_screen.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include "libcef/common/crash_reporting_win.h"
#include "ui/base/cursor/cursor_loader_win.h" #include "ui/base/cursor/cursor_loader_win.h"
#endif #endif
#endif // defined(USE_AURA) #endif // defined(USE_AURA)
@ -168,6 +169,10 @@ int CefBrowserMainParts::PreCreateThreads() {
} }
void CefBrowserMainParts::PreMainMessageLoopRun() { void CefBrowserMainParts::PreMainMessageLoopRun() {
#if defined(OS_WIN)
crash_reporting_win::BlockUntilHandlerStarted();
#endif
if (extensions::ExtensionsEnabled()) { if (extensions::ExtensionsEnabled()) {
// Initialize extension global objects before creating the global // Initialize extension global objects before creating the global
// BrowserContext. // BrowserContext.

View File

@ -10,7 +10,7 @@ namespace browser_util {
bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event, bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event,
CefKeyEvent& cef_event) { CefKeyEvent& cef_event) {
switch (event.type) { switch (event.type()) {
case blink::WebKeyboardEvent::RawKeyDown: case blink::WebKeyboardEvent::RawKeyDown:
cef_event.type = KEYEVENT_RAWKEYDOWN; cef_event.type = KEYEVENT_RAWKEYDOWN;
break; break;
@ -28,15 +28,15 @@ bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event,
} }
cef_event.modifiers = 0; cef_event.modifiers = 0;
if (event.modifiers & blink::WebKeyboardEvent::ShiftKey) if (event.modifiers() & blink::WebKeyboardEvent::ShiftKey)
cef_event.modifiers |= EVENTFLAG_SHIFT_DOWN; cef_event.modifiers |= EVENTFLAG_SHIFT_DOWN;
if (event.modifiers & blink::WebKeyboardEvent::ControlKey) if (event.modifiers() & blink::WebKeyboardEvent::ControlKey)
cef_event.modifiers |= EVENTFLAG_CONTROL_DOWN; cef_event.modifiers |= EVENTFLAG_CONTROL_DOWN;
if (event.modifiers & blink::WebKeyboardEvent::AltKey) if (event.modifiers() & blink::WebKeyboardEvent::AltKey)
cef_event.modifiers |= EVENTFLAG_ALT_DOWN; cef_event.modifiers |= EVENTFLAG_ALT_DOWN;
if (event.modifiers & blink::WebKeyboardEvent::MetaKey) if (event.modifiers() & blink::WebKeyboardEvent::MetaKey)
cef_event.modifiers |= EVENTFLAG_COMMAND_DOWN; cef_event.modifiers |= EVENTFLAG_COMMAND_DOWN;
if (event.modifiers & blink::WebKeyboardEvent::IsKeyPad) if (event.modifiers() & blink::WebKeyboardEvent::IsKeyPad)
cef_event.modifiers |= EVENTFLAG_IS_KEY_PAD; cef_event.modifiers |= EVENTFLAG_IS_KEY_PAD;
cef_event.windows_key_code = event.windowsKeyCode; cef_event.windows_key_code = event.windowsKeyCode;

View File

@ -98,7 +98,7 @@ metrics::MetricsService* ChromeBrowserProcessStub::metrics_service() {
return NULL; return NULL;
} }
rappor::RapporService* ChromeBrowserProcessStub::rappor_service() { rappor::RapporServiceImpl* ChromeBrowserProcessStub::rappor_service() {
NOTREACHED(); NOTREACHED();
return NULL; return NULL;
} }
@ -322,7 +322,7 @@ bool ChromeBrowserProcessStub::created_local_state() const {
return false; return false;
} }
#if defined(ENABLE_WEBRTC) #if BUILDFLAG(ENABLE_WEBRTC)
WebRtcLogUploader* ChromeBrowserProcessStub::webrtc_log_uploader() { WebRtcLogUploader* ChromeBrowserProcessStub::webrtc_log_uploader() {
NOTREACHED(); NOTREACHED();
return NULL; return NULL;
@ -351,7 +351,8 @@ memory::TabManager* ChromeBrowserProcessStub::GetTabManager() {
return NULL; return NULL;
} }
PhysicalWebDataSource* ChromeBrowserProcessStub::GetPhysicalWebDataSource() { physical_web::PhysicalWebDataSource*
ChromeBrowserProcessStub::GetPhysicalWebDataSource() {
NOTREACHED(); NOTREACHED();
return NULL; return NULL;
} }

View File

@ -16,6 +16,7 @@
#include "chrome/browser/extensions/event_router_forwarder.h" #include "chrome/browser/extensions/event_router_forwarder.h"
#include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/incognito_helpers.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "media/media_features.h"
class ChromeProfileManagerStub; class ChromeProfileManagerStub;
@ -43,7 +44,7 @@ class ChromeBrowserProcessStub : public BrowserProcess,
metrics_services_manager::MetricsServicesManager* metrics_services_manager::MetricsServicesManager*
GetMetricsServicesManager() override; GetMetricsServicesManager() override;
metrics::MetricsService* metrics_service() override; metrics::MetricsService* metrics_service() override;
rappor::RapporService* rappor_service() override; rappor::RapporServiceImpl* rappor_service() override;
IOThread* io_thread() override; IOThread* io_thread() override;
WatchDogThread* watchdog_thread() override; WatchDogThread* watchdog_thread() override;
ProfileManager* profile_manager() override; ProfileManager* profile_manager() override;
@ -100,7 +101,7 @@ class ChromeBrowserProcessStub : public BrowserProcess,
MediaFileSystemRegistry* MediaFileSystemRegistry*
media_file_system_registry() override; media_file_system_registry() override;
bool created_local_state() const override; bool created_local_state() const override;
#if defined(ENABLE_WEBRTC) #if BUILDFLAG(ENABLE_WEBRTC)
WebRtcLogUploader* webrtc_log_uploader() override; WebRtcLogUploader* webrtc_log_uploader() override;
#endif #endif
network_time::NetworkTimeTracker* network_time_tracker() override; network_time::NetworkTimeTracker* network_time_tracker() override;
@ -108,7 +109,7 @@ class ChromeBrowserProcessStub : public BrowserProcess,
shell_integration::DefaultWebClientState shell_integration::DefaultWebClientState
CachedDefaultWebClientState() override; CachedDefaultWebClientState() override;
memory::TabManager* GetTabManager() override; memory::TabManager* GetTabManager() override;
PhysicalWebDataSource* GetPhysicalWebDataSource() override; physical_web::PhysicalWebDataSource* GetPhysicalWebDataSource() override;
// BrowserContextIncognitoHelper implementation. // BrowserContextIncognitoHelper implementation.
content::BrowserContext* GetBrowserContextRedirectedInIncognito( content::BrowserContext* GetBrowserContextRedirectedInIncognito(

View File

@ -284,8 +284,8 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
bool handled = false; bool handled = false;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForView(render_process_id, CefBrowserHostImpl::GetBrowserForFrame(render_process_id,
params.render_view_id); params.render_frame_id);
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) { if (client.get()) {
@ -593,8 +593,7 @@ void CefContentBrowserClient::SiteInstanceDeleting(
} }
std::unique_ptr<base::Value> std::unique_ptr<base::Value>
CefContentBrowserClient::GetServiceManifestOverlay( CefContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
const std::string& name) {
int id = -1; int id = -1;
if (name == content::mojom::kBrowserServiceName) if (name == content::mojom::kBrowserServiceName)
id = IDR_CEF_BROWSER_MANIFEST_OVERLAY; id = IDR_CEF_BROWSER_MANIFEST_OVERLAY;
@ -820,6 +819,8 @@ void CefContentBrowserClient::SelectClientCertificate(
} }
bool CefContentBrowserClient::CanCreateWindow( bool CefContentBrowserClient::CanCreateWindow(
int opener_render_process_id,
int opener_render_frame_id,
const GURL& opener_url, const GURL& opener_url,
const GURL& opener_top_level_frame_url, const GURL& opener_top_level_frame_url,
const GURL& source_origin, const GURL& source_origin,
@ -832,17 +833,14 @@ bool CefContentBrowserClient::CanCreateWindow(
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
content::ResourceContext* context, content::ResourceContext* context,
int render_process_id,
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) { bool* no_javascript_access) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
*no_javascript_access = false; *no_javascript_access = false;
return CefBrowserInfoManager::GetInstance()->CanCreateWindow( return CefBrowserInfoManager::GetInstance()->CanCreateWindow(
target_url, referrer, frame_name, disposition, features, user_gesture, target_url, referrer, frame_name, disposition, features, user_gesture,
opener_suppressed, render_process_id, opener_render_view_id, opener_suppressed, opener_render_process_id, opener_render_frame_id,
opener_render_frame_id, no_javascript_access); no_javascript_access);
} }
void CefContentBrowserClient::ResourceDispatcherHostCreated() { void CefContentBrowserClient::ResourceDispatcherHostCreated() {
@ -855,6 +853,8 @@ void CefContentBrowserClient::ResourceDispatcherHostCreated() {
void CefContentBrowserClient::OverrideWebkitPrefs( void CefContentBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* rvh, content::RenderViewHost* rvh,
content::WebPreferences* prefs) { content::WebPreferences* prefs) {
// Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr
// when this method is called.
renderer_prefs::PopulateWebPreferences(rvh, *prefs); renderer_prefs::PopulateWebPreferences(rvh, *prefs);
if (rvh->GetWidget()->GetView()) { if (rvh->GetWidget()->GetView()) {
@ -884,12 +884,12 @@ content::DevToolsManagerDelegate*
return new CefDevToolsManagerDelegate(); return new CefDevToolsManagerDelegate();
} }
ScopedVector<content::NavigationThrottle> std::vector<std::unique_ptr<content::NavigationThrottle>>
CefContentBrowserClient::CreateThrottlesForNavigation( CefContentBrowserClient::CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) { content::NavigationHandle* navigation_handle) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
ScopedVector<content::NavigationThrottle> throttles; std::vector<std::unique_ptr<content::NavigationThrottle>> throttles;
const bool is_main_frame = navigation_handle->IsInMainFrame(); const bool is_main_frame = navigation_handle->IsInMainFrame();
@ -919,13 +919,13 @@ CefContentBrowserClient::CreateThrottlesForNavigation(
frame_id = CefFrameHostImpl::kInvalidFrameId; frame_id = CefFrameHostImpl::kInvalidFrameId;
} }
content::NavigationThrottle* throttle = std::unique_ptr<content::NavigationThrottle> throttle =
new navigation_interception::InterceptNavigationThrottle( base::MakeUnique<navigation_interception::InterceptNavigationThrottle>(
navigation_handle, navigation_handle,
base::Bind(&NavigationOnUIThread, is_main_frame, frame_id, base::Bind(&NavigationOnUIThread, is_main_frame, frame_id,
parent_frame_id), parent_frame_id),
true); true);
throttles.push_back(throttle); throttles.push_back(std::move(throttle));
return throttles; return throttles;
} }

View File

@ -47,7 +47,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
void SiteInstanceGotProcess(content::SiteInstance* site_instance) override; void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
void SiteInstanceDeleting(content::SiteInstance* site_instance) override; void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
std::unique_ptr<base::Value> GetServiceManifestOverlay( std::unique_ptr<base::Value> GetServiceManifestOverlay(
const std::string& name) override; base::StringPiece name) override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line, void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override; int child_process_id) override;
content::QuotaPermissionContext* content::QuotaPermissionContext*
@ -70,7 +70,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::WebContents* web_contents, content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info, net::SSLCertRequestInfo* cert_request_info,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override; std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
bool CanCreateWindow(const GURL& opener_url, bool CanCreateWindow(int opener_render_process_id,
int opener_render_frame_id,
const GURL& opener_url,
const GURL& opener_top_level_frame_url, const GURL& opener_top_level_frame_url,
const GURL& source_origin, const GURL& source_origin,
WindowContainerType container_type, WindowContainerType container_type,
@ -82,9 +84,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
content::ResourceContext* context, content::ResourceContext* context,
int render_process_id,
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) override; bool* no_javascript_access) override;
void ResourceDispatcherHostCreated() override; void ResourceDispatcherHostCreated() override;
void OverrideWebkitPrefs(content::RenderViewHost* rvh, void OverrideWebkitPrefs(content::RenderViewHost* rvh,
@ -95,7 +94,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override; void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() content::DevToolsManagerDelegate* GetDevToolsManagerDelegate()
override; override;
ScopedVector<content::NavigationThrottle> CreateThrottlesForNavigation( std::vector<std::unique_ptr<content::NavigationThrottle>>
CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) override; content::NavigationHandle* navigation_handle) override;
#if defined(OS_POSIX) && !defined(OS_MACOSX) #if defined(OS_POSIX) && !defined(OS_MACOSX)

View File

@ -60,8 +60,7 @@ class CefForceShutdown {
} }
} g_force_shutdown; } g_force_shutdown;
#if defined(OS_WIN) #if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
#if defined(ARCH_CPU_X86_64)
// VS2013 only checks the existence of FMA3 instructions, not the enabled-ness // VS2013 only checks the existence of FMA3 instructions, not the enabled-ness
// of them at the OS level (this is fixed in VS2015). We force off usage of // of them at the OS level (this is fixed in VS2015). We force off usage of
// FMA3 instructions in the CRT to avoid using that path and hitting illegal // FMA3 instructions in the CRT to avoid using that path and hitting illegal
@ -73,18 +72,7 @@ void DisableFMA3() {
disabled = true; disabled = true;
_set_FMA3_enable(0); _set_FMA3_enable(0);
} }
#endif // defined(ARCH_CPU_X86_64) #endif
// Signal chrome_elf to initialize crash reporting, rather than doing it in
// DllMain. See https://crbug.com/656800 for details.
void InitCrashReporter() {
static bool initialized = false;
if (initialized)
return;
initialized = true;
SignalInitializeCrashReporting();
}
#endif // defined(OS_WIN)
#if defined(OS_MACOSX) || defined(OS_WIN) #if defined(OS_MACOSX) || defined(OS_WIN)
@ -132,12 +120,9 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) {
int CefExecuteProcess(const CefMainArgs& args, int CefExecuteProcess(const CefMainArgs& args,
CefRefPtr<CefApp> application, CefRefPtr<CefApp> application,
void* windows_sandbox_info) { void* windows_sandbox_info) {
#if defined(OS_WIN) #if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
#if defined(ARCH_CPU_X86_64)
DisableFMA3(); DisableFMA3();
#endif #endif
InitCrashReporter();
#endif
base::CommandLine command_line(base::CommandLine::NO_PROGRAM); base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
#if defined(OS_WIN) #if defined(OS_WIN)
@ -191,12 +176,9 @@ bool CefInitialize(const CefMainArgs& args,
const CefSettings& settings, const CefSettings& settings,
CefRefPtr<CefApp> application, CefRefPtr<CefApp> application,
void* windows_sandbox_info) { void* windows_sandbox_info) {
#if defined(OS_WIN) #if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
#if defined(ARCH_CPU_X86_64)
DisableFMA3(); DisableFMA3();
#endif #endif
InitCrashReporter();
#endif
// Return true if the global context already exists. // Return true if the global context already exists.
if (g_context) if (g_context)

View File

@ -230,7 +230,7 @@ void CefDevToolsFrontend::SetPreferences(const std::string& json) {
if (!parsed || !parsed->GetAsDictionary(&dict)) if (!parsed || !parsed->GetAsDictionary(&dict))
return; return;
for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) {
if (!it.value().IsType(base::Value::TYPE_STRING)) if (!it.value().IsType(base::Value::Type::STRING))
continue; continue;
preferences_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy()); preferences_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy());
} }
@ -404,5 +404,6 @@ void CefDevToolsFrontend::SendMessageAck(int request_id,
void CefDevToolsFrontend::AgentHostClosed( void CefDevToolsFrontend::AgentHostClosed(
content::DevToolsAgentHost* agent_host, bool replaced) { content::DevToolsAgentHost* agent_host, bool replaced) {
DCHECK(agent_host == agent_host_.get()); DCHECK(agent_host == agent_host_.get());
agent_host_ = nullptr;
Close(); Close();
} }

View File

@ -59,27 +59,27 @@ content::WebContents* GetOwnerForGuestContents(content::WebContents* guest) {
return NULL; return NULL;
} }
CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForView(int render_process_id, CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForFrame(int render_process_id,
int render_routing_id, int render_routing_id,
bool* is_guest_view) { bool* is_guest_view) {
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
// Use the non-thread-safe but potentially faster approach. // Use the non-thread-safe but potentially faster approach.
content::RenderViewHost* host = content::RenderFrameHost* host =
content::RenderViewHost::FromID(render_process_id, render_routing_id); content::RenderFrameHost::FromID(render_process_id, render_routing_id);
if (host) if (host)
return GetOwnerBrowserForHost(host, is_guest_view); return GetOwnerBrowserForHost(host, is_guest_view);
return NULL; return NULL;
} else { } else {
// Use the thread-safe approach. // Use the thread-safe approach.
scoped_refptr<CefBrowserInfo> info = scoped_refptr<CefBrowserInfo> info =
CefBrowserInfoManager::GetInstance()->GetBrowserInfoForView( CefBrowserInfoManager::GetInstance()->GetBrowserInfoForFrame(
render_process_id, render_routing_id, is_guest_view); render_process_id, render_routing_id, is_guest_view);
if (info.get()) { if (info.get()) {
CefRefPtr<CefBrowserHostImpl> browser = info->browser(); CefRefPtr<CefBrowserHostImpl> browser = info->browser();
if (!browser.get()) { if (!browser.get()) {
LOG(WARNING) << "Found browser id " << info->browser_id() << LOG(WARNING) << "Found browser id " << info->browser_id() <<
" but no browser object matching view process id " << " but no browser object matching view process id " <<
render_process_id << " and routing id " << render_process_id << " and frame routing id " <<
render_routing_id; render_routing_id;
} }
return browser; return browser;
@ -109,4 +109,25 @@ CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForHost(
return browser; return browser;
} }
CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForHost(
content::RenderFrameHost* host,
bool* is_guest_view) {
if (is_guest_view)
*is_guest_view = false;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForHost(host);
if (!browser.get() && ExtensionsEnabled()) {
// Retrieve the owner browser, if any.
content::WebContents* owner = GetOwnerForGuestContents(
content::WebContents::FromRenderFrameHost(host));
if (owner) {
browser = CefBrowserHostImpl::GetBrowserForContents(owner);
if (browser.get() && is_guest_view)
*is_guest_view = true;
}
}
return browser;
}
} // namespace extensions } // namespace extensions

View File

@ -28,19 +28,24 @@ void GetAllGuestsForOwnerContents(content::WebContents* owner,
content::WebContents* GetOwnerForGuestContents(content::WebContents* guest); content::WebContents* GetOwnerForGuestContents(content::WebContents* guest);
// Returns the CefBrowserHostImpl that owns the host identified by the specified // Returns the CefBrowserHostImpl that owns the host identified by the specified
// view routing IDs, if any. |is_guest_view| will be set to true if the IDs // routing IDs, if any. |is_guest_view| will be set to true if the IDs
// match a guest view associated with the returned browser instead of the // match a guest view associated with the returned browser instead of the
// browser itself. // browser itself.
CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForView(int render_process_id, CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForFrame(int render_process_id,
int render_routing_id, int render_routing_id,
bool* is_guest_view); bool* is_guest_view);
// Returns the CefBrowserHostImpl that owns the specified |host|, if any. // Returns the CefBrowserHostImpl that owns the specified |host|, if any.
// |is_guest_view| will be set to true if the host matches a guest view // |is_guest_view| will be set to true if the host matches a guest view
// associated with the returned browser instead of the browser itself. // associated with the returned browser instead of the browser itself.
// TODO(cef): Delete the RVH variant once the remaining use case
// (via CefContentBrowserClient::OverrideWebkitPrefs) has been removed.
CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForHost( CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForHost(
content::RenderViewHost* host, content::RenderViewHost* host,
bool* is_guest_view); bool* is_guest_view);
CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForHost(
content::RenderFrameHost* host,
bool* is_guest_view);
} // namespace extensions } // namespace extensions

View File

@ -68,7 +68,7 @@ base::DictionaryValue* ParseManifest(
JSONStringValueDeserializer deserializer(manifest_contents); JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY)) { if (!manifest.get() || !manifest->IsType(base::Value::Type::DICTIONARY)) {
LOG(ERROR) << "Failed to parse extension manifest."; LOG(ERROR) << "Failed to parse extension manifest.";
return NULL; return NULL;
} }

View File

@ -253,21 +253,19 @@ void CefBrowserPlatformDelegateNativeLinux::HandleExternalProtocol(
void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent( void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent(
content::NativeWebKeyboardEvent& result, content::NativeWebKeyboardEvent& result,
const CefKeyEvent& key_event) const { const CefKeyEvent& key_event) const {
result.timeStampSeconds = GetSystemUptime();
result.windowsKeyCode = key_event.windows_key_code; result.windowsKeyCode = key_event.windows_key_code;
result.nativeKeyCode = key_event.native_key_code; result.nativeKeyCode = key_event.native_key_code;
result.isSystemKey = key_event.is_system_key ? 1 : 0; result.isSystemKey = key_event.is_system_key ? 1 : 0;
switch (key_event.type) { switch (key_event.type) {
case KEYEVENT_RAWKEYDOWN: case KEYEVENT_RAWKEYDOWN:
case KEYEVENT_KEYDOWN: case KEYEVENT_KEYDOWN:
result.type = blink::WebInputEvent::RawKeyDown; result.setType(blink::WebInputEvent::RawKeyDown);
break; break;
case KEYEVENT_KEYUP: case KEYEVENT_KEYUP:
result.type = blink::WebInputEvent::KeyUp; result.setType(blink::WebInputEvent::KeyUp);
break; break;
case KEYEVENT_CHAR: case KEYEVENT_CHAR:
result.type = blink::WebInputEvent::Char; result.setType(blink::WebInputEvent::Char);
break; break;
default: default:
NOTREACHED(); NOTREACHED();
@ -287,7 +285,8 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent(
result.text[0] = key_event.character; result.text[0] = key_event.character;
result.unmodifiedText[0] = key_event.unmodified_character; result.unmodifiedText[0] = key_event.unmodified_character;
result.modifiers |= TranslateModifiers(key_event.modifiers); result.setModifiers(
result.modifiers() | TranslateModifiers(key_event.modifiers));
} }
void CefBrowserPlatformDelegateNativeLinux::TranslateClickEvent( void CefBrowserPlatformDelegateNativeLinux::TranslateClickEvent(
@ -299,18 +298,18 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateClickEvent(
switch (type) { switch (type) {
case MBT_LEFT: case MBT_LEFT:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Left; result.button = blink::WebMouseEvent::Button::Left;
break; break;
case MBT_MIDDLE: case MBT_MIDDLE:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Middle; result.button = blink::WebMouseEvent::Button::Middle;
break; break;
case MBT_RIGHT: case MBT_RIGHT:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Right; result.button = blink::WebMouseEvent::Button::Right;
break; break;
default: default:
@ -327,7 +326,7 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateMoveEvent(
TranslateMouseEvent(result, mouse_event); TranslateMouseEvent(result, mouse_event);
if (!mouseLeave) { if (!mouseLeave) {
result.type = blink::WebInputEvent::MouseMove; result.setType(blink::WebInputEvent::MouseMove);
if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON) if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
result.button = blink::WebMouseEvent::Button::Left; result.button = blink::WebMouseEvent::Button::Left;
else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON) else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON)
@ -337,7 +336,7 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateMoveEvent(
else else
result.button = blink::WebMouseEvent::Button::NoButton; result.button = blink::WebMouseEvent::Button::NoButton;
} else { } else {
result.type = blink::WebInputEvent::MouseLeave; result.setType(blink::WebInputEvent::MouseLeave);
result.button = blink::WebMouseEvent::Button::NoButton; result.button = blink::WebMouseEvent::Button::NoButton;
} }
@ -351,7 +350,7 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateWheelEvent(
result = blink::WebMouseWheelEvent(); result = blink::WebMouseWheelEvent();
TranslateMouseEvent(result, mouse_event); TranslateMouseEvent(result, mouse_event);
result.type = blink::WebInputEvent::MouseWheel; result.setType(blink::WebInputEvent::MouseWheel);
static const double scrollbarPixelsPerGtkTick = 40.0; static const double scrollbarPixelsPerGtkTick = 40.0;
result.deltaX = deltaX; result.deltaX = deltaX;
@ -401,9 +400,10 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateMouseEvent(
result.globalY = screen_pt.y(); result.globalY = screen_pt.y();
// modifiers // modifiers
result.modifiers |= TranslateModifiers(mouse_event.modifiers); result.setModifiers(
result.modifiers() | TranslateModifiers(mouse_event.modifiers));
// timestamp // timestamp
result.timeStampSeconds = GetSystemUptime(); result.setTimeStampSeconds(GetSystemUptime());
} }

View File

@ -21,6 +21,8 @@
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/platform/WebMouseEvent.h"
#include "third_party/WebKit/public/platform/WebMouseWheelEvent.h"
#import "ui/base/cocoa/cocoa_base_utils.h" #import "ui/base/cocoa/cocoa_base_utils.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/events/keycodes/keyboard_codes_posix.h" #include "ui/events/keycodes/keyboard_codes_posix.h"
@ -345,7 +347,7 @@ void CefBrowserPlatformDelegateNativeMac::TranslateKeyEvent(
result = content::NativeWebKeyboardEvent(synthetic_event); result = content::NativeWebKeyboardEvent(synthetic_event);
if (key_event.type == KEYEVENT_CHAR) if (key_event.type == KEYEVENT_CHAR)
result.type = blink::WebInputEvent::Char; result.setType(blink::WebInputEvent::Char);
result.isSystemKey = key_event.is_system_key; result.isSystemKey = key_event.is_system_key;
} }
@ -359,18 +361,18 @@ void CefBrowserPlatformDelegateNativeMac::TranslateClickEvent(
switch (type) { switch (type) {
case MBT_LEFT: case MBT_LEFT:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Left; result.button = blink::WebMouseEvent::Button::Left;
break; break;
case MBT_MIDDLE: case MBT_MIDDLE:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Middle; result.button = blink::WebMouseEvent::Button::Middle;
break; break;
case MBT_RIGHT: case MBT_RIGHT:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Right; result.button = blink::WebMouseEvent::Button::Right;
break; break;
default: default:
@ -387,7 +389,7 @@ void CefBrowserPlatformDelegateNativeMac::TranslateMoveEvent(
TranslateMouseEvent(result, mouse_event); TranslateMouseEvent(result, mouse_event);
if (!mouseLeave) { if (!mouseLeave) {
result.type = blink::WebInputEvent::MouseMove; result.setType(blink::WebInputEvent::MouseMove);
if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON) if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
result.button = blink::WebMouseEvent::Button::Left; result.button = blink::WebMouseEvent::Button::Left;
else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON) else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON)
@ -397,7 +399,7 @@ void CefBrowserPlatformDelegateNativeMac::TranslateMoveEvent(
else else
result.button = blink::WebMouseEvent::Button::NoButton; result.button = blink::WebMouseEvent::Button::NoButton;
} else { } else {
result.type = blink::WebInputEvent::MouseLeave; result.setType(blink::WebInputEvent::MouseLeave);
result.button = blink::WebMouseEvent::Button::NoButton; result.button = blink::WebMouseEvent::Button::NoButton;
} }
@ -411,7 +413,7 @@ void CefBrowserPlatformDelegateNativeMac::TranslateWheelEvent(
result = blink::WebMouseWheelEvent(); result = blink::WebMouseWheelEvent();
TranslateMouseEvent(result, mouse_event); TranslateMouseEvent(result, mouse_event);
result.type = blink::WebInputEvent::MouseWheel; result.setType(blink::WebInputEvent::MouseWheel);
static const double scrollbarPixelsPerCocoaTick = 40.0; static const double scrollbarPixelsPerCocoaTick = 40.0;
result.deltaX = deltaX; result.deltaX = deltaX;
@ -469,9 +471,10 @@ void CefBrowserPlatformDelegateNativeMac::TranslateMouseEvent(
result.globalY = screen_pt.y(); result.globalY = screen_pt.y();
// modifiers // modifiers
result.modifiers |= TranslateModifiers(mouse_event.modifiers); result.setModifiers(
result.modifiers() | TranslateModifiers(mouse_event.modifiers));
// timestamp - Mac OSX specific // timestamp - Mac OSX specific
result.timeStampSeconds = currentEventTimestamp(); result.setTimeStampSeconds(currentEventTimestamp());
} }

View File

@ -21,6 +21,8 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h" #include "base/win/registry.h"
#include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/native_web_keyboard_event.h"
#include "third_party/WebKit/public/platform/WebMouseEvent.h"
#include "third_party/WebKit/public/platform/WebMouseWheelEvent.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/base/win/shell.h" #include "ui/base/win/shell.h"
#include "ui/display/display.h" #include "ui/display/display.h"
@ -329,7 +331,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
if (!msg.hwnd) if (!msg.hwnd)
return; return;
switch (event.type) { switch (event.type()) {
case blink::WebInputEvent::RawKeyDown: case blink::WebInputEvent::RawKeyDown:
msg.message = event.isSystemKey ? WM_SYSKEYDOWN : WM_KEYDOWN; msg.message = event.isSystemKey ? WM_SYSKEYDOWN : WM_KEYDOWN;
break; break;
@ -349,7 +351,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
UINT scan_code = ::MapVirtualKeyW(event.windowsKeyCode, MAPVK_VK_TO_VSC); UINT scan_code = ::MapVirtualKeyW(event.windowsKeyCode, MAPVK_VK_TO_VSC);
msg.lParam = (scan_code << 16) | // key scan code msg.lParam = (scan_code << 16) | // key scan code
1; // key repeat count 1; // key repeat count
if (event.modifiers & content::NativeWebKeyboardEvent::AltKey) if (event.modifiers() & content::NativeWebKeyboardEvent::AltKey)
msg.lParam |= (1 << 29); msg.lParam |= (1 << 29);
DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam); DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
@ -366,21 +368,19 @@ void CefBrowserPlatformDelegateNativeWin::HandleExternalProtocol(
void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent( void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent(
content::NativeWebKeyboardEvent& result, content::NativeWebKeyboardEvent& result,
const CefKeyEvent& key_event) const { const CefKeyEvent& key_event) const {
result.timeStampSeconds = GetMessageTime() / 1000.0;
result.windowsKeyCode = key_event.windows_key_code; result.windowsKeyCode = key_event.windows_key_code;
result.nativeKeyCode = key_event.native_key_code; result.nativeKeyCode = key_event.native_key_code;
result.isSystemKey = key_event.is_system_key ? 1 : 0; result.isSystemKey = key_event.is_system_key ? 1 : 0;
switch (key_event.type) { switch (key_event.type) {
case KEYEVENT_RAWKEYDOWN: case KEYEVENT_RAWKEYDOWN:
case KEYEVENT_KEYDOWN: case KEYEVENT_KEYDOWN:
result.type = blink::WebInputEvent::RawKeyDown; result.setType(blink::WebInputEvent::RawKeyDown);
break; break;
case KEYEVENT_KEYUP: case KEYEVENT_KEYUP:
result.type = blink::WebInputEvent::KeyUp; result.setType(blink::WebInputEvent::KeyUp);
break; break;
case KEYEVENT_CHAR: case KEYEVENT_CHAR:
result.type = blink::WebInputEvent::Char; result.setType(blink::WebInputEvent::Char);
break; break;
default: default:
NOTREACHED(); NOTREACHED();
@ -391,7 +391,7 @@ void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent(
result.domCode = result.domCode =
static_cast<int>(ui::KeycodeConverter::NativeKeycodeToDomCode( static_cast<int>(ui::KeycodeConverter::NativeKeycodeToDomCode(
key_event.native_key_code)); key_event.native_key_code));
if (result.type == blink::WebInputEvent::Char) { if (result.type() == blink::WebInputEvent::Char) {
result.domKey = ui::DomKey::FromCharacter(key_event.windows_key_code); result.domKey = ui::DomKey::FromCharacter(key_event.windows_key_code);
} else { } else {
// TODO(cef): CefKeyEvent does not currently pass extended key status (see // TODO(cef): CefKeyEvent does not currently pass extended key status (see
@ -401,13 +401,14 @@ void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent(
ui::KeyboardCodeForWindowsKeyCode(key_event.windows_key_code), 0); ui::KeyboardCodeForWindowsKeyCode(key_event.windows_key_code), 0);
} }
if (result.type == blink::WebInputEvent::Char || if (result.type() == blink::WebInputEvent::Char ||
result.type == blink::WebInputEvent::RawKeyDown) { result.type() == blink::WebInputEvent::RawKeyDown) {
result.text[0] = result.windowsKeyCode; result.text[0] = result.windowsKeyCode;
result.unmodifiedText[0] = result.windowsKeyCode; result.unmodifiedText[0] = result.windowsKeyCode;
} }
result.modifiers |= TranslateModifiers(key_event.modifiers); result.setModifiers(
result.modifiers() | TranslateModifiers(key_event.modifiers));
} }
void CefBrowserPlatformDelegateNativeWin::TranslateClickEvent( void CefBrowserPlatformDelegateNativeWin::TranslateClickEvent(
@ -419,18 +420,18 @@ void CefBrowserPlatformDelegateNativeWin::TranslateClickEvent(
switch (type) { switch (type) {
case MBT_LEFT: case MBT_LEFT:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Left; result.button = blink::WebMouseEvent::Button::Left;
break; break;
case MBT_MIDDLE: case MBT_MIDDLE:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Middle; result.button = blink::WebMouseEvent::Button::Middle;
break; break;
case MBT_RIGHT: case MBT_RIGHT:
result.type = mouseUp ? blink::WebInputEvent::MouseUp : result.setType(mouseUp ? blink::WebInputEvent::MouseUp :
blink::WebInputEvent::MouseDown; blink::WebInputEvent::MouseDown);
result.button = blink::WebMouseEvent::Button::Right; result.button = blink::WebMouseEvent::Button::Right;
break; break;
default: default:
@ -447,7 +448,7 @@ void CefBrowserPlatformDelegateNativeWin::TranslateMoveEvent(
TranslateMouseEvent(result, mouse_event); TranslateMouseEvent(result, mouse_event);
if (!mouseLeave) { if (!mouseLeave) {
result.type = blink::WebInputEvent::MouseMove; result.setType(blink::WebInputEvent::MouseMove);
if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON) if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
result.button = blink::WebMouseEvent::Button::Left; result.button = blink::WebMouseEvent::Button::Left;
else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON) else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON)
@ -457,7 +458,7 @@ void CefBrowserPlatformDelegateNativeWin::TranslateMoveEvent(
else else
result.button = blink::WebMouseEvent::Button::NoButton; result.button = blink::WebMouseEvent::Button::NoButton;
} else { } else {
result.type = blink::WebInputEvent::MouseLeave; result.setType(blink::WebInputEvent::MouseLeave);
result.button = blink::WebMouseEvent::Button::NoButton; result.button = blink::WebMouseEvent::Button::NoButton;
} }
@ -470,7 +471,7 @@ void CefBrowserPlatformDelegateNativeWin::TranslateWheelEvent(
int deltaX, int deltaY) const { int deltaX, int deltaY) const {
TranslateMouseEvent(result, mouse_event); TranslateMouseEvent(result, mouse_event);
result.type = blink::WebInputEvent::MouseWheel; result.setType(blink::WebInputEvent::MouseWheel);
result.button = blink::WebMouseEvent::Button::NoButton; result.button = blink::WebMouseEvent::Button::NoButton;
float wheelDelta; float wheelDelta;
@ -545,10 +546,11 @@ void CefBrowserPlatformDelegateNativeWin::TranslateMouseEvent(
result.globalY = screen_pt.y(); result.globalY = screen_pt.y();
// modifiers // modifiers
result.modifiers |= TranslateModifiers(mouse_event.modifiers); result.setModifiers(
result.modifiers() | TranslateModifiers(mouse_event.modifiers));
// timestamp // timestamp
result.timeStampSeconds = GetMessageTime() / 1000.0; result.setTimeStampSeconds(GetMessageTime() / 1000.0);
} }
// static // static

View File

@ -14,6 +14,7 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/win/wrapped_window_proc.h" #include "base/win/wrapped_window_proc.h"
#include "skia/ext/skia_utils_win.h"
#include "ui/base/accelerators/accelerator.h" #include "ui/base/accelerators/accelerator.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h" #include "ui/base/l10n/l10n_util_win.h"
@ -27,7 +28,6 @@
#include "ui/gfx/text_utils.h" #include "ui/gfx/text_utils.h"
#include "ui/gfx/win/hwnd_util.h" #include "ui/gfx/win/hwnd_util.h"
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_win.h"
#include "ui/views/controls/menu/menu_config.h" #include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_insertion_delegate_win.h" #include "ui/views/controls/menu/menu_insertion_delegate_win.h"
#include "ui/views/controls/menu/menu_listener.h" #include "ui/views/controls/menu/menu_listener.h"
@ -49,6 +49,30 @@ static const int kItemLeftMargin = 4;
// The width for displaying the sub-menu arrow. // The width for displaying the sub-menu arrow.
static const int kArrowWidth = 10; static const int kArrowWidth = 10;
namespace {
// Draws the top layer of the canvas into the specified HDC. Only works
// with a SkCanvas with a BitmapPlatformDevice. Will create a temporary
// HDC to back the canvas if one doesn't already exist, tearing it down
// before returning. If |src_rect| is null, copies the entire canvas.
// Deleted from skia/ext/platform_canvas.h in https://crbug.com/675977#c13
void DrawToNativeContext(SkCanvas* canvas, HDC destination_hdc, int x, int y,
const RECT* src_rect) {
RECT temp_rect;
if (!src_rect) {
temp_rect.left = 0;
temp_rect.right = canvas->imageInfo().width();
temp_rect.top = 0;
temp_rect.bottom = canvas->imageInfo().height();
src_rect = &temp_rect;
}
skia::CopyHDC(skia::GetNativeDrawingContext(canvas), destination_hdc, x, y,
canvas->imageInfo().isOpaque(), *src_rect,
canvas->getTotalMatrix());
}
} // namespace
struct CefNativeMenuWin::ItemData { struct CefNativeMenuWin::ItemData {
// The Windows API requires that whoever creates the menus must own the // The Windows API requires that whoever creates the menus must own the
// strings used for labels, and keep them around for the lifetime of the // strings used for labels, and keep them around for the lifetime of the
@ -266,7 +290,7 @@ class CefNativeMenuWin::MenuHostWindow {
DCHECK(type != ui::MenuModel::TYPE_CHECK); DCHECK(type != ui::MenuModel::TYPE_CHECK);
gfx::Canvas canvas(skia_icon.size(), 1.0f, false); gfx::Canvas canvas(skia_icon.size(), 1.0f, false);
canvas.DrawImageInt(skia_icon, 0, 0); canvas.DrawImageInt(skia_icon, 0, 0);
skia::DrawToNativeContext( DrawToNativeContext(
canvas.sk_canvas(), dc, canvas.sk_canvas(), dc,
draw_item_struct->rcItem.left + kItemLeftMargin, draw_item_struct->rcItem.left + kItemLeftMargin,
draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom -
@ -291,7 +315,8 @@ class CefNativeMenuWin::MenuHostWindow {
gfx::Rect bounds(0, 0, config.check_width, config.check_height); gfx::Rect bounds(0, 0, config.check_width, config.check_height);
// Draw the background and the check. // Draw the background and the check.
ui::NativeThemeWin* native_theme = ui::NativeThemeWin::instance(); ui::NativeTheme* native_theme =
ui::NativeTheme::GetInstanceForNativeUi();
native_theme->Paint( native_theme->Paint(
canvas.sk_canvas(), NativeTheme::kMenuCheckBackground, canvas.sk_canvas(), NativeTheme::kMenuCheckBackground,
state, bounds, extra); state, bounds, extra);
@ -299,7 +324,7 @@ class CefNativeMenuWin::MenuHostWindow {
canvas.sk_canvas(), NativeTheme::kMenuCheck, state, bounds, extra); canvas.sk_canvas(), NativeTheme::kMenuCheck, state, bounds, extra);
// Draw checkbox to menu. // Draw checkbox to menu.
skia::DrawToNativeContext(canvas.sk_canvas(), dc, DrawToNativeContext(canvas.sk_canvas(), dc,
draw_item_struct->rcItem.left + kItemLeftMargin, draw_item_struct->rcItem.left + kItemLeftMargin,
draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom -
draw_item_struct->rcItem.top - config.check_height) / 2, NULL); draw_item_struct->rcItem.top - config.check_height) / 2, NULL);

View File

@ -14,7 +14,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "net/base/mime_util.h" #include "net/base/mime_util.h"
#include "third_party/brotli/dec/decode.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
namespace scheme { namespace scheme {
@ -49,24 +48,6 @@ std::string GetMimeType(const std::string& filename) {
return "text/plain"; return "text/plain";
} }
bool DecodeBrotli(const base::StringPiece& encoded,
std::string& decoded) {
size_t decoded_size;
const uint8_t* encoded_response_buffer =
reinterpret_cast<const uint8_t*>(encoded.data());
if (!BrotliDecompressedSize(encoded.size(), encoded_response_buffer,
&decoded_size)) {
return false;
}
decoded.resize(decoded_size);
return BrotliDecompressBuffer(encoded.size(), encoded_response_buffer,
&decoded_size,
reinterpret_cast<uint8_t*>(&decoded[0])) ==
BROTLI_RESULT_SUCCESS;
}
class RedirectHandler : public CefResourceHandler { class RedirectHandler : public CefResourceHandler {
public: public:
explicit RedirectHandler(const GURL& url) explicit RedirectHandler(const GURL& url)
@ -172,16 +153,6 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
base::StringPiece piece = CefContentClient::Get()->GetDataResource( base::StringPiece piece = CefContentClient::Get()->GetDataResource(
action.resource_id, ui::SCALE_FACTOR_NONE); action.resource_id, ui::SCALE_FACTOR_NONE);
if (!piece.empty()) { if (!piece.empty()) {
std::string decoded;
if (action.encoding ==
InternalHandlerDelegate::Action::ENCODING_BROTLI &&
!DecodeBrotli(piece, decoded)) {
decoded = "Unable to decode content!";
}
if (!decoded.empty())
piece = base::StringPiece(decoded);
action.stream = action.stream =
CefStreamReader::CreateForData(const_cast<char*>(piece.data()), CefStreamReader::CreateForData(const_cast<char*>(piece.data()),
piece.size()); piece.size());
@ -212,8 +183,7 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
InternalHandlerDelegate::Action::Action() InternalHandlerDelegate::Action::Action()
: stream_size(-1), : stream_size(-1),
resource_id(-1), resource_id(-1) {
encoding(ENCODING_NONE) {
} }
CefRefPtr<CefSchemeHandlerFactory> CreateInternalHandlerFactory( CefRefPtr<CefSchemeHandlerFactory> CreateInternalHandlerFactory(

View File

@ -31,10 +31,6 @@ class InternalHandlerDelegate {
// Option 2: Specify a resource id to load static content. May include an // Option 2: Specify a resource id to load static content. May include an
// optional encoding type. // optional encoding type.
int resource_id; int resource_id;
enum Encoding {
ENCODING_NONE,
ENCODING_BROTLI,
} encoding;
// Option 3: Redirect to the specified URL. // Option 3: Redirect to the specified URL.
GURL redirect_url; GURL redirect_url;

View File

@ -337,19 +337,17 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
// Register internal scheme handlers that can be overridden. // Register internal scheme handlers that can be overridden.
scheme::RegisterInternalHandlers(url_request_manager_.get()); scheme::RegisterInternalHandlers(url_request_manager_.get());
request_interceptors_.push_back(new CefRequestInterceptor()); request_interceptors_.push_back(base::MakeUnique<CefRequestInterceptor>());
// Set up interceptors in the reverse order. // Set up interceptors in the reverse order.
std::unique_ptr<net::URLRequestJobFactory> top_job_factory = std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
std::move(job_factory); std::move(job_factory);
for (content::URLRequestInterceptorScopedVector::reverse_iterator i = for (auto i = request_interceptors_.rbegin();
request_interceptors_.rbegin(); i != request_interceptors_.rend(); ++i) {
i != request_interceptors_.rend();
++i) {
top_job_factory.reset(new net::URLRequestInterceptingJobFactory( top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
std::move(top_job_factory), base::WrapUnique(*i))); std::move(top_job_factory), std::move(*i)));
} }
request_interceptors_.weak_clear(); request_interceptors_.clear();
storage_->set_job_factory(std::move(top_job_factory)); storage_->set_job_factory(std::move(top_job_factory));

View File

@ -483,8 +483,10 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
content::ImageTransportFactory* factory = content::ImageTransportFactory* factory =
content::ImageTransportFactory::GetInstance(); content::ImageTransportFactory::GetInstance();
ui::ContextFactoryPrivate* context_factory_private =
factory->GetContextFactoryPrivate();
delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>( delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>(
factory->GetContextFactory()->AllocateFrameSinkId(), this); context_factory_private->AllocateFrameSinkId(), this);
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
#endif #endif
@ -494,7 +496,8 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
// On OS X the ui::Compositor is created/owned by the platform view. // On OS X the ui::Compositor is created/owned by the platform view.
compositor_.reset( compositor_.reset(
new ui::Compositor(content::GetContextFactory(), new ui::Compositor(context_factory_private->AllocateFrameSinkId(),
content::GetContextFactory(), context_factory_private,
base::ThreadTaskRunnerHandle::Get())); base::ThreadTaskRunnerHandle::Get()));
compositor_->SetAcceleratedWidget(compositor_widget_); compositor_->SetAcceleratedWidget(compositor_widget_);
compositor_->SetDelegate(this); compositor_->SetDelegate(this);
@ -679,7 +682,7 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
} }
} }
if (frame.delegated_frame_data) { if (!frame.render_pass_list.empty()) {
if (software_output_device_) { if (software_output_device_) {
if (!begin_frame_timer_.get()) { if (!begin_frame_timer_.get()) {
// If BeginFrame scheduling is enabled SoftwareOutputDevice activity // If BeginFrame scheduling is enabled SoftwareOutputDevice activity
@ -705,8 +708,7 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame(
// Determine the damage rectangle for the current frame. This is the same // Determine the damage rectangle for the current frame. This is the same
// calculation that SwapDelegatedFrame uses. // calculation that SwapDelegatedFrame uses.
cc::RenderPass* root_pass = cc::RenderPass* root_pass = frame.render_pass_list.back().get();
frame.delegated_frame_data->render_pass_list.back().get();
gfx::Size frame_size = root_pass->output_rect.size(); gfx::Size frame_size = root_pass->output_rect.size();
gfx::Rect damage_rect = gfx::Rect damage_rect =
gfx::ToEnclosingRect(gfx::RectF(root_pass->damage_rect)); gfx::ToEnclosingRect(gfx::RectF(root_pass->damage_rect));
@ -980,7 +982,9 @@ void CefRenderWidgetHostViewOSR::ImeCommitText(
return; return;
gfx::Range range(replacement_range.from, replacement_range.to); gfx::Range range(replacement_range.from, replacement_range.to);
render_widget_host_->ImeCommitText(text, range, relative_cursor_pos); render_widget_host_->ImeCommitText(
text, std::vector<blink::WebCompositionUnderline>(), range,
relative_cursor_pos);
// Stop Monitoring for composition updates after we are done. // Stop Monitoring for composition updates after we are done.
RequestImeCompositionUpdate(false); RequestImeCompositionUpdate(false);
@ -1205,7 +1209,7 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
const blink::WebMouseEvent& event) { const blink::WebMouseEvent& event) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseEvent"); TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseEvent");
if (!IsPopupWidget()) { if (!IsPopupWidget()) {
if (browser_impl_.get() && event.type == blink::WebMouseEvent::MouseDown) if (browser_impl_.get() && event.type() == blink::WebMouseEvent::MouseDown)
browser_impl_->CancelContextMenu(); browser_impl_->CancelContextMenu();
if (popup_host_view_ && if (popup_host_view_ &&
@ -1480,10 +1484,17 @@ void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time,
base::TimeTicks deadline = display_time - estimated_browser_composite_time; base::TimeTicks deadline = display_time - estimated_browser_composite_time;
const cc::BeginFrameArgs& begin_frame_args =
cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE,
begin_frame_source_.source_id(),
begin_frame_number_, frame_time, deadline,
vsync_period, cc::BeginFrameArgs::NORMAL);
DCHECK(begin_frame_args.IsValid());
begin_frame_number_++;
render_widget_host_->Send(new ViewMsg_BeginFrame( render_widget_host_->Send(new ViewMsg_BeginFrame(
render_widget_host_->GetRoutingID(), render_widget_host_->GetRoutingID(),
cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE, frame_time, deadline, begin_frame_args));
vsync_period, cc::BeginFrameArgs::NORMAL)));
} }
void CefRenderWidgetHostViewOSR::CancelWidget() { void CefRenderWidgetHostViewOSR::CancelWidget() {

View File

@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "cc/scheduler/begin_frame_source.h"
#include "content/browser/renderer_host/delegated_frame_host.h" #include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "ui/compositor/compositor.h" #include "ui/compositor/compositor.h"
@ -316,6 +317,10 @@ class CefRenderWidgetHostViewOSR
// is enabled. // is enabled.
std::unique_ptr<CefBeginFrameTimer> begin_frame_timer_; std::unique_ptr<CefBeginFrameTimer> begin_frame_timer_;
// Provides |source_id| for BeginFrameArgs that we create.
cc::StubBeginFrameSource begin_frame_source_;
uint64_t begin_frame_number_ = cc::BeginFrameArgs::kStartingFrameNumber;
// Used for direct rendering from the compositor when GPU compositing is // Used for direct rendering from the compositor when GPU compositing is
// disabled. This object is owned by the compositor. // disabled. This object is owned by the compositor.
CefSoftwareOutputDeviceOSR* software_output_device_; CefSoftwareOutputDeviceOSR* software_output_device_;

View File

@ -115,6 +115,55 @@ int ToCursorID(WebCursorInfo::Type type) {
return 0; return 0;
} }
// The following XCursorCache code was deleted from ui/base/x/x11_util.cc in
// https://crbug.com/665574#c2
// A process wide singleton that manages the usage of X cursors.
class XCursorCache {
public:
XCursorCache() {}
~XCursorCache() {
Clear();
}
::Cursor GetCursor(int cursor_shape) {
// Lookup cursor by attempting to insert a null value, which avoids
// a second pass through the map after a cache miss.
std::pair<std::map<int, ::Cursor>::iterator, bool> it = cache_.insert(
std::make_pair(cursor_shape, 0));
if (it.second) {
XDisplay* display = gfx::GetXDisplay();
it.first->second = XCreateFontCursor(display, cursor_shape);
}
return it.first->second;
}
void Clear() {
XDisplay* display = gfx::GetXDisplay();
for (std::map<int, ::Cursor>::iterator it =
cache_.begin(); it != cache_.end(); ++it) {
XFreeCursor(display, it->second);
}
cache_.clear();
}
private:
// Maps X11 font cursor shapes to Cursor IDs.
std::map<int, ::Cursor> cache_;
DISALLOW_COPY_AND_ASSIGN(XCursorCache);
};
XCursorCache* cursor_cache = nullptr;
// Returns an X11 Cursor, sharable across the process.
// |cursor_shape| is an X font cursor shape, see XCreateFontCursor().
::Cursor GetXCursor(int cursor_shape) {
if (!cursor_cache)
cursor_cache = new XCursorCache;
return cursor_cache->GetCursor(cursor_shape);
}
} // namespace } // namespace
void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() { void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
@ -142,6 +191,6 @@ ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor(
} }
return invisible_cursor_->get(); return invisible_cursor_->get();
} else { } else {
return ui::GetXCursor(ToCursorID(type)); return GetXCursor(ToCursorID(type));
} }
} }

View File

@ -201,9 +201,10 @@ int CefPermissionManager::RequestPermissions(
content::WebContents::FromRenderFrameHost(render_frame_host); content::WebContents::FromRenderFrameHost(render_frame_host);
GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin();
PendingRequest* pending_request = new PendingRequest( std::unique_ptr<PendingRequest> pending_request =
render_frame_host, permissions, callback); base::MakeUnique<PendingRequest>(
int request_id = pending_requests_.Add(pending_request); render_frame_host, permissions, callback);
int request_id = pending_requests_.Add(std::move(pending_request));
const PermissionRequestID request(render_frame_host, request_id); const PermissionRequestID request(render_frame_host, request_id);
@ -316,7 +317,7 @@ int CefPermissionManager::SubscribePermissionStatusChange(
if (subscriptions_.IsEmpty()) if (subscriptions_.IsEmpty())
profile_->GetHostContentSettingsMap()->AddObserver(this); profile_->GetHostContentSettingsMap()->AddObserver(this);
Subscription* subscription = new Subscription(); std::unique_ptr<Subscription> subscription = base::MakeUnique<Subscription>();
subscription->permission = permission; subscription->permission = permission;
subscription->requesting_origin = requesting_origin; subscription->requesting_origin = requesting_origin;
subscription->embedding_origin = embedding_origin; subscription->embedding_origin = embedding_origin;
@ -327,7 +328,7 @@ int CefPermissionManager::SubscribePermissionStatusChange(
subscription->requesting_origin, subscription->requesting_origin,
subscription->embedding_origin)); subscription->embedding_origin));
return subscriptions_.Add(subscription); return subscriptions_.Add(std::move(subscription));
} }
void CefPermissionManager::UnsubscribePermissionStatusChange( void CefPermissionManager::UnsubscribePermissionStatusChange(

View File

@ -68,10 +68,10 @@ class CefPermissionManager : public KeyedService,
private: private:
class PendingRequest; class PendingRequest;
using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>; using PendingRequestsMap = IDMap<std::unique_ptr<PendingRequest>>;
struct Subscription; struct Subscription;
using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>; using SubscriptionsMap = IDMap<std::unique_ptr<Subscription>>;
// Called when a permission was decided for a given PendingRequest. The // Called when a permission was decided for a given PendingRequest. The
// PendingRequest is identified by its |request_id| and the permission is // PendingRequest is identified by its |request_id| and the permission is

View File

@ -54,7 +54,7 @@ void RegisterLocalizedValue(PrefRegistrySimple* registry,
const std::string resource_string = l10n_util::GetStringUTF8(message_id); const std::string resource_string = l10n_util::GetStringUTF8(message_id);
DCHECK(!resource_string.empty()); DCHECK(!resource_string.empty());
switch (type) { switch (type) {
case base::Value::TYPE_BOOLEAN: { case base::Value::Type::BOOLEAN: {
if ("true" == resource_string) if ("true" == resource_string)
registry->RegisterBooleanPref(path, true); registry->RegisterBooleanPref(path, true);
else if ("false" == resource_string) else if ("false" == resource_string)
@ -62,21 +62,21 @@ void RegisterLocalizedValue(PrefRegistrySimple* registry,
return; return;
} }
case base::Value::TYPE_INTEGER: { case base::Value::Type::INTEGER: {
int val; int val;
base::StringToInt(resource_string, &val); base::StringToInt(resource_string, &val);
registry->RegisterIntegerPref(path, val); registry->RegisterIntegerPref(path, val);
return; return;
} }
case base::Value::TYPE_DOUBLE: { case base::Value::Type::DOUBLE: {
double val; double val;
base::StringToDouble(resource_string, &val); base::StringToDouble(resource_string, &val);
registry->RegisterDoublePref(path, val); registry->RegisterDoublePref(path, val);
return; return;
} }
case base::Value::TYPE_STRING: { case base::Value::Type::STRING: {
registry->RegisterStringPref(path, resource_string); registry->RegisterStringPref(path, resource_string);
return; return;
} }
@ -190,7 +190,7 @@ std::unique_ptr<PrefService> CreatePrefService(
} else { } else {
RegisterLocalizedValue(registry.get(), RegisterLocalizedValue(registry.get(),
spellcheck::prefs::kSpellCheckDictionary, spellcheck::prefs::kSpellCheckDictionary,
base::Value::TYPE_STRING, base::Value::Type::STRING,
IDS_SPELLCHECK_DICTIONARY); IDS_SPELLCHECK_DICTIONARY);
} }
registry->RegisterBooleanPref( registry->RegisterBooleanPref(

View File

@ -13,10 +13,10 @@
#include "libcef/common/extensions/extensions_util.h" #include "libcef/common/extensions/extensions_util.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/i18n/character_encoding.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/defaults.h" #include "chrome/browser/defaults.h"
#include "chrome/browser/extensions/extension_webkit_preferences.h" #include "chrome/browser/extensions/extension_webkit_preferences.h"
#include "chrome/browser/font_family_cache.h" #include "chrome/browser/font_family_cache.h"
@ -36,6 +36,7 @@
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/view_type_utils.h" #include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "media/media_features.h"
namespace renderer_prefs { namespace renderer_prefs {
@ -141,7 +142,7 @@ void SetChromePrefs(CefBrowserContext* profile,
} }
// Make sure we will set the default_encoding with canonical encoding name. // Make sure we will set the default_encoding with canonical encoding name.
web.default_encoding = GetCanonicalEncodingNameByAliasName( web.default_encoding = base::GetCanonicalEncodingNameByAliasName(
web.default_encoding); web.default_encoding);
if (web.default_encoding.empty()) { if (web.default_encoding.empty()) {
prefs->ClearPref(prefs::kDefaultCharset); prefs->ClearPref(prefs::kDefaultCharset);
@ -336,7 +337,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
false, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if defined(ENABLE_WEBRTC) #if BUILDFLAG(ENABLE_WEBRTC)
// TODO(guoweis): Remove next 2 options at M50. // TODO(guoweis): Remove next 2 options at M50.
registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true); registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true); registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);

View File

@ -16,7 +16,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/file_util_proxy.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
@ -160,9 +159,9 @@ void CefPrintDialogLinux::OnPrintStart(int render_process_id,
return; return;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
extensions::GetOwnerBrowserForView(render_process_id, extensions::GetOwnerBrowserForFrame(render_process_id,
render_routing_id, render_routing_id,
NULL); NULL);
if (browser.get()) if (browser.get())
handler->OnPrintStart(browser.get()); handler->OnPrintStart(browser.get());
} }
@ -326,12 +325,9 @@ void CefPrintDialogLinux::OnPrintCancel() {
} }
void CefPrintDialogLinux::OnJobCompleted() { void CefPrintDialogLinux::OnJobCompleted() {
base::FileUtilProxy::DeleteFile( content::BrowserThread::PostTask(
content::BrowserThread::GetTaskRunnerForThread( content::BrowserThread::FILE, FROM_HERE,
BrowserThread::FILE).get(), base::Bind(base::IgnoreResult(&base::DeleteFile), path_to_pdf_, false));
path_to_pdf_,
false,
base::FileUtilProxy::StatusCallback());
// Printing finished. Matches AddRef() in PrintDocument(); // Printing finished. Matches AddRef() in PrintDocument();
Release(); Release();

View File

@ -247,14 +247,12 @@ void CefPrintingMessageFilter::OnUpdatePrintSettings(
} }
printer_query = queue_->PopPrinterQuery(document_cookie); printer_query = queue_->PopPrinterQuery(document_cookie);
if (!printer_query.get()) { if (!printer_query.get()) {
int host_id = render_process_id_; int host_id;
int routing_id = reply_msg->routing_id(); int routing_id;
if (!new_settings->GetInteger(printing::kPreviewInitiatorHostId, if (!new_settings->GetInteger(kPreviewInitiatorHostId, &host_id) ||
&host_id) || !new_settings->GetInteger(kPreviewInitiatorRoutingId, &routing_id)) {
!new_settings->GetInteger(printing::kPreviewInitiatorRoutingId,
&routing_id)) {
host_id = content::ChildProcessHost::kInvalidUniqueID; host_id = content::ChildProcessHost::kInvalidUniqueID;
routing_id = content::ChildProcessHost::kInvalidUniqueID; routing_id = MSG_ROUTING_NONE;
} }
printer_query = queue_->CreatePrinterQuery(host_id, routing_id); printer_query = queue_->CreatePrinterQuery(host_id, routing_id);
} }
@ -276,11 +274,11 @@ void CefPrintingMessageFilter::OnUpdatePrintSettingsReply(
params.params.document_cookie = printer_query->cookie(); params.params.document_cookie = printer_query->cookie();
params.pages = PageRange::GetPages(printer_query->settings().ranges()); params.pages = PageRange::GetPages(printer_query->settings().ranges());
} }
PrintHostMsg_UpdatePrintSettings::WriteReplyParams(
reply_msg, bool canceled = printer_query.get() &&
params, (printer_query->last_status() == PrintingContext::CANCEL);
printer_query.get() && PrintHostMsg_UpdatePrintSettings::WriteReplyParams(reply_msg, params,
(printer_query->last_status() == printing::PrintingContext::CANCEL)); canceled);
Send(reply_msg); Send(reply_msg);
// If user hasn't cancelled. // If user hasn't cancelled.
if (printer_query.get()) { if (printer_query.get()) {

View File

@ -28,21 +28,21 @@ base::StaticAtomicSequenceNumber g_next_id;
const char* GetTypeString(base::Value::Type type) { const char* GetTypeString(base::Value::Type type) {
switch (type) { switch (type) {
case base::Value::TYPE_NULL: case base::Value::Type::NONE:
return "NULL"; return "NULL";
case base::Value::TYPE_BOOLEAN: case base::Value::Type::BOOLEAN:
return "BOOLEAN"; return "BOOLEAN";
case base::Value::TYPE_INTEGER: case base::Value::Type::INTEGER:
return "INTEGER"; return "INTEGER";
case base::Value::TYPE_DOUBLE: case base::Value::Type::DOUBLE:
return "DOUBLE"; return "DOUBLE";
case base::Value::TYPE_STRING: case base::Value::Type::STRING:
return "STRING"; return "STRING";
case base::Value::TYPE_BINARY: case base::Value::Type::BINARY:
return "BINARY"; return "BINARY";
case base::Value::TYPE_DICTIONARY: case base::Value::Type::DICTIONARY:
return "DICTIONARY"; return "DICTIONARY";
case base::Value::TYPE_LIST: case base::Value::Type::LIST:
return "LIST"; return "LIST";
} }

View File

@ -81,7 +81,8 @@ CefStoragePartitionProxy::GetBackgroundSyncContext() {
return parent_->GetBackgroundSyncContext(); return parent_->GetBackgroundSyncContext();
} }
content::PaymentAppContext* CefStoragePartitionProxy::GetPaymentAppContext() { content::PaymentAppContextImpl*
CefStoragePartitionProxy::GetPaymentAppContext() {
return parent_->GetPaymentAppContext(); return parent_->GetPaymentAppContext();
} }

View File

@ -37,7 +37,7 @@ class CefStoragePartitionProxy : public content::StoragePartition {
content::PlatformNotificationContext* GetPlatformNotificationContext() content::PlatformNotificationContext* GetPlatformNotificationContext()
override; override;
content::BackgroundSyncContext* GetBackgroundSyncContext() override; content::BackgroundSyncContext* GetBackgroundSyncContext() override;
content::PaymentAppContext* GetPaymentAppContext() override; content::PaymentAppContextImpl* GetPaymentAppContext() override;
content::BroadcastChannelProvider* GetBroadcastChannelProvider() override; content::BroadcastChannelProvider* GetBroadcastChannelProvider() override;
void ClearDataForOrigin(uint32_t remove_mask, void ClearDataForOrigin(uint32_t remove_mask,
uint32_t quota_storage_remove_mask, uint32_t quota_storage_remove_mask,

View File

@ -111,7 +111,7 @@ CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetEnabledTextColors(
CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetFontList( CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetFontList(
const CefString& font_list) { const CefString& font_list) {
CEF_REQUIRE_VALID_RETURN_VOID(); CEF_REQUIRE_VALID_RETURN_VOID();
ParentClass::root_view()->SetFontList(gfx::FontList(font_list)); ParentClass::root_view()->SetFontListDeprecated(gfx::FontList(font_list));
} }
CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetHorizontalAlignment( CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetHorizontalAlignment(

View File

@ -50,7 +50,7 @@ bool CefScrollViewImpl::HasHorizontalScrollbar() {
int CefScrollViewImpl::GetHorizontalScrollbarHeight() { int CefScrollViewImpl::GetHorizontalScrollbarHeight() {
CEF_REQUIRE_VALID_RETURN(0); CEF_REQUIRE_VALID_RETURN(0);
return root_view()->GetScrollBarHeight(); return root_view()->GetScrollBarLayoutHeight();
} }
bool CefScrollViewImpl::HasVerticalScrollbar() { bool CefScrollViewImpl::HasVerticalScrollbar() {
@ -61,7 +61,7 @@ bool CefScrollViewImpl::HasVerticalScrollbar() {
int CefScrollViewImpl::GetVerticalScrollbarWidth() { int CefScrollViewImpl::GetVerticalScrollbarWidth() {
CEF_REQUIRE_VALID_RETURN(0); CEF_REQUIRE_VALID_RETURN(0);
return root_view()->GetScrollBarWidth(); return root_view()->GetScrollBarLayoutWidth();
} }
void CefScrollViewImpl::GetDebugInfo(base::DictionaryValue* info, void CefScrollViewImpl::GetDebugInfo(base::DictionaryValue* info,

View File

@ -224,6 +224,18 @@ class CaptionlessFrameView : public views::NonClientFrameView {
DISALLOW_COPY_AND_ASSIGN(CaptionlessFrameView); DISALLOW_COPY_AND_ASSIGN(CaptionlessFrameView);
}; };
bool IsWindowBorderHit(int code) {
// On Windows HTLEFT = 10 and HTBORDER = 18. Values are not ordered the same
// in base/hit_test.h for non-Windows platforms.
#if defined(OS_WIN)
return code >= HTLEFT && code <= HTBORDER;
#else
return code == HTLEFT || code == HTRIGHT || code == HTTOP ||
code == HTTOPLEFT || code == HTTOPRIGHT || code == HTBOTTOM ||
code == HTBOTTOMLEFT || code == HTBOTTOMRIGHT || code == HTBORDER;
#endif
}
} // namespace } // namespace
CefWindowView::CefWindowView(CefWindowDelegate* cef_delegate, CefWindowView::CefWindowView(CefWindowDelegate* cef_delegate,
@ -393,7 +405,7 @@ bool CefWindowView::ShouldDescendIntoChildForEventHandling(
views::NonClientFrameView* ncfv = GetNonClientFrameView(); views::NonClientFrameView* ncfv = GetNonClientFrameView();
if (ncfv) { if (ncfv) {
int result = ncfv->NonClientHitTest(location); int result = ncfv->NonClientHitTest(location);
if (result >= HTLEFT && result <= HTBORDER) if (IsWindowBorderHit(result))
return false; return false;
} }
} }

View File

@ -216,31 +216,21 @@ void CefContentClient::AddPepperPlugins(
plugins->push_back(plugin); plugins->push_back(plugin);
} }
void CefContentClient::AddAdditionalSchemes( void CefContentClient::AddAdditionalSchemes(Schemes* schemes) {
std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) {
DCHECK(!scheme_info_list_locked_); DCHECK(!scheme_info_list_locked_);
if (application_.get()) { if (application_.get()) {
CefRefPtr<CefSchemeRegistrarImpl> schemeRegistrar( CefRefPtr<CefSchemeRegistrarImpl> schemeRegistrar(
new CefSchemeRegistrarImpl()); new CefSchemeRegistrarImpl());
application_->OnRegisterCustomSchemes(schemeRegistrar.get()); application_->OnRegisterCustomSchemes(schemeRegistrar.get());
schemeRegistrar->GetStandardSchemes(&standard_schemes_); schemeRegistrar->GetSchemes(schemes);
// No references to the registar should be kept. // No references to the registar should be kept.
schemeRegistrar->Detach(); schemeRegistrar->Detach();
DCHECK(schemeRegistrar->VerifyRefCount()); DCHECK(schemeRegistrar->VerifyRefCount());
} }
scheme::AddInternalSchemes(&standard_schemes_, savable_schemes); scheme::AddInternalSchemes(schemes);
// The |standard_schemes_| values will be referenced until the current call
// stack unwinds. They will be passed to url::AddStandardScheme.
for (size_t i = 0; i < standard_schemes_.size(); ++i) {
standard_schemes->push_back(
{standard_schemes_[i].c_str(), url::SCHEME_WITHOUT_PORT});
}
scheme_info_list_locked_ = true; scheme_info_list_locked_ = true;
} }

View File

@ -33,10 +33,7 @@ class CefContentClient : public content::ContentClient,
// content::ContentClient methods. // content::ContentClient methods.
void AddPepperPlugins( void AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) override; std::vector<content::PepperPluginInfo>* plugins) override;
void AddAdditionalSchemes( void AddAdditionalSchemes(Schemes* schemes) override;
std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) override;
std::string GetUserAgent() const override; std::string GetUserAgent() const override;
base::string16 GetLocalizedString(int message_id) const override; base::string16 GetLocalizedString(int message_id) const override;
base::StringPiece GetDataResource( base::StringPiece GetDataResource(
@ -46,31 +43,46 @@ class CefContentClient : public content::ContentClient,
int resource_id) const override; int resource_id) const override;
gfx::Image& GetNativeImageNamed(int resource_id) const override; gfx::Image& GetNativeImageNamed(int resource_id) const override;
// Values are registered with all processes (url/url_util.h) and with Blink
// (SchemeRegistry) unless otherwise indicated.
struct SchemeInfo { struct SchemeInfo {
// Lower-case ASCII scheme name.
std::string scheme_name; std::string scheme_name;
// Registers a non-HTTP URL scheme which can be sent CORS requests. // A scheme that is subject to URL canonicalization and parsing rules as
// defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1
// available at http://www.ietf.org/rfc/rfc1738.txt.
// This value is not registered with Blink.
bool is_standard; bool is_standard;
// Registers a URL scheme that can be saved to disk. // A scheme that will be treated the same as "file". For example, normal
bool is_savable; // pages cannot link to or access URLs of this scheme.
// Registers a URL scheme to be treated as a local scheme (i.e., with the
// same security rules as those applied to "file" URLs). This means that
// normal pages cannot link to or access URLs of this scheme.
bool is_local; bool is_local;
// Registers a URL scheme to be treated as display-isolated. This means // A scheme that can only be displayed from other content hosted with the
// that pages cannot display these URLs unless they are from the same // same scheme. For example, pages in other origins cannot create iframes or
// scheme. For example, pages in other origin cannot create iframes or
// hyperlinks to URLs with the scheme. For schemes that must be accessible // hyperlinks to URLs with the scheme. For schemes that must be accessible
// from other schemes set this value to false and use CORS // from other schemes set this value to false, set |is_cors_enabled| to
// "Access-Control-Allow-Origin" headers to further restrict access. // true, and use CORS "Access-Control-Allow-Origin" headers to further
// restrict access.
// This value is registered with Blink only.
bool is_display_isolated; bool is_display_isolated;
// A scheme that will be treated the same as "https". For example, loading
// this scheme from other secure schemes will not trigger mixed content
// warnings.
bool is_secure;
// A scheme that can be sent CORS requests. This value should be true in
// most cases where |is_standard| is true.
bool is_cors_enabled;
}; };
typedef std::list<SchemeInfo> SchemeInfoList; typedef std::list<SchemeInfo> SchemeInfoList;
// Custom scheme registration. // Custom scheme information will be registered first with all processes
// (url/url_util.h) via CefContentClient::AddAdditionalSchemes which calls
// AddCustomScheme, and second with Blink (SchemeRegistry) via
// CefContentRendererClient::WebKitInitialized which calls GetCustomSchemes.
void AddCustomScheme(const SchemeInfo& scheme_info); void AddCustomScheme(const SchemeInfo& scheme_info);
const SchemeInfoList* GetCustomSchemes(); const SchemeInfoList* GetCustomSchemes();
bool HasCustomScheme(const std::string& scheme_name); bool HasCustomScheme(const std::string& scheme_name);
@ -112,8 +124,6 @@ class CefContentClient : public content::ContentClient,
// Custom schemes handled by the client. // Custom schemes handled by the client.
SchemeInfoList scheme_info_list_; SchemeInfoList scheme_info_list_;
bool scheme_info_list_locked_; bool scheme_info_list_locked_;
std::vector<std::string> standard_schemes_;
}; };
#endif // CEF_LIBCEF_COMMON_CONTENT_CLIENT_H_ #endif // CEF_LIBCEF_COMMON_CONTENT_CLIENT_H_

View File

@ -52,7 +52,6 @@ typedef base::string16 PathString;
const char kPathSep = '\\'; const char kPathSep = '\\';
#else #else
typedef std::string PathString; typedef std::string PathString;
const char kPathSep = '/';
#endif #endif
PathString GetCrashConfigPath() { PathString GetCrashConfigPath() {
@ -93,6 +92,8 @@ PathString GetCrashConfigPath() {
#endif // defined(OS_POSIX) #endif // defined(OS_POSIX)
} }
#if defined(OS_WIN)
// On Windows, FAT32 and NTFS both limit filenames to a maximum of 255 // On Windows, FAT32 and NTFS both limit filenames to a maximum of 255
// characters. On POSIX systems, the typical filename length limit is 255 // characters. On POSIX systems, the typical filename length limit is 255
// character units. HFS+'s limit is actually 255 Unicode characters using // character units. HFS+'s limit is actually 255 Unicode characters using
@ -100,8 +101,6 @@ PathString GetCrashConfigPath() {
// really worth dealing with here. // really worth dealing with here.
const unsigned maxFilenameLength = 255; const unsigned maxFilenameLength = 255;
#if defined(OS_WIN)
const char kInvalidFileChars[] = "<>:\"/\\|?*"; const char kInvalidFileChars[] = "<>:\"/\\|?*";
bool isInvalidFileCharacter(unsigned char c) { bool isInvalidFileCharacter(unsigned char c) {
@ -139,35 +138,6 @@ std::string extractAbsolutePathStart(std::string& s) {
return start; return start;
} }
#elif defined(OS_POSIX)
bool isInvalidFileCharacter(unsigned char c) {
// HFS+ disallows '/' and Linux systems also disallow null. For sanity's sake
// we'll also disallow control characters.
return c < ' ' || c == 0x7F || c == kPathSep;
}
bool isAbsolutePath(const std::string& s) {
// Check for local paths (beginning with "/") and network paths (beginning
// with "//").
return s.length() > 1 && s[0] == kPathSep;
}
std::string extractAbsolutePathStart(std::string& s) {
if (!isAbsolutePath(s))
return std::string();
// May have multiple '/' at the beginning of the path.
std::string start;
do {
s = s.substr(1);
start.push_back(kPathSep);
} while (s.length() > 0 && s[0] == kPathSep);
return start;
}
#endif // defined(OS_POSIX)
std::string sanitizePathComponentPart(const std::string& s) { std::string sanitizePathComponentPart(const std::string& s) {
if (s.empty()) if (s.empty())
return std::string(); return std::string();
@ -239,12 +209,10 @@ std::string joinPath(const std::string& s1, const std::string& s2) {
if (s2.empty()) if (s2.empty())
return s1; return s1;
#if defined(OS_WIN)
// Don't try to join absolute paths on Windows. // Don't try to join absolute paths on Windows.
// Skip this check on POSIX where it's more difficult to differentiate. // Skip this check on POSIX where it's more difficult to differentiate.
if (isAbsolutePath(s2)) if (isAbsolutePath(s2))
return s2; return s2;
#endif
std::string result = s1; std::string result = s1;
if (result[result.size() - 1] != kPathSep) if (result[result.size() - 1] != kPathSep)
@ -256,10 +224,11 @@ std::string joinPath(const std::string& s1, const std::string& s2) {
return result; return result;
} }
#if defined(OS_WIN)
// This will only be non-nullptr in the chrome_elf address space. // This will only be non-nullptr in the chrome_elf address space.
CefCrashReporterClient* g_crash_reporter_client = nullptr; CefCrashReporterClient* g_crash_reporter_client = nullptr;
#endif
#endif // defined(OS_WIN)
} // namespace } // namespace
@ -286,6 +255,63 @@ bool __declspec(dllexport) __cdecl GetCrashKeyImpl(size_t index,
} // extern "C" } // extern "C"
// The below functions were deleted from chrome/install_static/install_util.cc
// in https://crbug.com/565446#c17.
constexpr wchar_t kUserDataDirname[] = L"User Data";
// Populates |result| with the default User Data directory for the current
// user.This may be overidden by a command line option. Returns false if all
// attempts at locating a User Data directory fail.
bool GetDefaultUserDataDirectory(
std::wstring* result,
const std::wstring& install_sub_directory) {
// This environment variable should be set on Windows Vista and later
// (https://msdn.microsoft.com/library/windows/desktop/dd378457.aspx).
std::wstring user_data_dir =
install_static::GetEnvironmentString16(L"LOCALAPPDATA");
if (user_data_dir.empty()) {
// LOCALAPPDATA was not set; fallback to the temporary files path.
DWORD size = ::GetTempPath(0, nullptr);
if (!size)
return false;
user_data_dir.resize(size + 1);
size = ::GetTempPath(size + 1, &user_data_dir[0]);
if (!size || size >= user_data_dir.size())
return false;
user_data_dir.resize(size);
}
result->swap(user_data_dir);
if ((*result)[result->length() - 1] != L'\\')
result->push_back(L'\\');
result->append(install_sub_directory);
result->push_back(L'\\');
result->append(kUserDataDirname);
return true;
}
// Populates |crash_dir| with the default crash dump location regardless of
// whether DIR_USER_DATA or DIR_CRASH_DUMPS has been overridden.
bool GetDefaultCrashDumpLocation(
std::wstring* crash_dir,
const std::wstring& install_sub_directory) {
// In order to be able to start crash handling very early, we do not rely on
// chrome's PathService entries (for DIR_CRASH_DUMPS) being available on
// Windows. See https://crbug.com/564398.
if (!GetDefaultUserDataDirectory(crash_dir, install_sub_directory))
return false;
// We have to make sure the user data dir exists on first run. See
// http://crbug.com/591504.
if (!install_static::RecursiveDirectoryCreate(*crash_dir))
return false;
crash_dir->append(L"\\Crashpad");
return true;
}
#endif // OS_WIN #endif // OS_WIN
CefCrashReporterClient::CefCrashReporterClient() {} CefCrashReporterClient::CefCrashReporterClient() {}
@ -379,8 +405,11 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
if (!val_str.empty()) if (!val_str.empty())
external_handler_ = sanitizePath(val_str); external_handler_ = sanitizePath(val_str);
} else if (name_str == "AppName") { } else if (name_str == "AppName") {
if (!val_str.empty()) if (!val_str.empty()) {
app_name_ = sanitizePathComponent(val_str); val_str = sanitizePathComponent(val_str);
if (!val_str.empty())
app_name_ = val_str;
}
} }
#endif #endif
} else if (current_section == kCrashKeysSection) { } else if (current_section == kCrashKeysSection) {
@ -436,8 +465,8 @@ void CefCrashReporterClient::InitializeCrashReportingForProcess() {
if (!g_crash_reporter_client->ReadCrashConfigFile()) if (!g_crash_reporter_client->ReadCrashConfigFile())
return; return;
std::string process_type = install_static::GetSwitchValueFromCommandLine( std::wstring process_type = install_static::GetSwitchValueFromCommandLine(
::GetCommandLineA(), install_static::kProcessType); ::GetCommandLineW(), install_static::kProcessType);
if (process_type != install_static::kCrashpadHandler) { if (process_type != install_static::kCrashpadHandler) {
crash_reporter::SetCrashReporterClient(g_crash_reporter_client); crash_reporter::SetCrashReporterClient(g_crash_reporter_client);
@ -447,9 +476,10 @@ void CefCrashReporterClient::InitializeCrashReportingForProcess() {
!g_crash_reporter_client->HasCrashExternalHandler(); !g_crash_reporter_client->HasCrashExternalHandler();
if (embedded_handler) { if (embedded_handler) {
crash_reporter::InitializeCrashpadWithEmbeddedHandler( crash_reporter::InitializeCrashpadWithEmbeddedHandler(
process_type.empty(), process_type); process_type.empty(), install_static::UTF16ToUTF8(process_type));
} else { } else {
crash_reporter::InitializeCrashpad(process_type.empty(), process_type); crash_reporter::InitializeCrashpad(
process_type.empty(), install_static::UTF16ToUTF8(process_type));
} }
} }
} }
@ -481,14 +511,12 @@ bool CefCrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) {
if (GetAlternativeCrashDumpLocation(crash_dir)) if (GetAlternativeCrashDumpLocation(crash_dir))
return true; return true;
return install_static::GetDefaultCrashDumpLocation( return GetDefaultCrashDumpLocation(crash_dir, base::UTF8ToUTF16(app_name_));
crash_dir, base::UTF8ToUTF16(app_name_));
} }
bool CefCrashReporterClient::GetCrashMetricsLocation( bool CefCrashReporterClient::GetCrashMetricsLocation(
base::string16* metrics_dir) { base::string16* metrics_dir) {
return install_static::GetDefaultUserDataDirectory( return GetDefaultUserDataDirectory(metrics_dir, base::UTF8ToUTF16(app_name_));
metrics_dir, base::UTF8ToUTF16(app_name_));
} }
#elif defined(OS_POSIX) #elif defined(OS_POSIX)

View File

@ -124,6 +124,10 @@ bool IsBoringCEFSwitch(const std::string& flag) {
} // namespace } // namespace
bool Enabled() {
return g_crash_reporting_enabled;
}
#if defined(OS_POSIX) #if defined(OS_POSIX)
// Be aware that logging is not initialized at the time this method is called. // Be aware that logging is not initialized at the time this method is called.
void BasicStartupComplete(base::CommandLine* command_line) { void BasicStartupComplete(base::CommandLine* command_line) {
@ -182,7 +186,7 @@ void ZygoteForked(base::CommandLine* command_line,
} // namespace crash_reporting } // namespace crash_reporting
bool CefCrashReportingEnabled() { bool CefCrashReportingEnabled() {
return crash_reporting::g_crash_reporting_enabled; return crash_reporting::Enabled();
} }
void CefSetCrashKeyValue(const CefString& key, const CefString& value) { void CefSetCrashKeyValue(const CefString& key, const CefString& value) {

View File

@ -12,6 +12,9 @@ class CommandLine;
namespace crash_reporting { namespace crash_reporting {
// Returns true if crash reporting is enabled.
bool Enabled();
// Functions are called from similarly named methods in CefMainDelegate. // Functions are called from similarly named methods in CefMainDelegate.
#if defined(OS_POSIX) #if defined(OS_POSIX)

View File

@ -6,6 +6,8 @@
#include "libcef/common/crash_reporting_win.h" #include "libcef/common/crash_reporting_win.h"
#include "libcef/common/crash_reporting.h"
#include "base/debug/crash_logging.h" #include "base/debug/crash_logging.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
@ -117,4 +119,17 @@ bool InitializeCrashReportingForModule() {
return false; return false;
} }
void BlockUntilHandlerStarted() {
if (!crash_reporting::Enabled())
return;
HMODULE chrome_elf = GetModuleHandle(chrome::kChromeElfDllName);
if (chrome_elf) {
auto block_until_handler_started = reinterpret_cast<void (*)()>(
GetProcAddress(chrome_elf, "BlockUntilHandlerStartedImpl"));
if (block_until_handler_started)
block_until_handler_started();
}
}
} // namespace crash_reporting_win } // namespace crash_reporting_win

View File

@ -8,4 +8,8 @@ namespace crash_reporting_win {
// state from chrome_elf via exported functions. // state from chrome_elf via exported functions.
bool InitializeCrashReportingForModule(); bool InitializeCrashReportingForModule();
// Called from libcef early in main process startup to ensure that the crash
// handler process is started before other sub-processes are created.
void BlockUntilHandlerStarted();
} // namespace crash_reporting_win } // namespace crash_reporting_win

View File

@ -42,7 +42,7 @@ import("//tools/json_schema_compiler/json_features.gni")
#} #}
json_features("cef_api_features") { json_features("cef_api_features") {
feature_class = "APIFeature" feature_type = "APIFeature"
provider_class = "CefAPIFeatureProvider" provider_class = "CefAPIFeatureProvider"
sources = [ sources = [
"//extensions/common/api/_api_features.json", "//extensions/common/api/_api_features.json",
@ -51,7 +51,7 @@ json_features("cef_api_features") {
} }
json_features("cef_permission_features") { json_features("cef_permission_features") {
feature_class = "PermissionFeature" feature_type = "PermissionFeature"
provider_class = "CefPermissionFeatureProvider" provider_class = "CefPermissionFeatureProvider"
sources = [ sources = [
"//extensions/common/api/_permission_features.json", "//extensions/common/api/_permission_features.json",
@ -60,7 +60,7 @@ json_features("cef_permission_features") {
} }
json_features("cef_manifest_features") { json_features("cef_manifest_features") {
feature_class = "ManifestFeature" feature_type = "ManifestFeature"
provider_class = "CefManifestFeatureProvider" provider_class = "CefManifestFeatureProvider"
sources = [ sources = [
# Use the same manifest features as Chrome. # Use the same manifest features as Chrome.
@ -70,7 +70,7 @@ json_features("cef_manifest_features") {
} }
json_features("cef_behavior_features") { json_features("cef_behavior_features") {
feature_class = "BehaviorFeature" feature_type = "BehaviorFeature"
provider_class = "CefBehaviorFeatureProvider" provider_class = "CefBehaviorFeatureProvider"
sources = [ sources = [
"//extensions/common/api/_behavior_features.json", "//extensions/common/api/_behavior_features.json",

View File

@ -24,11 +24,7 @@
#include "extensions/common/common_manifest_handlers.h" #include "extensions/common/common_manifest_handlers.h"
#include "extensions/common/extensions_aliases.h" #include "extensions/common/extensions_aliases.h"
#include "extensions/common/extension_urls.h" #include "extensions/common/extension_urls.h"
#include "extensions/common/features/api_feature.h"
#include "extensions/common/features/behavior_feature.h"
#include "extensions/common/features/json_feature_provider_source.h" #include "extensions/common/features/json_feature_provider_source.h"
#include "extensions/common/features/manifest_feature.h"
#include "extensions/common/features/permission_feature.h"
#include "extensions/common/features/simple_feature.h" #include "extensions/common/features/simple_feature.h"
#include "extensions/common/manifest_handler.h" #include "extensions/common/manifest_handler.h"
#include "extensions/common/permissions/permission_message_provider.h" #include "extensions/common/permissions/permission_message_provider.h"
@ -48,7 +44,9 @@ SimpleFeature* CreateFeature() {
} // namespace } // namespace
CefExtensionsClient::CefExtensionsClient() { CefExtensionsClient::CefExtensionsClient()
: webstore_base_url_(extension_urls::kChromeWebstoreBaseURL),
webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) {
} }
CefExtensionsClient::~CefExtensionsClient() { CefExtensionsClient::~CefExtensionsClient() {
@ -177,13 +175,11 @@ bool CefExtensionsClient::ShouldSuppressFatalErrors() const {
void CefExtensionsClient::RecordDidSuppressFatalError() { void CefExtensionsClient::RecordDidSuppressFatalError() {
} }
std::string CefExtensionsClient::GetWebstoreBaseURL() const { const GURL& CefExtensionsClient::GetWebstoreBaseURL() const {
return extension_urls::kChromeWebstoreBaseURL; return webstore_base_url_;
} }
const GURL& CefExtensionsClient::GetWebstoreUpdateURL() const { const GURL& CefExtensionsClient::GetWebstoreUpdateURL() const {
if (webstore_update_url_.is_empty())
webstore_update_url_ = GURL(extension_urls::GetWebstoreUpdateUrl());
return webstore_update_url_; return webstore_update_url_;
} }

View File

@ -44,7 +44,7 @@ class CefExtensionsClient : public ExtensionsClient {
base::StringPiece GetAPISchema(const std::string& name) const override; base::StringPiece GetAPISchema(const std::string& name) const override;
bool ShouldSuppressFatalErrors() const override; bool ShouldSuppressFatalErrors() const override;
void RecordDidSuppressFatalError() override; void RecordDidSuppressFatalError() override;
std::string GetWebstoreBaseURL() const override; const GURL& GetWebstoreBaseURL() const override;
const GURL& GetWebstoreUpdateURL() const override; const GURL& GetWebstoreUpdateURL() const override;
bool IsBlacklistUpdateURL(const GURL& url) const override; bool IsBlacklistUpdateURL(const GURL& url) const override;
@ -56,7 +56,8 @@ class CefExtensionsClient : public ExtensionsClient {
ScriptingWhitelist scripting_whitelist_; ScriptingWhitelist scripting_whitelist_;
// Mutable to allow caching in a const method. // Mutable to allow caching in a const method.
mutable GURL webstore_update_url_; const GURL webstore_base_url_;
const GURL webstore_update_url_;
DISALLOW_COPY_AND_ASSIGN(CefExtensionsClient); DISALLOW_COPY_AND_ASSIGN(CefExtensionsClient);
}; };

View File

@ -13,24 +13,36 @@
namespace scheme { namespace scheme {
void AddInternalSchemes(std::vector<std::string>* standard_schemes, void AddInternalSchemes(content::ContentClient::Schemes* schemes) {
std::vector<std::string>* savable_schemes) {
// chrome: and chrome-devtools: schemes are registered in // chrome: and chrome-devtools: schemes are registered in
// RenderThreadImpl::RegisterSchemes(). // RenderThreadImpl::RegisterSchemes().
// Access restrictions for chrome-extension: and chrome-extension-resource: // Access restrictions for chrome-extension: and chrome-extension-resource:
// schemes will be applied in CefContentRendererClient::WillSendRequest(). // schemes will be applied in CefContentRendererClient::WillSendRequest().
static CefContentClient::SchemeInfo schemes[] = { static CefContentClient::SchemeInfo internal_schemes[] = {
{ extensions::kExtensionScheme, true, true, false, false }, {
{ extensions::kExtensionResourceScheme, true, true, false, false }, extensions::kExtensionScheme,
true, /* is_standard */
false, /* is_local */
false, /* is_display_isolated */
true, /* is_secure */
true /* is_cors_enabled */
},
}; };
// The |is_display_isolated| value is excluded here because it's registered
// with Blink only.
CefContentClient* client = CefContentClient::Get(); CefContentClient* client = CefContentClient::Get();
for (size_t i = 0; i < sizeof(schemes) / sizeof(schemes[0]); ++i) { for (size_t i = 0; i < sizeof(internal_schemes) / sizeof(internal_schemes[0]);
if (schemes[i].is_standard) ++i) {
standard_schemes->push_back(schemes[i].scheme_name); if (internal_schemes[i].is_standard)
if (schemes[i].is_savable) schemes->standard_schemes.push_back(internal_schemes[i].scheme_name);
savable_schemes->push_back(schemes[i].scheme_name); if (internal_schemes[i].is_local)
client->AddCustomScheme(schemes[i]); schemes->local_schemes.push_back(internal_schemes[i].scheme_name);
if (internal_schemes[i].is_secure)
schemes->secure_schemes.push_back(internal_schemes[i].scheme_name);
if (internal_schemes[i].is_cors_enabled)
schemes->cors_enabled_schemes.push_back(internal_schemes[i].scheme_name);
client->AddCustomScheme(internal_schemes[i]);
} }
} }
@ -40,10 +52,12 @@ bool IsInternalHandledScheme(const std::string& scheme) {
content::kChromeDevToolsScheme, content::kChromeDevToolsScheme,
content::kChromeUIScheme, content::kChromeUIScheme,
extensions::kExtensionScheme, extensions::kExtensionScheme,
extensions::kExtensionResourceScheme,
url::kDataScheme, url::kDataScheme,
url::kFileScheme, url::kFileScheme,
url::kFileSystemScheme, url::kFileSystemScheme,
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
url::kFtpScheme,
#endif
}; };
for (size_t i = 0; i < sizeof(schemes) / sizeof(schemes[0]); ++i) { for (size_t i = 0; i < sizeof(schemes) / sizeof(schemes[0]); ++i) {
@ -62,7 +76,6 @@ bool IsInternalProtectedScheme(const std::string& scheme) {
url::kBlobScheme, url::kBlobScheme,
content::kChromeUIScheme, content::kChromeUIScheme,
extensions::kExtensionScheme, extensions::kExtensionScheme,
extensions::kExtensionResourceScheme,
url::kDataScheme, url::kDataScheme,
url::kFileScheme, url::kFileScheme,
url::kFileSystemScheme, url::kFileSystemScheme,

View File

@ -9,11 +9,12 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "content/public/common/content_client.h"
namespace scheme { namespace scheme {
// Add internal schemes. // Add internal schemes.
void AddInternalSchemes(std::vector<std::string>* standard_schemes, void AddInternalSchemes(content::ContentClient::Schemes* schemes);
std::vector<std::string>* savable_schemes);
// Returns true if the specified |scheme| is handled internally. // Returns true if the specified |scheme| is handled internally.
bool IsInternalHandledScheme(const std::string& scheme); bool IsInternalHandledScheme(const std::string& scheme);

View File

@ -123,7 +123,7 @@ CefRefPtr<CefBinaryValue> CefBase64Decode(const CefString& data) {
} }
CefString CefURIEncode(const CefString& text, bool use_plus) { CefString CefURIEncode(const CefString& text, bool use_plus) {
return net::EscapeQueryParamValue(text, use_plus); return net::EscapeQueryParamValue(text.ToString(), use_plus);
} }
CefString CefURIDecode(const CefString& text, CefString CefURIDecode(const CefString& text,

View File

@ -543,7 +543,7 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) {
::GetHeaderMap(request, headermap_, referrer_url_); ::GetHeaderMap(request, headermap_, referrer_url_);
referrer_policy_ = referrer_policy_ =
static_cast<cef_referrer_policy_t>(request.referrerPolicy()); static_cast<cef_referrer_policy_t>(request.getReferrerPolicy());
const blink::WebHTTPBody& body = request.httpBody(); const blink::WebHTTPBody& body = request.httpBody();
if (!body.isNull()) { if (!body.isNull()) {
@ -565,6 +565,7 @@ void CefRequestImpl::Get(blink::WebURLRequest& request,
int64& upload_data_size) const { int64& upload_data_size) const {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
request.setRequestContext(blink::WebURLRequest::RequestContextInternal);
request.setURL(url_); request.setURL(url_);
request.setHTTPMethod(blink::WebString::fromUTF8(method_)); request.setHTTPMethod(blink::WebString::fromUTF8(method_));

View File

@ -7,9 +7,22 @@
#include <string> #include <string>
#include "libcef/common/content_client.h" #include "libcef/common/content_client.h"
#include "libcef/common/net/scheme_registration.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string_util.h"
namespace {
void AppendArray(const std::vector<std::string>& source,
std::vector<std::string>* target) {
if (source.empty())
return;
target->insert(target->end(), source.begin(), source.end());
}
}
CefSchemeRegistrarImpl::CefSchemeRegistrarImpl() CefSchemeRegistrarImpl::CefSchemeRegistrarImpl()
: supported_thread_id_(base::PlatformThread::CurrentId()) { : supported_thread_id_(base::PlatformThread::CurrentId()) {
@ -19,32 +32,49 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(
const CefString& scheme_name, const CefString& scheme_name,
bool is_standard, bool is_standard,
bool is_local, bool is_local,
bool is_display_isolated) { bool is_display_isolated,
bool is_secure,
bool is_cors_enabled) {
if (!VerifyContext()) if (!VerifyContext())
return false; return false;
const std::string& scheme = scheme_name; const std::string& scheme = base::ToLowerASCII(scheme_name.ToString());
if (scheme::IsInternalHandledScheme(scheme) ||
registered_schemes_.find(scheme) != registered_schemes_.end()) {
return false;
}
registered_schemes_.insert(scheme);
// The |is_display_isolated| value is excluded here because it's registered
// with Blink only.
if (is_standard) if (is_standard)
standard_schemes_.push_back(scheme); schemes_.standard_schemes.push_back(scheme);
if (is_local)
schemes_.local_schemes.push_back(scheme);
if (is_secure)
schemes_.secure_schemes.push_back(scheme);
if (is_cors_enabled)
schemes_.cors_enabled_schemes.push_back(scheme);
CefContentClient::SchemeInfo scheme_info = { CefContentClient::SchemeInfo scheme_info = {
scheme, is_standard, is_local, is_display_isolated}; scheme, is_standard, is_local, is_display_isolated, is_secure,
is_cors_enabled
};
CefContentClient::Get()->AddCustomScheme(scheme_info); CefContentClient::Get()->AddCustomScheme(scheme_info);
return true; return true;
} }
void CefSchemeRegistrarImpl::GetStandardSchemes( void CefSchemeRegistrarImpl::GetSchemes(
std::vector<std::string>* standard_schemes) { content::ContentClient::Schemes* schemes) {
if (!VerifyContext()) if (!VerifyContext())
return; return;
if (standard_schemes_.empty()) AppendArray(schemes_.standard_schemes, &schemes->standard_schemes);
return; AppendArray(schemes_.local_schemes, &schemes->local_schemes);
AppendArray(schemes_.secure_schemes, &schemes->secure_schemes);
standard_schemes->insert(standard_schemes->end(), standard_schemes_.begin(), AppendArray(schemes_.cors_enabled_schemes, &schemes->cors_enabled_schemes);
standard_schemes_.end());
} }
bool CefSchemeRegistrarImpl::VerifyRefCount() { bool CefSchemeRegistrarImpl::VerifyRefCount() {

View File

@ -12,6 +12,7 @@
#include "include/cef_scheme.h" #include "include/cef_scheme.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "content/public/common/content_client.h"
class CefSchemeRegistrarImpl : public CefSchemeRegistrar { class CefSchemeRegistrarImpl : public CefSchemeRegistrar {
public: public:
@ -21,9 +22,11 @@ class CefSchemeRegistrarImpl : public CefSchemeRegistrar {
bool AddCustomScheme(const CefString& scheme_name, bool AddCustomScheme(const CefString& scheme_name,
bool is_standard, bool is_standard,
bool is_local, bool is_local,
bool is_display_isolated) override; bool is_display_isolated,
bool is_secure,
bool is_cors_enabled) override;
void GetStandardSchemes(std::vector<std::string>* standard_schemes); void GetSchemes(content::ContentClient::Schemes* schemes);
// Verify that only a single reference exists to all CefSchemeRegistrarImpl // Verify that only a single reference exists to all CefSchemeRegistrarImpl
// objects. // objects.
@ -37,7 +40,8 @@ class CefSchemeRegistrarImpl : public CefSchemeRegistrar {
base::PlatformThreadId supported_thread_id_; base::PlatformThreadId supported_thread_id_;
std::vector<std::string> standard_schemes_; content::ContentClient::Schemes schemes_;
std::set<std::string> registered_schemes_;
IMPLEMENT_REFCOUNTING(CefSchemeRegistrarImpl); IMPLEMENT_REFCOUNTING(CefSchemeRegistrarImpl);
DISALLOW_COPY_AND_ASSIGN(CefSchemeRegistrarImpl); DISALLOW_COPY_AND_ASSIGN(CefSchemeRegistrarImpl);

View File

@ -4,6 +4,8 @@
#include "libcef/common/time_util.h" #include "libcef/common/time_util.h"
#include "base/macros.h"
void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time) { void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time) {
base::Time::Exploded exploded; base::Time::Exploded exploded;
exploded.year = cef_time.year; exploded.year = cef_time.year;
@ -14,7 +16,7 @@ void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time) {
exploded.minute = cef_time.minute; exploded.minute = cef_time.minute;
exploded.second = cef_time.second; exploded.second = cef_time.second;
exploded.millisecond = cef_time.millisecond; exploded.millisecond = cef_time.millisecond;
time = base::Time::FromUTCExploded(exploded); ignore_result(base::Time::FromUTCExploded(exploded, &time));
} }
void cef_time_from_basetime(const base::Time& time, cef_time_t& cef_time) { void cef_time_from_basetime(const base::Time& time, cef_time_t& cef_time) {

View File

@ -24,20 +24,20 @@ CefRefPtr<CefValue> CefValueImpl::GetOrCreateRefOrCopy(
CefValueController* controller) { CefValueController* controller) {
DCHECK(value); DCHECK(value);
if (value->IsType(base::Value::TYPE_BINARY)) { if (value->IsType(base::Value::Type::BINARY)) {
base::BinaryValue* binary_value = static_cast<base::BinaryValue*>(value); base::BinaryValue* binary_value = static_cast<base::BinaryValue*>(value);
return new CefValueImpl(CefBinaryValueImpl::GetOrCreateRef( return new CefValueImpl(CefBinaryValueImpl::GetOrCreateRef(
binary_value, parent_value, controller)); binary_value, parent_value, controller));
} }
if (value->IsType(base::Value::TYPE_DICTIONARY)) { if (value->IsType(base::Value::Type::DICTIONARY)) {
base::DictionaryValue* dict_value = base::DictionaryValue* dict_value =
static_cast<base::DictionaryValue*>(value); static_cast<base::DictionaryValue*>(value);
return new CefValueImpl(CefDictionaryValueImpl::GetOrCreateRef( return new CefValueImpl(CefDictionaryValueImpl::GetOrCreateRef(
dict_value, parent_value, read_only, controller)); dict_value, parent_value, read_only, controller));
} }
if (value->IsType(base::Value::TYPE_LIST)) { if (value->IsType(base::Value::Type::LIST)) {
base::ListValue* list_value = static_cast<base::ListValue*>(value); base::ListValue* list_value = static_cast<base::ListValue*>(value);
return new CefValueImpl(CefListValueImpl::GetOrCreateRef( return new CefValueImpl(CefListValueImpl::GetOrCreateRef(
list_value, parent_value, read_only, controller)); list_value, parent_value, read_only, controller));
@ -221,15 +221,15 @@ CefValueType CefValueImpl::GetType() {
if (value_) { if (value_) {
switch (value_->GetType()) { switch (value_->GetType()) {
case base::Value::TYPE_NULL: case base::Value::Type::NONE:
return VTYPE_NULL; return VTYPE_NULL;
case base::Value::TYPE_BOOLEAN: case base::Value::Type::BOOLEAN:
return VTYPE_BOOL; return VTYPE_BOOL;
case base::Value::TYPE_INTEGER: case base::Value::Type::INTEGER:
return VTYPE_INT; return VTYPE_INT;
case base::Value::TYPE_DOUBLE: case base::Value::Type::DOUBLE:
return VTYPE_DOUBLE; return VTYPE_DOUBLE;
case base::Value::TYPE_STRING: case base::Value::Type::STRING:
return VTYPE_STRING; return VTYPE_STRING;
default: default:
NOTREACHED(); NOTREACHED();
@ -347,15 +347,15 @@ void CefValueImpl::SetValueInternal(base::Value* value) {
if (value) { if (value) {
switch (value->GetType()) { switch (value->GetType()) {
case base::Value::TYPE_BINARY: case base::Value::Type::BINARY:
binary_value_ = new CefBinaryValueImpl( binary_value_ = new CefBinaryValueImpl(
static_cast<base::BinaryValue*>(value), true); static_cast<base::BinaryValue*>(value), true);
return; return;
case base::Value::TYPE_DICTIONARY: case base::Value::Type::DICTIONARY:
dictionary_value_ = new CefDictionaryValueImpl( dictionary_value_ = new CefDictionaryValueImpl(
static_cast<base::DictionaryValue*>(value), true, false); static_cast<base::DictionaryValue*>(value), true, false);
return; return;
case base::Value::TYPE_LIST: case base::Value::Type::LIST:
list_value_ = new CefListValueImpl( list_value_ = new CefListValueImpl(
static_cast<base::ListValue*>(value), true, false); static_cast<base::ListValue*>(value), true, false);
return; return;
@ -731,21 +731,21 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) {
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value)) { &out_value)) {
switch (out_value->GetType()) { switch (out_value->GetType()) {
case base::Value::TYPE_NULL: case base::Value::Type::NONE:
return VTYPE_NULL; return VTYPE_NULL;
case base::Value::TYPE_BOOLEAN: case base::Value::Type::BOOLEAN:
return VTYPE_BOOL; return VTYPE_BOOL;
case base::Value::TYPE_INTEGER: case base::Value::Type::INTEGER:
return VTYPE_INT; return VTYPE_INT;
case base::Value::TYPE_DOUBLE: case base::Value::Type::DOUBLE:
return VTYPE_DOUBLE; return VTYPE_DOUBLE;
case base::Value::TYPE_STRING: case base::Value::Type::STRING:
return VTYPE_STRING; return VTYPE_STRING;
case base::Value::TYPE_BINARY: case base::Value::Type::BINARY:
return VTYPE_BINARY; return VTYPE_BINARY;
case base::Value::TYPE_DICTIONARY: case base::Value::Type::DICTIONARY:
return VTYPE_DICTIONARY; return VTYPE_DICTIONARY;
case base::Value::TYPE_LIST: case base::Value::Type::LIST:
return VTYPE_LIST; return VTYPE_LIST;
} }
} }
@ -825,7 +825,7 @@ CefRefPtr<CefBinaryValue> CefDictionaryValueImpl::GetBinary(
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
out_value->IsType(base::Value::TYPE_BINARY)) { out_value->IsType(base::Value::Type::BINARY)) {
base::BinaryValue* binary_value = base::BinaryValue* binary_value =
static_cast<base::BinaryValue*>(const_cast<base::Value*>(out_value)); static_cast<base::BinaryValue*>(const_cast<base::Value*>(out_value));
return CefBinaryValueImpl::GetOrCreateRef(binary_value, return CefBinaryValueImpl::GetOrCreateRef(binary_value,
@ -843,7 +843,7 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::GetDictionary(
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
out_value->IsType(base::Value::TYPE_DICTIONARY)) { out_value->IsType(base::Value::Type::DICTIONARY)) {
base::DictionaryValue* dict_value = base::DictionaryValue* dict_value =
static_cast<base::DictionaryValue*>( static_cast<base::DictionaryValue*>(
const_cast<base::Value*>(out_value)); const_cast<base::Value*>(out_value));
@ -864,7 +864,7 @@ CefRefPtr<CefListValue> CefDictionaryValueImpl::GetList(const CefString& key) {
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
out_value->IsType(base::Value::TYPE_LIST)) { out_value->IsType(base::Value::Type::LIST)) {
base::ListValue* list_value = base::ListValue* list_value =
static_cast<base::ListValue*>(const_cast<base::Value*>(out_value)); static_cast<base::ListValue*>(const_cast<base::Value*>(out_value));
return CefListValueImpl::GetOrCreateRef( return CefListValueImpl::GetOrCreateRef(
@ -966,8 +966,8 @@ bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) {
controller()->Remove(out_value.get(), true); controller()->Remove(out_value.get(), true);
// Only list and dictionary types may have dependencies. // Only list and dictionary types may have dependencies.
if (out_value->IsType(base::Value::TYPE_LIST) || if (out_value->IsType(base::Value::Type::LIST) ||
out_value->IsType(base::Value::TYPE_DICTIONARY)) { out_value->IsType(base::Value::Type::DICTIONARY)) {
controller()->RemoveDependencies(out_value.get()); controller()->RemoveDependencies(out_value.get());
} }
@ -1141,21 +1141,21 @@ CefValueType CefListValueImpl::GetType(size_t index) {
const base::Value* out_value = NULL; const base::Value* out_value = NULL;
if (const_value().Get(index, &out_value)) { if (const_value().Get(index, &out_value)) {
switch (out_value->GetType()) { switch (out_value->GetType()) {
case base::Value::TYPE_NULL: case base::Value::Type::NONE:
return VTYPE_NULL; return VTYPE_NULL;
case base::Value::TYPE_BOOLEAN: case base::Value::Type::BOOLEAN:
return VTYPE_BOOL; return VTYPE_BOOL;
case base::Value::TYPE_INTEGER: case base::Value::Type::INTEGER:
return VTYPE_INT; return VTYPE_INT;
case base::Value::TYPE_DOUBLE: case base::Value::Type::DOUBLE:
return VTYPE_DOUBLE; return VTYPE_DOUBLE;
case base::Value::TYPE_STRING: case base::Value::Type::STRING:
return VTYPE_STRING; return VTYPE_STRING;
case base::Value::TYPE_BINARY: case base::Value::Type::BINARY:
return VTYPE_BINARY; return VTYPE_BINARY;
case base::Value::TYPE_DICTIONARY: case base::Value::Type::DICTIONARY:
return VTYPE_DICTIONARY; return VTYPE_DICTIONARY;
case base::Value::TYPE_LIST: case base::Value::Type::LIST:
return VTYPE_LIST; return VTYPE_LIST;
} }
} }
@ -1232,7 +1232,7 @@ CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
const base::Value* out_value = NULL; const base::Value* out_value = NULL;
if (const_value().Get(index, &out_value) && if (const_value().Get(index, &out_value) &&
out_value->IsType(base::Value::TYPE_BINARY)) { out_value->IsType(base::Value::Type::BINARY)) {
base::BinaryValue* binary_value = base::BinaryValue* binary_value =
static_cast<base::BinaryValue*>(const_cast<base::Value*>(out_value)); static_cast<base::BinaryValue*>(const_cast<base::Value*>(out_value));
return CefBinaryValueImpl::GetOrCreateRef(binary_value, return CefBinaryValueImpl::GetOrCreateRef(binary_value,
@ -1248,7 +1248,7 @@ CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
const base::Value* out_value = NULL; const base::Value* out_value = NULL;
if (const_value().Get(index, &out_value) && if (const_value().Get(index, &out_value) &&
out_value->IsType(base::Value::TYPE_DICTIONARY)) { out_value->IsType(base::Value::Type::DICTIONARY)) {
base::DictionaryValue* dict_value = base::DictionaryValue* dict_value =
static_cast<base::DictionaryValue*>( static_cast<base::DictionaryValue*>(
const_cast<base::Value*>(out_value)); const_cast<base::Value*>(out_value));
@ -1268,7 +1268,7 @@ CefRefPtr<CefListValue> CefListValueImpl::GetList(size_t index) {
const base::Value* out_value = NULL; const base::Value* out_value = NULL;
if (const_value().Get(index, &out_value) && if (const_value().Get(index, &out_value) &&
out_value->IsType(base::Value::TYPE_LIST)) { out_value->IsType(base::Value::Type::LIST)) {
base::ListValue* list_value = base::ListValue* list_value =
static_cast<base::ListValue*>(const_cast<base::Value*>(out_value)); static_cast<base::ListValue*>(const_cast<base::Value*>(out_value));
return CefListValueImpl::GetOrCreateRef( return CefListValueImpl::GetOrCreateRef(
@ -1364,8 +1364,8 @@ bool CefListValueImpl::RemoveInternal(size_t index) {
controller()->Remove(out_value.get(), true); controller()->Remove(out_value.get(), true);
// Only list and dictionary types may have dependencies. // Only list and dictionary types may have dependencies.
if (out_value->IsType(base::Value::TYPE_LIST) || if (out_value->IsType(base::Value::Type::LIST) ||
out_value->IsType(base::Value::TYPE_DICTIONARY)) { out_value->IsType(base::Value::Type::DICTIONARY)) {
controller()->RemoveDependencies(out_value.get()); controller()->RemoveDependencies(out_value.get());
} }

View File

@ -20,7 +20,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/common/widevine_cdm_constants.h" #include "chrome/common/widevine_cdm_constants.h"
#include "content/browser/plugin_service_impl.h" #include "content/browser/plugin_service_impl.h"
#include "content/public/browser/cdm_service.h" #include "content/public/browser/cdm_registry.h"
#include "content/public/common/cdm_info.h" #include "content/public/common/cdm_info.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "media/cdm/supported_cdm_versions.h" #include "media/cdm/supported_cdm_versions.h"
@ -96,7 +96,7 @@ std::unique_ptr<base::DictionaryValue> ParseManifestFile(
JSONStringValueDeserializer deserializer(manifest_contents); JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY)) if (!manifest.get() || !manifest->IsType(base::Value::Type::DICTIONARY))
return nullptr; return nullptr;
// Transfer ownership to the caller. // Transfer ownership to the caller.
@ -281,11 +281,11 @@ void RegisterWidevineCdmOnUIThread(
content::PluginService::GetInstance()->RefreshPlugins(); content::PluginService::GetInstance()->RefreshPlugins();
content::PluginService::GetInstance()->PurgePluginListCache(NULL, false); content::PluginService::GetInstance()->PurgePluginListCache(NULL, false);
// Also register Widevine with the CdmService. // Also register Widevine with the CdmRegistry.
const std::vector<std::string> codecs = base::SplitString( const std::vector<std::string> codecs = base::SplitString(
cdm_codecs, std::string(1, kCdmSupportedCodecsValueDelimiter), cdm_codecs, std::string(1, kCdmSupportedCodecsValueDelimiter),
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
content::CdmService::GetInstance()->RegisterCdm(content::CdmInfo( content::CdmRegistry::GetInstance()->RegisterCdm(content::CdmInfo(
kWidevineCdmType, base::Version(cdm_version), cdm_path, codecs)); kWidevineCdmType, base::Version(cdm_version), cdm_path, codecs));
DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(), DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(),

View File

@ -109,8 +109,10 @@ bool CefBrowserImpl::IsLoading() {
void CefBrowserImpl::Reload() { void CefBrowserImpl::Reload() {
CEF_REQUIRE_RT_RETURN_VOID(); CEF_REQUIRE_RT_RETURN_VOID();
if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
render_view()->GetWebView()->mainFrame()->reload(); render_view()->GetWebView()->mainFrame()->reload(
blink::WebFrameLoadType::Reload);
}
} }
void CefBrowserImpl::ReloadIgnoreCache() { void CefBrowserImpl::ReloadIgnoreCache() {
@ -417,7 +419,7 @@ void CefBrowserImpl::DidFinishLoad(blink::WebLocalFrame* frame) {
blink::WebDataSource* ds = frame->dataSource(); blink::WebDataSource* ds = frame->dataSource();
Send(new CefHostMsg_DidFinishLoad(routing_id(), Send(new CefHostMsg_DidFinishLoad(routing_id(),
webkit_glue::GetIdentifier(frame), webkit_glue::GetIdentifier(frame),
ds->request().url(), ds->getRequest().url(),
!frame->parent(), !frame->parent(),
ds->response().httpStatusCode())); ds->response().httpStatusCode()));
OnLoadEnd(frame); OnLoadEnd(frame);

View File

@ -273,21 +273,21 @@ void CefContentRendererClient::WebKitInitialized() {
const CefContentClient::SchemeInfoList* schemes = const CefContentClient::SchemeInfoList* schemes =
CefContentClient::Get()->GetCustomSchemes(); CefContentClient::Get()->GetCustomSchemes();
if (!schemes->empty()) { if (!schemes->empty()) {
// Register the custom schemes. // Register the custom schemes. The |is_standard| value is excluded here
// because it's not explicitly registered with Blink.
CefContentClient::SchemeInfoList::const_iterator it = schemes->begin(); CefContentClient::SchemeInfoList::const_iterator it = schemes->begin();
for (; it != schemes->end(); ++it) { for (; it != schemes->end(); ++it) {
const CefContentClient::SchemeInfo& info = *it; const CefContentClient::SchemeInfo& info = *it;
const blink::WebString& scheme = const blink::WebString& scheme =
blink::WebString::fromUTF8(info.scheme_name); blink::WebString::fromUTF8(info.scheme_name);
if (info.is_standard) {
// Standard schemes must also be registered as CORS enabled to support
// CORS-restricted requests (for example, XMLHttpRequest redirects).
blink::WebSecurityPolicy::registerURLSchemeAsCORSEnabled(scheme);
}
if (info.is_local) if (info.is_local)
blink::WebSecurityPolicy::registerURLSchemeAsLocal(scheme); webkit_glue::registerURLSchemeAsLocal(scheme);
if (info.is_display_isolated) if (info.is_display_isolated)
blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(scheme); blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(scheme);
if (info.is_secure)
webkit_glue::registerURLSchemeAsSecure(scheme);
if (info.is_cors_enabled)
webkit_glue::registerURLSchemeAsCORSEnabled(scheme);
} }
} }
@ -517,7 +517,7 @@ bool CefContentRendererClient::OverrideCreatePlugin(
bool CefContentRendererClient::HandleNavigation( bool CefContentRendererClient::HandleNavigation(
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
bool is_content_initiated, bool is_content_initiated,
int opener_id, bool render_view_was_created_by_renderer,
blink::WebFrame* frame, blink::WebFrame* frame,
const blink::WebURLRequest& request, const blink::WebURLRequest& request,
blink::WebNavigationType type, blink::WebNavigationType type,
@ -596,7 +596,7 @@ bool CefContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
} }
bool CefContentRendererClient::WillSendRequest( bool CefContentRendererClient::WillSendRequest(
blink::WebFrame* frame, blink::WebLocalFrame* frame,
ui::PageTransition transition_type, ui::PageTransition transition_type,
const blink::WebURL& url, const blink::WebURL& url,
GURL* new_url) { GURL* new_url) {

View File

@ -99,7 +99,7 @@ class CefContentRendererClient : public content::ContentRendererClient,
blink::WebPlugin** plugin) override; blink::WebPlugin** plugin) override;
bool HandleNavigation(content::RenderFrame* render_frame, bool HandleNavigation(content::RenderFrame* render_frame,
bool is_content_initiated, bool is_content_initiated,
int opener_id, bool render_view_was_created_by_renderer,
blink::WebFrame* frame, blink::WebFrame* frame,
const blink::WebURLRequest& request, const blink::WebURLRequest& request,
blink::WebNavigationType type, blink::WebNavigationType type,
@ -111,7 +111,7 @@ class CefContentRendererClient : public content::ContentRendererClient,
bool is_initial_navigation, bool is_initial_navigation,
bool is_server_redirect, bool is_server_redirect,
bool* send_referrer) override; bool* send_referrer) override;
bool WillSendRequest(blink::WebFrame* frame, bool WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type, ui::PageTransition transition_type,
const blink::WebURL& url, const blink::WebURL& url,
GURL* new_url) override; GURL* new_url) override;

View File

@ -168,7 +168,7 @@ bool CefExtensionsRendererClient::OverrideCreatePlugin(
} }
bool CefExtensionsRendererClient::WillSendRequest( bool CefExtensionsRendererClient::WillSendRequest(
blink::WebFrame* frame, blink::WebLocalFrame* frame,
ui::PageTransition transition_type, ui::PageTransition transition_type,
const blink::WebURL& url, const blink::WebURL& url,
GURL* new_url) { GURL* new_url) {
@ -181,13 +181,6 @@ bool CefExtensionsRendererClient::WillSendRequest(
return true; return true;
} }
if (url.protocolIs(extensions::kExtensionResourceScheme) &&
!resource_request_policy_->CanRequestExtensionResourceScheme(url,
frame)) {
*new_url = GURL(chrome::kExtensionResourceInvalidRequestURL);
return true;
}
return false; return false;
} }

View File

@ -49,7 +49,7 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
void RenderViewCreated(content::RenderView* render_view); void RenderViewCreated(content::RenderView* render_view);
bool OverrideCreatePlugin(content::RenderFrame* render_frame, bool OverrideCreatePlugin(content::RenderFrame* render_frame,
const blink::WebPluginParams& params); const blink::WebPluginParams& params);
bool WillSendRequest(blink::WebFrame* frame, bool WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type, ui::PageTransition transition_type,
const blink::WebURL& url, const blink::WebURL& url,
GURL* new_url); GURL* new_url);

View File

@ -25,6 +25,7 @@
#include "gin/object_template_builder.h" #include "gin/object_template_builder.h"
#include "third_party/WebKit/public/platform/URLConversion.h" #include "third_party/WebKit/public/platform/URLConversion.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/platform/WebMouseEvent.h"
#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebScriptSource.h" #include "third_party/WebKit/public/web/WebScriptSource.h"
@ -164,12 +165,6 @@ bool CefPluginPlaceholder::OnMessageReceived(const IPC::Message& message) {
return false; return false;
} }
void CefPluginPlaceholder::OpenAboutPluginsCallback() {
// CEF does not use IDR_DISABLED_PLUGIN_HTML which would originate this
// callback for the chrome://plugins link.
NOTREACHED();
}
void CefPluginPlaceholder::ShowPermissionBubbleCallback() { void CefPluginPlaceholder::ShowPermissionBubbleCallback() {
// CEF does not use IDR_PREFER_HTML_PLUGIN_HTML which would originate this // CEF does not use IDR_PREFER_HTML_PLUGIN_HTML which would originate this
// callback. // callback.
@ -304,8 +299,6 @@ gin::ObjectTemplateBuilder CefPluginPlaceholder::GetObjectTemplateBuilder(
.SetMethod<void (CefPluginPlaceholder::*)()>( .SetMethod<void (CefPluginPlaceholder::*)()>(
"didFinishLoading", "didFinishLoading",
&CefPluginPlaceholder::DidFinishLoadingCallback) &CefPluginPlaceholder::DidFinishLoadingCallback)
.SetMethod("openAboutPlugins",
&CefPluginPlaceholder::OpenAboutPluginsCallback)
.SetMethod("showPermissionBubble", .SetMethod("showPermissionBubble",
&CefPluginPlaceholder::ShowPermissionBubbleCallback); &CefPluginPlaceholder::ShowPermissionBubbleCallback);

View File

@ -72,9 +72,6 @@ class CefPluginPlaceholder final
void OnMenuAction(int request_id, unsigned action) override; void OnMenuAction(int request_id, unsigned action) override;
void OnMenuClosed(int request_id) override; void OnMenuClosed(int request_id) override;
// Javascript callbacks:
// Open chrome://plugins in a new tab.
void OpenAboutPluginsCallback();
// Show the Plugins permission bubble. // Show the Plugins permission bubble.
void ShowPermissionBubbleCallback(); void ShowPermissionBubbleCallback();

View File

@ -14,7 +14,6 @@
namespace blink { namespace blink {
class WebLocalFrame; class WebLocalFrame;
class WebPlugin;
} }
class SkBitmap; class SkBitmap;

View File

@ -35,7 +35,6 @@ CefRenderFrameObserver::~CefRenderFrameObserver() {
void CefRenderFrameObserver::DidCreateScriptContext( void CefRenderFrameObserver::DidCreateScriptContext(
v8::Handle<v8::Context> context, v8::Handle<v8::Context> context,
int extension_group,
int world_id) { int world_id) {
blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); blink::WebLocalFrame* frame = render_frame()->GetWebFrame();

View File

@ -17,7 +17,6 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
~CefRenderFrameObserver() override; ~CefRenderFrameObserver() override;
void DidCreateScriptContext(v8::Handle<v8::Context> context, void DidCreateScriptContext(v8::Handle<v8::Context> context,
int extension_group,
int world_id) override; int world_id) override;
void WillReleaseScriptContext(v8::Handle<v8::Context> context, void WillReleaseScriptContext(v8::Handle<v8::Context> context,
int world_id) override; int world_id) override;

View File

@ -38,32 +38,25 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
// blink::WebURLLoaderClient methods. // blink::WebURLLoaderClient methods.
bool willFollowRedirect( bool willFollowRedirect(
WebURLLoader* loader,
WebURLRequest& newRequest, WebURLRequest& newRequest,
const WebURLResponse& redirectResponse) override; const WebURLResponse& redirectResponse) override;
void didSendData( void didSendData(
WebURLLoader* loader,
unsigned long long bytesSent, unsigned long long bytesSent,
unsigned long long totalBytesToBeSent) override; unsigned long long totalBytesToBeSent) override;
void didReceiveResponse( void didReceiveResponse(
WebURLLoader* loader,
const WebURLResponse& response) override; const WebURLResponse& response) override;
void didDownloadData(WebURLLoader* loader, void didDownloadData(int dataLength,
int dataLength,
int encodedDataLength) override; int encodedDataLength) override;
void didReceiveData(WebURLLoader* loader, void didReceiveData(const char* data,
const char* data, int dataLength) override;
int dataLength, void didReceiveCachedMetadata(const char* data,
int encodedDataLength,
int encodedBodyLength) override;
void didReceiveCachedMetadata(WebURLLoader* loader,
const char* data,
int dataLength) override; int dataLength) override;
void didFinishLoading(WebURLLoader* loader, void didFinishLoading(double finishTime,
double finishTime, int64_t totalEncodedDataLength,
int64_t totalEncodedDataLength) override; int64_t totalEncodedBodyLength) override;
void didFail(WebURLLoader* loader, void didFail(const WebURLError& error,
const WebURLError& error) override; int64_t totalEncodedDataLength,
int64_t totalEncodedBodyLength) override;
protected: protected:
// The context_ pointer will outlive this object. // The context_ pointer will outlive this object.
@ -252,14 +245,12 @@ CefWebURLLoaderClient::~CefWebURLLoaderClient() {
} }
bool CefWebURLLoaderClient::willFollowRedirect( bool CefWebURLLoaderClient::willFollowRedirect(
WebURLLoader* loader,
WebURLRequest& newRequest, WebURLRequest& newRequest,
const WebURLResponse& redirectResponse) { const WebURLResponse& redirectResponse) {
return true; return true;
} }
void CefWebURLLoaderClient::didSendData( void CefWebURLLoaderClient::didSendData(
WebURLLoader* loader,
unsigned long long bytesSent, unsigned long long bytesSent,
unsigned long long totalBytesToBeSent) { unsigned long long totalBytesToBeSent) {
if (request_flags_ & UR_FLAG_REPORT_UPLOAD_PROGRESS) if (request_flags_ & UR_FLAG_REPORT_UPLOAD_PROGRESS)
@ -267,40 +258,35 @@ void CefWebURLLoaderClient::didSendData(
} }
void CefWebURLLoaderClient::didReceiveResponse( void CefWebURLLoaderClient::didReceiveResponse(
WebURLLoader* loader,
const WebURLResponse& response) { const WebURLResponse& response) {
context_->OnResponse(response); context_->OnResponse(response);
} }
void CefWebURLLoaderClient::didDownloadData(WebURLLoader* loader, void CefWebURLLoaderClient::didDownloadData(int dataLength,
int dataLength,
int encodedDataLength) { int encodedDataLength) {
} }
void CefWebURLLoaderClient::didReceiveData(WebURLLoader* loader, void CefWebURLLoaderClient::didReceiveData(const char* data,
const char* data, int dataLength) {
int dataLength,
int encodedDataLength,
int encodedBodyLength) {
context_->OnDownloadProgress(dataLength); context_->OnDownloadProgress(dataLength);
if (!(request_flags_ & UR_FLAG_NO_DOWNLOAD_DATA)) if (!(request_flags_ & UR_FLAG_NO_DOWNLOAD_DATA))
context_->OnDownloadData(data, dataLength); context_->OnDownloadData(data, dataLength);
} }
void CefWebURLLoaderClient::didReceiveCachedMetadata(WebURLLoader* loader, void CefWebURLLoaderClient::didReceiveCachedMetadata(const char* data,
const char* data,
int dataLength) { int dataLength) {
} }
void CefWebURLLoaderClient::didFinishLoading(WebURLLoader* loader, void CefWebURLLoaderClient::didFinishLoading(double finishTime,
double finishTime, int64_t totalEncodedDataLength,
int64_t totalEncodedDataLength) { int64_t totalEncodedBodyLength) {
context_->OnComplete(); context_->OnComplete();
} }
void CefWebURLLoaderClient::didFail(WebURLLoader* loader, void CefWebURLLoaderClient::didFail(const WebURLError& error,
const WebURLError& error) { int64_t totalEncodedDataLength,
int64_t totalEncodedBodyLength) {
context_->OnError(error); context_->OnError(error);
} }

View File

@ -33,6 +33,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "third_party/WebKit/Source/core/editing/serializers/Serialization.h" #include "third_party/WebKit/Source/core/editing/serializers/Serialization.h"
#include "third_party/WebKit/Source/core/frame/LocalFrame.h" #include "third_party/WebKit/Source/core/frame/LocalFrame.h"
#include "third_party/WebKit/Source/core/frame/Settings.h" #include "third_party/WebKit/Source/core/frame/Settings.h"
#include "third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h"
#include "third_party/WebKit/Source/web/WebLocalFrameImpl.h" #include "third_party/WebKit/Source/web/WebLocalFrameImpl.h"
#include "third_party/WebKit/Source/web/WebViewImpl.h" #include "third_party/WebKit/Source/web/WebViewImpl.h"
MSVC_POP_WARNING(); MSVC_POP_WARNING();
@ -221,7 +222,7 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
if (frame) { if (frame) {
blink::V8CacheOptions v8CacheOptions(blink::V8CacheOptionsDefault); blink::V8CacheOptions v8CacheOptions(blink::V8CacheOptionsDefault);
if (frame && frame->settings()) if (frame && frame->settings())
v8CacheOptions = frame->settings()->v8CacheOptions(); v8CacheOptions = frame->settings()->getV8CacheOptions();
v8::Local<v8::Script> script; v8::Local<v8::Script> script;
if (!blink::v8Call(blink::V8ScriptRunner::compileScript(ssc, isolate, if (!blink::v8Call(blink::V8ScriptRunner::compileScript(ssc, isolate,
@ -240,4 +241,16 @@ bool IsScriptForbidden() {
return blink::ScriptForbiddenScope::isScriptForbidden(); return blink::ScriptForbiddenScope::isScriptForbidden();
} }
void registerURLSchemeAsLocal(const blink::WebString& scheme) {
blink::SchemeRegistry::registerURLSchemeAsLocal(scheme);
}
void registerURLSchemeAsSecure(const blink::WebString& scheme) {
blink::SchemeRegistry::registerURLSchemeAsSecure(scheme);
}
void registerURLSchemeAsCORSEnabled(const blink::WebString& scheme) {
blink::SchemeRegistry::registerURLSchemeAsCORSEnabled(scheme);
}
} // webkit_glue } // webkit_glue

View File

@ -67,6 +67,10 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
bool IsScriptForbidden(); bool IsScriptForbidden();
void registerURLSchemeAsLocal(const blink::WebString& scheme);
void registerURLSchemeAsSecure(const blink::WebString& scheme);
void registerURLSchemeAsCORSEnabled(const blink::WebString& scheme);
} // webkit_glue } // webkit_glue
#endif // CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ #endif // CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_

View File

@ -19,7 +19,8 @@ namespace {
int CEF_CALLBACK scheme_registrar_add_custom_scheme( int CEF_CALLBACK scheme_registrar_add_custom_scheme(
struct _cef_scheme_registrar_t* self, const cef_string_t* scheme_name, struct _cef_scheme_registrar_t* self, const cef_string_t* scheme_name,
int is_standard, int is_local, int is_display_isolated) { int is_standard, int is_local, int is_display_isolated, int is_secure,
int is_cors_enabled) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self); DCHECK(self);
@ -35,7 +36,9 @@ int CEF_CALLBACK scheme_registrar_add_custom_scheme(
CefString(scheme_name), CefString(scheme_name),
is_standard?true:false, is_standard?true:false,
is_local?true:false, is_local?true:false,
is_display_isolated?true:false); is_display_isolated?true:false,
is_secure?true:false,
is_cors_enabled?true:false);
// Return type: bool // Return type: bool
return _retval; return _retval;

View File

@ -16,7 +16,8 @@
// VIRTUAL METHODS - Body may be edited by hand. // VIRTUAL METHODS - Body may be edited by hand.
bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name, bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name,
bool is_standard, bool is_local, bool is_display_isolated) { bool is_standard, bool is_local, bool is_display_isolated, bool is_secure,
bool is_cors_enabled) {
cef_scheme_registrar_t* _struct = GetStruct(); cef_scheme_registrar_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, add_custom_scheme)) if (CEF_MEMBER_MISSING(_struct, add_custom_scheme))
return false; return false;
@ -33,7 +34,9 @@ bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name,
scheme_name.GetStruct(), scheme_name.GetStruct(),
is_standard, is_standard,
is_local, is_local,
is_display_isolated); is_display_isolated,
is_secure,
is_cors_enabled);
// Return type: bool // Return type: bool
return _retval?true:false; return _retval?true:false;

View File

@ -32,7 +32,8 @@ class CefSchemeRegistrarCToCpp
// CefSchemeRegistrar methods. // CefSchemeRegistrar methods.
bool AddCustomScheme(const CefString& scheme_name, bool is_standard, bool AddCustomScheme(const CefString& scheme_name, bool is_standard,
bool is_local, bool is_display_isolated) OVERRIDE; bool is_local, bool is_display_isolated, bool is_secure,
bool is_cors_enabled) OVERRIDE;
}; };
#endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ #endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_

View File

@ -267,10 +267,8 @@ patches = [
'path': '../', 'path': '../',
}, },
{ {
# Fix PDF extension loading after showing the plugin placeholder. # Fix plugin placeholder blocked message.
# https://bitbucket.org/chromiumembedded/cef/issues/2020/ # https://bitbucket.org/chromiumembedded/cef/issues/2020/
# Reverts https://codereview.chromium.org/2352673003 and
# https://codereview.chromium.org/2344023002
'name': 'webview_plugin_2020', 'name': 'webview_plugin_2020',
'path': '../', 'path': '../',
}, },

View File

@ -15,10 +15,10 @@ index 865b29f..ef44e27 100644
void SwapCompositorFrame(uint32_t compositor_frame_sink_id, void SwapCompositorFrame(uint32_t compositor_frame_sink_id,
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
index 4ff716d..aaf17b2 100644 index bd36336..9123781 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm --- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm +++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -199,6 +199,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { @@ -201,6 +201,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
g_spare_recyclable_compositors.Get().clear(); g_spare_recyclable_compositors.Get().clear();
} }
@ -31,7 +31,7 @@ index 4ff716d..aaf17b2 100644
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() { ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
if (recyclable_compositor_) if (recyclable_compositor_)
return recyclable_compositor_->accelerated_widget_mac(); return recyclable_compositor_->accelerated_widget_mac();
@@ -416,8 +422,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor( @@ -417,8 +423,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
} }
gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const { gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
index c628e20..3c4e008d 100644 index abb76e3..cdf5a84d 100644
--- render_widget_host_view_guest.cc --- render_widget_host_view_guest.cc
+++ render_widget_host_view_guest.cc +++ render_widget_host_view_guest.cc
@@ -253,13 +253,14 @@ void RenderWidgetHostViewGuest::Destroy() { @@ -254,13 +254,14 @@ void RenderWidgetHostViewGuest::Destroy() {
} }
gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {

View File

@ -1,5 +1,5 @@
diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc
index d4d4f14..977e24e 100644 index 97ea047..1efbcf9 100644
--- browser/browser_plugin/browser_plugin_guest.cc --- browser/browser_plugin/browser_plugin_guest.cc
+++ browser/browser_plugin/browser_plugin_guest.cc +++ browser/browser_plugin/browser_plugin_guest.cc
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
@ -36,7 +36,7 @@ index d4d4f14..977e24e 100644
} }
RendererPreferences* renderer_prefs = RendererPreferences* renderer_prefs =
@@ -796,11 +795,10 @@ void BrowserPluginGuest::OnWillAttachComplete( @@ -787,11 +786,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
->GetWidget() ->GetWidget()
->Init(); ->Init();
GetWebContents()->GetMainFrame()->Init(); GetWebContents()->GetMainFrame()->Init();

View File

@ -63,10 +63,10 @@ index 4b43013..169ca47 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito( content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context); content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index f715370..fb38098 100644 index 6554312..701cb0f 100644
--- chrome/browser/profiles/profile_manager.h --- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h
@@ -90,7 +90,7 @@ class ProfileManager : public base::NonThreadSafe, @@ -89,7 +89,7 @@ class ProfileManager : public base::NonThreadSafe,
// acceptable. Returns null if creation of the new profile fails. // acceptable. Returns null if creation of the new profile fails.
// TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then
// make this method private. // make this method private.
@ -75,7 +75,7 @@ index f715370..fb38098 100644
// Returns total number of profiles available on this machine. // Returns total number of profiles available on this machine.
size_t GetNumberOfProfiles(); size_t GetNumberOfProfiles();
@@ -118,7 +118,7 @@ class ProfileManager : public base::NonThreadSafe, @@ -117,7 +117,7 @@ class ProfileManager : public base::NonThreadSafe,
// Returns true if the profile pointer is known to point to an existing // Returns true if the profile pointer is known to point to an existing
// profile. // profile.
@ -84,7 +84,7 @@ index f715370..fb38098 100644
// Returns the directory where the first created profile is stored, // Returns the directory where the first created profile is stored,
// relative to the user data directory currently in use. // relative to the user data directory currently in use.
@@ -127,7 +127,7 @@ class ProfileManager : public base::NonThreadSafe, @@ -126,7 +126,7 @@ class ProfileManager : public base::NonThreadSafe,
// Get the Profile last used (the Profile to which owns the most recently // Get the Profile last used (the Profile to which owns the most recently
// focused window) with this Chrome build. If no signed profile has been // focused window) with this Chrome build. If no signed profile has been
// stored in Local State, hand back the Default profile. // stored in Local State, hand back the Default profile.

View File

@ -1,8 +1,8 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index bb7757b..532f036 100644 index 4255c1b..f4b197c 100644
--- chrome/common/chrome_content_client.cc --- chrome/common/chrome_content_client.cc
+++ chrome/common/chrome_content_client.cc +++ chrome/common/chrome_content_client.cc
@@ -78,7 +78,7 @@ @@ -80,7 +80,7 @@
#endif #endif
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && \ #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && \

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index 7d1cf0c..a806826 100644 index 072d500..c2cc813 100644
--- content/browser/compositor/gpu_process_transport_factory.cc --- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -196,6 +196,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() { @@ -199,6 +199,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
std::unique_ptr<cc::SoftwareOutputDevice> std::unique_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice( GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) { ui::Compositor* compositor) {
@ -13,11 +13,11 @@ index 7d1cf0c..a806826 100644
+ return output_device; + return output_device;
+ } + }
+ +
#if defined(USE_AURA) base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (service_manager::ServiceManagerIsRemote()) { if (command_line->HasSwitch(switches::kHeadless))
NOTREACHED(); return base::WrapUnique(new cc::SoftwareOutputDevice);
diff --git ui/compositor/compositor.h ui/compositor/compositor.h diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index 76f8f38..0fdc07b 100644 index 7ecc5e5..e77f545 100644
--- ui/compositor/compositor.h --- ui/compositor/compositor.h
+++ ui/compositor/compositor.h +++ ui/compositor/compositor.h
@@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
@ -28,7 +28,7 @@ index 76f8f38..0fdc07b 100644
#include "cc/surfaces/surface_sequence.h" #include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h" #include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h" #include "cc/trees/layer_tree_host_single_thread_client.h"
@@ -188,6 +189,17 @@ class COMPOSITOR_EXPORT CompositorLock @@ -194,6 +195,17 @@ class COMPOSITOR_EXPORT CompositorLock
DISALLOW_COPY_AND_ASSIGN(CompositorLock); DISALLOW_COPY_AND_ASSIGN(CompositorLock);
}; };
@ -46,7 +46,7 @@ index 76f8f38..0fdc07b 100644
// Compositor object to take care of GPU painting. // Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final // A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an // displayable form of pixels comprising a single widget's contents. It draws an
@@ -211,6 +223,9 @@ class COMPOSITOR_EXPORT Compositor @@ -223,6 +235,9 @@ class COMPOSITOR_EXPORT Compositor
// Schedules a redraw of the layer tree associated with this compositor. // Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw(); void ScheduleDraw();
@ -56,9 +56,9 @@ index 76f8f38..0fdc07b 100644
// Sets the root of the layer tree drawn by this Compositor. The root layer // 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 // 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 // is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -393,6 +408,8 @@ class COMPOSITOR_EXPORT Compositor @@ -406,6 +421,8 @@ class COMPOSITOR_EXPORT Compositor
ui::ContextFactory* context_factory_; ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;
+ CompositorDelegate* delegate_ = nullptr; + CompositorDelegate* delegate_ = nullptr;
+ +

View File

@ -1,8 +1,8 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
index 642521f..8fb647f 100644 index cc1d049a..8490e65 100644
--- public/renderer/content_renderer_client.cc --- public/renderer/content_renderer_client.cc
+++ public/renderer/content_renderer_client.cc +++ public/renderer/content_renderer_client.cc
@@ -100,7 +100,6 @@ bool ContentRendererClient::AllowPopup() { @@ -99,7 +99,6 @@ bool ContentRendererClient::AllowPopup() {
return false; return false;
} }
@ -10,7 +10,7 @@ index 642521f..8fb647f 100644
bool ContentRendererClient::HandleNavigation( bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame, RenderFrame* render_frame,
bool is_content_initiated, bool is_content_initiated,
@@ -113,6 +112,7 @@ bool ContentRendererClient::HandleNavigation( @@ -112,6 +111,7 @@ bool ContentRendererClient::HandleNavigation(
return false; return false;
} }
@ -19,10 +19,10 @@ index 642521f..8fb647f 100644
return false; return false;
} }
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index f2a854f..913e30c 100644 index 9895206..1f4626d 100644
--- public/renderer/content_renderer_client.h --- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h +++ public/renderer/content_renderer_client.h
@@ -204,7 +204,6 @@ class CONTENT_EXPORT ContentRendererClient { @@ -198,7 +198,6 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed. // Returns true if a popup window should be allowed.
virtual bool AllowPopup(); virtual bool AllowPopup();
@ -30,7 +30,7 @@ index f2a854f..913e30c 100644
// TODO(sgurun) This callback is deprecated and will be removed as soon // TODO(sgurun) This callback is deprecated and will be removed as soon
// as android webview completes implementation of a resource throttle based // as android webview completes implementation of a resource throttle based
// shouldoverrideurl implementation. See crbug.com/325351 // shouldoverrideurl implementation. See crbug.com/325351
@@ -220,6 +219,7 @@ class CONTENT_EXPORT ContentRendererClient { @@ -214,6 +213,7 @@ class CONTENT_EXPORT ContentRendererClient {
blink::WebNavigationPolicy default_policy, blink::WebNavigationPolicy default_policy,
bool is_redirect); bool is_redirect);
@ -39,18 +39,22 @@ index f2a854f..913e30c 100644
// built in media player for the given |url|. Defaults to false. // built in media player for the given |url|. Defaults to false.
virtual bool ShouldUseMediaPlayerForURL(const GURL& url); virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index 2f79ac0..7e0c73b 100644 index 2d93238..95969c4 100644
--- renderer/render_frame_impl.cc --- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc +++ renderer/render_frame_impl.cc
@@ -5112,7 +5112,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( @@ -5259,9 +5259,8 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ && (pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty()); !pending_navigation_params_->request_params.redirects.empty());
-#ifdef OS_ANDROID -#ifdef OS_ANDROID
- bool render_view_was_created_by_renderer =
- render_view_->was_created_by_renderer_;
+ // CEF doesn't use this value, so just pass false.
+ bool render_view_was_created_by_renderer = false;
// The handlenavigation API is deprecated and will be removed once // The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved. // crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation( if (GetContentClient()->renderer()->HandleNavigation(
@@ -5121,7 +5120,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( @@ -5270,7 +5269,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) { is_redirect)) {
return blink::WebNavigationPolicyIgnore; return blink::WebNavigationPolicyIgnore;
} }

View File

@ -31,7 +31,7 @@ index 6cd8b9f..dfbbdc6 100644
cflags = [ "/wd4201" ] cflags = [ "/wd4201" ]
} }
diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
index 800f704..e4b4063 100644 index c099a26..6fae782 100644
--- chrome/common/crash_keys.cc --- chrome/common/crash_keys.cc
+++ chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc
@@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
@ -43,7 +43,7 @@ index 800f704..e4b4063 100644
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/format_macros.h" #include "base/format_macros.h"
@@ -94,7 +96,7 @@ const char kViewCount[] = "view-count"; @@ -101,7 +103,7 @@ const char kViewCount[] = "view-count";
const char kZeroEncodeDetails[] = "zero-encode-details"; const char kZeroEncodeDetails[] = "zero-encode-details";
@ -52,7 +52,7 @@ index 800f704..e4b4063 100644
// The following keys may be chunked by the underlying crash logging system, // The following keys may be chunked by the underlying crash logging system,
// but ultimately constitute a single key-value pair. // but ultimately constitute a single key-value pair.
// //
@@ -250,10 +252,16 @@ size_t RegisterChromeCrashKeys() { @@ -259,10 +261,16 @@ size_t RegisterChromeCrashKeys() {
// This dynamic set of keys is used for sets of key value pairs when gathering // This dynamic set of keys is used for sets of key value pairs when gathering
// a collection of data, like command line switches or extension IDs. // a collection of data, like command line switches or extension IDs.
@ -71,7 +71,7 @@ index 800f704..e4b4063 100644
// Register the extension IDs. // Register the extension IDs.
{ {
@@ -287,7 +295,7 @@ size_t RegisterChromeCrashKeys() { @@ -296,7 +304,7 @@ size_t RegisterChromeCrashKeys() {
return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength); return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength);
} }
@ -80,7 +80,7 @@ index 800f704..e4b4063 100644
static const char* const kIgnoreSwitches[] = { static const char* const kIgnoreSwitches[] = {
switches::kEnableLogging, switches::kEnableLogging,
switches::kFlagSwitchesBegin, switches::kFlagSwitchesBegin,
@@ -343,7 +351,7 @@ static bool IsBoringSwitch(const std::string& flag) { @@ -352,7 +360,7 @@ static bool IsBoringSwitch(const std::string& flag) {
} }
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) { void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
@ -90,7 +90,7 @@ index 800f704..e4b4063 100644
void SetActiveExtensions(const std::set<std::string>& extensions) { void SetActiveExtensions(const std::set<std::string>& extensions) {
diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h
index 6f66031..1abcdf8 100644 index 2b6106c..cfe4548 100644
--- chrome/common/crash_keys.h --- chrome/common/crash_keys.h
+++ chrome/common/crash_keys.h +++ chrome/common/crash_keys.h
@@ -23,10 +23,18 @@ class CommandLine; @@ -23,10 +23,18 @@ class CommandLine;
@ -112,75 +112,8 @@ index 6f66031..1abcdf8 100644
// Sets the kNumSwitches key and the set of keys named using kSwitchFormat based // Sets the kNumSwitches key and the set of keys named using kSwitchFormat based
// on the given |command_line|. // on the given |command_line|.
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line); void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
diff --git chrome/install_static/install_util.cc chrome/install_static/install_util.cc
index edec76d..1db1c9c 100644
--- chrome/install_static/install_util.cc
+++ chrome/install_static/install_util.cc
@@ -473,7 +473,9 @@ bool IsNonBrowserProcess() {
return g_process_type == ProcessType::NON_BROWSER_PROCESS;
}
-bool GetDefaultUserDataDirectory(std::wstring* result) {
+bool GetDefaultUserDataDirectory(
+ std::wstring* result,
+ const std::wstring& install_sub_directory) {
// This environment variable should be set on Windows Vista and later
// (https://msdn.microsoft.com/library/windows/desktop/dd378457.aspx).
std::wstring user_data_dir = GetEnvironmentString16(L"LOCALAPPDATA");
@@ -493,17 +495,23 @@ bool GetDefaultUserDataDirectory(std::wstring* result) {
result->swap(user_data_dir);
if ((*result)[result->length() - 1] != L'\\')
result->push_back(L'\\');
- AppendChromeInstallSubDirectory(result, true /* include_suffix */);
+ if (!install_sub_directory.empty()) {
+ result->append(install_sub_directory);
+ } else {
+ AppendChromeInstallSubDirectory(result, true /* include_suffix */);
+ }
result->push_back(L'\\');
result->append(kUserDataDirname);
return true;
}
-bool GetDefaultCrashDumpLocation(std::wstring* crash_dir) {
+bool GetDefaultCrashDumpLocation(
+ std::wstring* crash_dir,
+ const std::wstring& install_sub_directory) {
// In order to be able to start crash handling very early, we do not rely on
// chrome's PathService entries (for DIR_CRASH_DUMPS) being available on
// Windows. See https://crbug.com/564398.
- if (!GetDefaultUserDataDirectory(crash_dir))
+ if (!GetDefaultUserDataDirectory(crash_dir, install_sub_directory))
return false;
// We have to make sure the user data dir exists on first run. See
diff --git chrome/install_static/install_util.h chrome/install_static/install_util.h
index 4ded522..81eba43 100644
--- chrome/install_static/install_util.h
+++ chrome/install_static/install_util.h
@@ -86,14 +86,18 @@ bool IsNonBrowserProcess();
// TODO(ananta)
// http://crbug.com/604923
// Unify this with the Browser Distribution code.
-bool GetDefaultUserDataDirectory(std::wstring* result);
+bool GetDefaultUserDataDirectory(
+ std::wstring* result,
+ const std::wstring& install_sub_directory = std::wstring());
// Populates |crash_dir| with the default crash dump location regardless of
// whether DIR_USER_DATA or DIR_CRASH_DUMPS has been overridden.
// TODO(ananta)
// http://crbug.com/604923
// Unify this with the Browser Distribution code.
-bool GetDefaultCrashDumpLocation(std::wstring* crash_dir);
+bool GetDefaultCrashDumpLocation(
+ std::wstring* crash_dir,
+ const std::wstring& install_sub_directory = std::wstring());
// Returns the contents of the specified |variable_name| from the environment
// block of the calling process. Returns an empty string if the variable does
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
index 0629b6f..9c150b5 100644 index c2861e0..7d6de6b 100644
--- chrome_elf/BUILD.gn --- chrome_elf/BUILD.gn
+++ chrome_elf/BUILD.gn +++ chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
@ -191,7 +124,7 @@ index 0629b6f..9c150b5 100644
import("//chrome/process_version_rc_template.gni") import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni") import("//testing/test.gni")
@@ -138,16 +139,40 @@ static_library("blacklist") { @@ -139,16 +140,40 @@ static_library("blacklist") {
static_library("crash") { static_library("crash") {
sources = [ sources = [
@ -270,7 +203,7 @@ index c658fa9..8c4a145 100644
g_crash_helper_enabled = true; g_crash_helper_enabled = true;
return true; return true;
diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc
index 9ebc33f..c013b36 100644 index 6e5058e..3dd2b56 100644
--- components/crash/content/app/breakpad_linux.cc --- components/crash/content/app/breakpad_linux.cc
+++ components/crash/content/app/breakpad_linux.cc +++ components/crash/content/app/breakpad_linux.cc
@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
@ -289,7 +222,7 @@ index 9ebc33f..c013b36 100644
#endif #endif
bool g_is_crash_reporter_enabled = false; bool g_is_crash_reporter_enabled = false;
@@ -654,7 +656,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, @@ -686,7 +688,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
info.process_type_length = 7; info.process_type_length = 7;
info.distro = base::g_linux_distro; info.distro = base::g_linux_distro;
info.distro_length = my_strlen(base::g_linux_distro); info.distro_length = my_strlen(base::g_linux_distro);
@ -298,7 +231,7 @@ index 9ebc33f..c013b36 100644
info.process_start_time = g_process_start_time; info.process_start_time = g_process_start_time;
info.oom_size = base::g_oom_size; info.oom_size = base::g_oom_size;
info.pid = g_pid; info.pid = g_pid;
@@ -1275,7 +1277,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, @@ -1299,7 +1301,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
header_content_encoding, header_content_encoding,
header_content_type, header_content_type,
post_file, post_file,
@ -307,7 +240,7 @@ index 9ebc33f..c013b36 100644
"--timeout=10", // Set a timeout so we don't hang forever. "--timeout=10", // Set a timeout so we don't hang forever.
"--tries=1", // Don't retry if the upload fails. "--tries=1", // Don't retry if the upload fails.
"-O", // output reply to fd 3 "-O", // output reply to fd 3
@@ -1880,6 +1882,17 @@ void InitCrashReporter(const std::string& process_type) { @@ -1906,6 +1908,17 @@ void InitCrashReporter(const std::string& process_type) {
PostEnableBreakpadInitialization(); PostEnableBreakpadInitialization();
} }
@ -326,7 +259,7 @@ index 9ebc33f..c013b36 100644
void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) { void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) {
const base::CommandLine* command_line = const base::CommandLine* command_line =
diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h
index 3316fa0..df90dbd 100644 index bbeb208..74440a0 100644
--- components/crash/content/app/breakpad_linux.h --- components/crash/content/app/breakpad_linux.h
+++ components/crash/content/app/breakpad_linux.h +++ components/crash/content/app/breakpad_linux.h
@@ -16,6 +16,9 @@ namespace breakpad { @@ -16,6 +16,9 @@ namespace breakpad {
@ -554,7 +487,7 @@ index 7df66ea..1e24110 100644
bool result = crashpad_client.StartHandler(handler_path, bool result = crashpad_client.StartHandler(handler_path,
database_path, database_path,
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
index a22af31..bde918e 100644 index 1e9c06c..8ed020d 100644
--- components/crash/content/app/crashpad_win.cc --- components/crash/content/app/crashpad_win.cc
+++ components/crash/content/app/crashpad_win.cc +++ components/crash/content/app/crashpad_win.cc
@@ -81,7 +81,7 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, @@ -81,7 +81,7 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@ -594,14 +527,14 @@ index a22af31..bde918e 100644
+ crash_reporter_client->GetCrashOptionalArguments(&arguments); + crash_reporter_client->GetCrashOptionalArguments(&arguments);
+ +
g_crashpad_client.Get().StartHandler( if (!g_crashpad_client.Get().StartHandler(
exe_file, database_path, metrics_path, url, process_annotations, exe_file, database_path, metrics_path, url, process_annotations,
arguments, false, false); arguments, false, true)) {
diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc
index 2e61cc1..6b8b943 100644 index c404067..4938dfd6 100644
--- content/browser/frame_host/debug_urls.cc --- content/browser/frame_host/debug_urls.cc
+++ content/browser/frame_host/debug_urls.cc +++ content/browser/frame_host/debug_urls.cc
@@ -189,7 +189,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) { @@ -190,7 +190,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
cc::switches::kEnableGpuBenchmarking) && cc::switches::kEnableGpuBenchmarking) &&
(PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED)); (PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED));

View File

@ -26,7 +26,7 @@ index 3aaaeee..d99fcb4 100644
static const time_t kSecondsInDay = 60 * 60 * 24; static const time_t kSecondsInDay = 60 * 60 * 24;
diff --git crashpad/client/prune_crash_reports.h crashpad/client/prune_crash_reports.h diff --git crashpad/client/prune_crash_reports.h crashpad/client/prune_crash_reports.h
index b66e9349..86d1f15 100644 index 6dac5f3..34f5ee1 100644
--- crashpad/client/prune_crash_reports.h --- crashpad/client/prune_crash_reports.h
+++ crashpad/client/prune_crash_reports.h +++ crashpad/client/prune_crash_reports.h
@@ -57,7 +57,8 @@ class PruneCondition { @@ -57,7 +57,8 @@ class PruneCondition {
@ -40,7 +40,7 @@ index b66e9349..86d1f15 100644
virtual ~PruneCondition() {} virtual ~PruneCondition() {}
diff --git crashpad/client/settings.cc crashpad/client/settings.cc diff --git crashpad/client/settings.cc crashpad/client/settings.cc
index d018e37f..47d8110 100644 index 7757ecb..d458337 100644
--- crashpad/client/settings.cc --- crashpad/client/settings.cc
+++ crashpad/client/settings.cc +++ crashpad/client/settings.cc
@@ -38,7 +38,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) { @@ -38,7 +38,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) {
@ -65,8 +65,8 @@ index d018e37f..47d8110 100644
@@ -56,6 +59,9 @@ struct Settings::Data { @@ -56,6 +59,9 @@ struct Settings::Data {
uint32_t options; uint32_t options;
uint32_t padding_0; uint32_t padding_0;
uint64_t last_upload_attempt_time; // time_t int64_t last_upload_attempt_time; // time_t
+ uint64_t next_upload_attempt_time; // time_t + int64_t next_upload_attempt_time; // time_t
+ uint32_t backoff_step; + uint32_t backoff_step;
+ uint32_t padding_1; + uint32_t padding_1;
UUID client_id; UUID client_id;
@ -96,7 +96,7 @@ index d018e37f..47d8110 100644
+ if (!handle.is_valid()) + if (!handle.is_valid())
+ return false; + return false;
+ +
+ settings.next_upload_attempt_time = InRangeCast<uint64_t>(time, 0); + settings.next_upload_attempt_time = InRangeCast<int64_t>(time, 0);
+ +
+ return WriteSettings(handle.get(), settings); + return WriteSettings(handle.get(), settings);
+} +}
@ -177,7 +177,7 @@ index a9601d1..9517730 100644
//! \brief Attempts to upload a crash report. //! \brief Attempts to upload a crash report.
//! //!
diff --git crashpad/handler/handler_main.cc crashpad/handler/handler_main.cc diff --git crashpad/handler/handler_main.cc crashpad/handler/handler_main.cc
index 29c5ddc..7a6bad7 100644 index 3ada8c3..ffaae42 100644
--- crashpad/handler/handler_main.cc --- crashpad/handler/handler_main.cc
+++ crashpad/handler/handler_main.cc +++ crashpad/handler/handler_main.cc
@@ -29,8 +29,10 @@ @@ -29,8 +29,10 @@
@ -202,7 +202,7 @@ index 29c5ddc..7a6bad7 100644
namespace crashpad { namespace crashpad {
namespace { namespace {
@@ -168,6 +174,9 @@ int HandlerMain(int argc, char* argv[]) { @@ -175,6 +181,9 @@ int HandlerMain(int argc, char* argv[]) {
kOptionPipeName, kOptionPipeName,
#endif // OS_MACOSX #endif // OS_MACOSX
kOptionURL, kOptionURL,
@ -212,7 +212,7 @@ index 29c5ddc..7a6bad7 100644
// Standard options. // Standard options.
kOptionHelp = -2, kOptionHelp = -2,
@@ -188,11 +197,17 @@ int HandlerMain(int argc, char* argv[]) { @@ -195,11 +204,17 @@ int HandlerMain(int argc, char* argv[]) {
InitialClientData initial_client_data; InitialClientData initial_client_data;
#endif // OS_MACOSX #endif // OS_MACOSX
bool rate_limit; bool rate_limit;
@ -230,7 +230,7 @@ index 29c5ddc..7a6bad7 100644
const option long_options[] = { const option long_options[] = {
{"annotation", required_argument, nullptr, kOptionAnnotation}, {"annotation", required_argument, nullptr, kOptionAnnotation},
@@ -222,6 +237,9 @@ int HandlerMain(int argc, char* argv[]) { @@ -229,6 +244,9 @@ int HandlerMain(int argc, char* argv[]) {
{"url", required_argument, nullptr, kOptionURL}, {"url", required_argument, nullptr, kOptionURL},
{"help", no_argument, nullptr, kOptionHelp}, {"help", no_argument, nullptr, kOptionHelp},
{"version", no_argument, nullptr, kOptionVersion}, {"version", no_argument, nullptr, kOptionVersion},
@ -240,7 +240,7 @@ index 29c5ddc..7a6bad7 100644
{nullptr, 0, nullptr, 0}, {nullptr, 0, nullptr, 0},
}; };
@@ -293,6 +311,27 @@ int HandlerMain(int argc, char* argv[]) { @@ -300,6 +318,27 @@ int HandlerMain(int argc, char* argv[]) {
options.url = optarg; options.url = optarg;
break; break;
} }
@ -268,7 +268,7 @@ index 29c5ddc..7a6bad7 100644
case kOptionHelp: { case kOptionHelp: {
Usage(me); Usage(me);
return EXIT_SUCCESS; return EXIT_SUCCESS;
@@ -425,12 +464,18 @@ int HandlerMain(int argc, char* argv[]) { @@ -432,12 +471,18 @@ int HandlerMain(int argc, char* argv[]) {
// TODO(scottmg): options.rate_limit should be removed when we have a // TODO(scottmg): options.rate_limit should be removed when we have a
// configurable database setting to control upload limiting. // configurable database setting to control upload limiting.
// See https://crashpad.chromium.org/bug/23. // See https://crashpad.chromium.org/bug/23.

View File

@ -1,20 +1,20 @@
diff --git .gn .gn diff --git .gn .gn
index e4b474a..38a41be 100644 index f3ea8df..09d0a1e 100644
--- .gn --- .gn
+++ .gn +++ .gn
@@ -241,6 +241,7 @@ exec_script_whitelist = [ @@ -225,6 +225,7 @@ exec_script_whitelist =
"//build/toolchain/win/BUILD.gn", # in the Chromium repo outside of //build.
"//build/util/branding.gni", "//android_webview/BUILD.gn",
"//build/util/version.gni", "//build_overrides/build.gni",
+ "//cef/BUILD.gn", + "//cef/BUILD.gn",
"//chromeos/BUILD.gn", "//chromeos/BUILD.gn",
# TODO(dgn): Layer violation but breaks the build otherwise, see # TODO(dgn): Layer violation but breaks the build otherwise, see
diff --git BUILD.gn BUILD.gn diff --git BUILD.gn BUILD.gn
index 43c7b3d..df225a1 100644 index 0cd9629..97c284c 100644
--- BUILD.gn --- BUILD.gn
+++ BUILD.gn +++ BUILD.gn
@@ -282,6 +282,7 @@ group("both_gn_and_gyp") { @@ -286,6 +286,7 @@ group("both_gn_and_gyp") {
# and whether there should be other targets that are iOS-only and missing. # and whether there should be other targets that are iOS-only and missing.
deps += [ deps += [
"//cc:cc_unittests", "//cc:cc_unittests",
@ -55,7 +55,7 @@ index 982fbe8..e757be46 100644
+ "studio path") + "studio path")
} }
diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py
index fbc201e..299156d 100644 index fbc201e..98ad106 100644
--- build/toolchain/win/setup_toolchain.py --- build/toolchain/win/setup_toolchain.py
+++ build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py
@@ -126,11 +126,15 @@ def _LoadToolchainEnv(cpu, sdk_dir): @@ -126,11 +126,15 @@ def _LoadToolchainEnv(cpu, sdk_dir):
@ -69,7 +69,7 @@ index fbc201e..299156d 100644
- variables = _LoadEnvFromBat(args) - variables = _LoadEnvFromBat(args)
+ if os.path.exists(script_path): + if os.path.exists(script_path):
+ args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64', \ + args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64', \
+ '10.0.10586.0'] + '10.0.14393.0']
+ variables = _LoadEnvFromBat(args) + variables = _LoadEnvFromBat(args)
+ else: + else:
+ variables = [] + variables = []
@ -80,7 +80,7 @@ index fbc201e..299156d 100644
diff --git build/vs_toolchain.py build/vs_toolchain.py diff --git build/vs_toolchain.py build/vs_toolchain.py
index c768a8a..bb91777 100755 index 3edf1ff..66e150a 100755
--- build/vs_toolchain.py --- build/vs_toolchain.py
+++ build/vs_toolchain.py +++ build/vs_toolchain.py
@@ -74,11 +74,18 @@ def SetEnvironmentAndGetRuntimeDllDirs(): @@ -74,11 +74,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
@ -103,10 +103,10 @@ index c768a8a..bb91777 100755
# directory in order to run binaries locally, but they are needed in order # 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 # to create isolates or the mini_installer. Copying them to the output
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index c3ac484..13ae760 100644 index 27c483c..24502e9 100644
--- chrome/chrome_paks.gni --- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni +++ chrome/chrome_paks.gni
@@ -235,7 +235,7 @@ template("chrome_paks") { @@ -245,7 +245,7 @@ template("chrome_paks") {
additional_source_patterns = invoker.additional_locale_source_patterns additional_source_patterns = invoker.additional_locale_source_patterns
} }
input_locales = locales input_locales = locales
@ -116,10 +116,10 @@ index c3ac484..13ae760 100644
if (is_mac) { if (is_mac) {
output_locales = locales_as_mac_outputs output_locales = locales_as_mac_outputs
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
index 0f37e54..7b81cde 100644 index 84be262..687ffac 100644
--- chrome/installer/mini_installer/BUILD.gn --- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn
@@ -124,7 +124,7 @@ template("generate_mini_installer") { @@ -125,7 +125,7 @@ template("generate_mini_installer") {
inputs = [ inputs = [
"$chrome_dll_file", "$chrome_dll_file",
"$root_out_dir/chrome.exe", "$root_out_dir/chrome.exe",

View File

@ -1,8 +1,8 @@
diff --git resource_ids resource_ids diff --git resource_ids resource_ids
index c500512..0ac0e98 100644 index d454de7..42e591a 100644
--- resource_ids --- resource_ids
+++ resource_ids +++ resource_ids
@@ -358,5 +358,12 @@ @@ -355,5 +355,12 @@
# Thinking about appending to the end? # Thinking about appending to the end?
# Please read the header and find the right section above instead. # Please read the header and find the right section above instead.

View File

@ -1,5 +1,5 @@
diff --git message_loop.cc message_loop.cc diff --git message_loop.cc message_loop.cc
index 1581f6c..ecb3149 100644 index 2212941..c2895af 100644
--- message_loop.cc --- message_loop.cc
+++ message_loop.cc +++ message_loop.cc
@@ -96,12 +96,6 @@ MessageLoop::~MessageLoop() { @@ -96,12 +96,6 @@ MessageLoop::~MessageLoop() {
@ -26,10 +26,10 @@ index 1581f6c..ecb3149 100644
run_loop_(NULL), run_loop_(NULL),
incoming_task_queue_(new internal::IncomingTaskQueue(this)), incoming_task_queue_(new internal::IncomingTaskQueue(this)),
diff --git message_loop.h message_loop.h diff --git message_loop.h message_loop.h
index ac7a303..b39018b 100644 index 91a7b1d..de864d4 100644
--- message_loop.h --- message_loop.h
+++ message_loop.h +++ message_loop.h
@@ -299,6 +299,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { @@ -303,6 +303,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
void AddTaskObserver(TaskObserver* task_observer); void AddTaskObserver(TaskObserver* task_observer);
void RemoveTaskObserver(TaskObserver* task_observer); void RemoveTaskObserver(TaskObserver* task_observer);
@ -46,7 +46,7 @@ index ac7a303..b39018b 100644
// Can only be called from the thread that owns the MessageLoop. // Can only be called from the thread that owns the MessageLoop.
bool is_running() const; bool is_running() const;
@@ -436,6 +446,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { @@ -440,6 +450,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// insider a (accidentally induced?) nested message pump. // insider a (accidentally induced?) nested message pump.
bool nestable_tasks_allowed_; bool nestable_tasks_allowed_;
@ -60,7 +60,7 @@ index ac7a303..b39018b 100644
// if type_ is TYPE_CUSTOM and pump_ is null. // if type_ is TYPE_CUSTOM and pump_ is null.
MessagePumpFactoryCallback pump_factory_; MessagePumpFactoryCallback pump_factory_;
diff --git message_pump_win.cc message_pump_win.cc diff --git message_pump_win.cc message_pump_win.cc
index f1ec727..4b859c0 100644 index 30638df..a50d626 100644
--- message_pump_win.cc --- message_pump_win.cc
+++ message_pump_win.cc +++ message_pump_win.cc
@@ -366,20 +366,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) { @@ -366,20 +366,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {

View File

@ -1,5 +1,5 @@
diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc
index 049af16..c5130acd 100644 index 6e59562..69f9769 100644
--- mime_handler_view_guest.cc --- mime_handler_view_guest.cc
+++ mime_handler_view_guest.cc +++ mime_handler_view_guest.cc
@@ -179,6 +179,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -179,6 +179,8 @@ void MimeHandlerViewGuest::CreateWebContents(

View File

@ -22,10 +22,10 @@ index 0fccae1..73e33ad 100644
// This is the interface for subclasses of NetworkDelegate to implement. These // This is the interface for subclasses of NetworkDelegate to implement. These
// member functions will be called by the respective public notification // member functions will be called by the respective public notification
diff --git net/url_request/url_request_job.cc net/url_request/url_request_job.cc diff --git net/url_request/url_request_job.cc net/url_request/url_request_job.cc
index b315664..55701edf 100644 index cdf60f8..d6dd4bf 100644
--- net/url_request/url_request_job.cc --- net/url_request/url_request_job.cc
+++ net/url_request/url_request_job.cc +++ net/url_request/url_request_job.cc
@@ -494,6 +494,12 @@ void URLRequestJob::NotifyHeadersComplete() { @@ -497,6 +497,12 @@ void URLRequestJob::NotifyHeadersComplete() {
DCHECK(!source_stream_); DCHECK(!source_stream_);
source_stream_ = SetUpSourceStream(); source_stream_ = SetUpSourceStream();
@ -36,5 +36,5 @@ index b315664..55701edf 100644
+ } + }
+ +
if (!source_stream_) { if (!source_stream_) {
NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, OnDone(URLRequestStatus(URLRequestStatus::FAILED,
ERR_CONTENT_DECODING_INIT_FAILED)); ERR_CONTENT_DECODING_INIT_FAILED),

View File

@ -33,7 +33,7 @@ index 42f631e..b02edb0 100644
+ +
} // namespace net } // namespace net
diff --git net/cert/ct_policy_enforcer.h net/cert/ct_policy_enforcer.h diff --git net/cert/ct_policy_enforcer.h net/cert/ct_policy_enforcer.h
index c732cee..1c80e81 100644 index 7111970..f751d6c 100644
--- net/cert/ct_policy_enforcer.h --- net/cert/ct_policy_enforcer.h
+++ net/cert/ct_policy_enforcer.h +++ net/cert/ct_policy_enforcer.h
@@ -101,6 +101,17 @@ class NET_EXPORT CTPolicyEnforcer { @@ -101,6 +101,17 @@ class NET_EXPORT CTPolicyEnforcer {
@ -55,10 +55,10 @@ index c732cee..1c80e81 100644
} // namespace net } // namespace net
diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc
index 9b42feb..f7860be 100644 index 5f82c28..0ebee04 100644
--- net/http/transport_security_state.cc --- net/http/transport_security_state.cc
+++ net/http/transport_security_state.cc +++ net/http/transport_security_state.cc
@@ -1362,8 +1362,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) { @@ -1371,8 +1371,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) {
g_ct_required_for_testing = *required ? 1 : -1; g_ct_required_for_testing = *required ? 1 : -1;
} }
@ -72,7 +72,7 @@ index 9b42feb..f7860be 100644
// We consider built-in information to be timely for 10 weeks. // We consider built-in information to be timely for 10 weeks.
return (base::Time::Now() - build_time).InDays() < 70 /* 10 weeks */; return (base::Time::Now() - build_time).InDays() < 70 /* 10 weeks */;
diff --git net/http/transport_security_state.h net/http/transport_security_state.h diff --git net/http/transport_security_state.h net/http/transport_security_state.h
index fc40b7d..c0b14a4 100644 index a55cf62..b984474 100644
--- net/http/transport_security_state.h --- net/http/transport_security_state.h
+++ net/http/transport_security_state.h +++ net/http/transport_security_state.h
@@ -475,6 +475,10 @@ class NET_EXPORT TransportSecurityState @@ -475,6 +475,10 @@ class NET_EXPORT TransportSecurityState
@ -85,8 +85,8 @@ index fc40b7d..c0b14a4 100644
+ +
private: private:
friend class TransportSecurityStateTest; friend class TransportSecurityStateTest;
FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPOnly); friend class TransportSecurityStateStaticFuzzer;
@@ -498,7 +502,7 @@ class NET_EXPORT TransportSecurityState @@ -499,7 +503,7 @@ class NET_EXPORT TransportSecurityState
// IsBuildTimely returns true if the current build is new enough ensure that // IsBuildTimely returns true if the current build is new enough ensure that
// built in security information (i.e. HSTS preloading and pinning // built in security information (i.e. HSTS preloading and pinning
// information) is timely. // information) is timely.
@ -95,7 +95,7 @@ index fc40b7d..c0b14a4 100644
// Helper method for actually checking pins. // Helper method for actually checking pins.
PKPStatus CheckPublicKeyPinsImpl( PKPStatus CheckPublicKeyPinsImpl(
@@ -589,6 +593,8 @@ class NET_EXPORT TransportSecurityState @@ -590,6 +594,8 @@ class NET_EXPORT TransportSecurityState
// True if public key pinning bypass is enabled for local trust anchors. // True if public key pinning bypass is enabled for local trust anchors.
bool enable_pkp_bypass_for_local_trust_anchors_; bool enable_pkp_bypass_for_local_trust_anchors_;

View File

@ -1,8 +1,8 @@
diff --git url_request.h url_request.h diff --git url_request.h url_request.h
index 9ef191c..2100168 100644 index e1406f3..ed9aa91 100644
--- url_request.h --- url_request.h
+++ url_request.h +++ url_request.h
@@ -655,10 +655,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), @@ -651,10 +651,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// Returns the error status of the request. // Returns the error status of the request.
// Do not use! Going to be protected! // Do not use! Going to be protected!
const URLRequestStatus& status() const { return status_; } const URLRequestStatus& status() const { return status_; }

View File

@ -1,8 +1,8 @@
diff --git BUILD.gn BUILD.gn diff --git BUILD.gn BUILD.gn
index f91ea0e..b57c692 100644 index 4a05c56..5e1c4e8 100644
--- BUILD.gn --- BUILD.gn
+++ BUILD.gn +++ BUILD.gn
@@ -183,6 +183,10 @@ static_library("pdfium") { @@ -194,6 +194,10 @@ static_library("pdfium") {
} else { } else {
libs += [ "freetype" ] libs += [ "freetype" ]
} }
@ -14,7 +14,7 @@ index f91ea0e..b57c692 100644
static_library("test_support") { static_library("test_support") {
diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
index 334c14c..fd918f3 100644 index ff4d46e..5d4c419 100644
--- fpdfsdk/fpdfview.cpp --- fpdfsdk/fpdfview.cpp
+++ fpdfsdk/fpdfview.cpp +++ fpdfsdk/fpdfview.cpp
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
@ -25,7 +25,7 @@ index 334c14c..fd918f3 100644
#include "public/fpdf_ext.h" #include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h" #include "public/fpdf_progressive.h"
#include "third_party/base/numerics/safe_conversions_impl.h" #include "third_party/base/numerics/safe_conversions_impl.h"
@@ -263,6 +264,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() { @@ -383,6 +384,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
CPDF_ModuleMgr::Destroy(); CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy(); CFX_GEModule::Destroy();

View File

@ -1,8 +1,8 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index 86fcd13..c695975 100644 index ffe235a..e7bf4be 100644
--- public/common/common_param_traits_macros.h --- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h +++ public/common/common_param_traits_macros.h
@@ -201,6 +201,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) @@ -202,6 +202,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
@ -11,10 +11,10 @@ index 86fcd13..c695975 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index da49d44..e42e715 100644 index 7f24f09..ab0fe0d 100644
--- public/common/web_preferences.cc --- public/common/web_preferences.cc
+++ public/common/web_preferences.cc +++ public/common/web_preferences.cc
@@ -173,6 +173,7 @@ WebPreferences::WebPreferences() @@ -172,6 +172,7 @@ WebPreferences::WebPreferences()
spatial_navigation_enabled(false), spatial_navigation_enabled(false),
use_solid_color_scrollbars(false), use_solid_color_scrollbars(false),
navigate_on_drag_drop(true), navigate_on_drag_drop(true),
@ -23,7 +23,7 @@ index da49d44..e42e715 100644
inert_visual_viewport(false), inert_visual_viewport(false),
record_whole_document(false), record_whole_document(false),
diff --git public/common/web_preferences.h public/common/web_preferences.h diff --git public/common/web_preferences.h public/common/web_preferences.h
index b853dd3..d2324bd 100644 index 4835144..16fa0ad 100644
--- public/common/web_preferences.h --- public/common/web_preferences.h
+++ public/common/web_preferences.h +++ public/common/web_preferences.h
@@ -186,6 +186,7 @@ struct CONTENT_EXPORT WebPreferences { @@ -186,6 +186,7 @@ struct CONTENT_EXPORT WebPreferences {
@ -35,10 +35,10 @@ index b853dd3..d2324bd 100644
bool inert_visual_viewport; bool inert_visual_viewport;
bool record_whole_document; bool record_whole_document;
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index 0c11c30..c0ae0af 100644 index 7083f7d..e307222 100644
--- renderer/render_view_impl.cc --- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc +++ renderer/render_view_impl.cc
@@ -1351,6 +1351,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( @@ -1389,6 +1389,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
blink::WebView* web_view, blink::WebView* web_view,
CompositorDependencies* compositor_deps) { CompositorDependencies* compositor_deps) {
ApplyWebPreferences(prefs, web_view); ApplyWebPreferences(prefs, web_view);

View File

@ -1,5 +1,5 @@
diff --git prefs_tab_helper.cc prefs_tab_helper.cc diff --git prefs_tab_helper.cc prefs_tab_helper.cc
index e20d4e5c..d350a14 100644 index 72267d2..5146b39 100644
--- prefs_tab_helper.cc --- prefs_tab_helper.cc
+++ prefs_tab_helper.cc +++ prefs_tab_helper.cc
@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
@ -12,7 +12,7 @@ index e20d4e5c..d350a14 100644
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
@@ -429,12 +429,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { @@ -431,12 +431,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
GetInstance()->GetServiceForBrowserContext(profile, true)); GetInstance()->GetServiceForBrowserContext(profile, true));
} }
@ -27,7 +27,7 @@ index e20d4e5c..d350a14 100644
PrefWatcherFactory() : BrowserContextKeyedServiceFactory( PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
"PrefWatcher", "PrefWatcher",
@@ -455,6 +453,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { @@ -457,6 +455,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
} }
}; };

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/ui/cocoa/applescript/tab_applescript.mm chrome/browser/ui/cocoa/applescript/tab_applescript.mm diff --git chrome/browser/ui/cocoa/applescript/tab_applescript.mm chrome/browser/ui/cocoa/applescript/tab_applescript.mm
index cb9d140..528091d 100644 index 7ec0135..9f68626 100644
--- chrome/browser/ui/cocoa/applescript/tab_applescript.mm --- chrome/browser/ui/cocoa/applescript/tab_applescript.mm
+++ chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ chrome/browser/ui/cocoa/applescript/tab_applescript.mm
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
@ -24,7 +24,7 @@ index cb9d140..528091d 100644
using content::NavigationController; using content::NavigationController;
using content::NavigationEntry; using content::NavigationEntry;
using content::OpenURLParams; using content::OpenURLParams;
@@ -231,11 +235,15 @@ - (void)handlesStopScriptCommand:(NSScriptCommand*)command { @@ -231,11 +235,15 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id,
- (void)handlesPrintScriptCommand:(NSScriptCommand*)command { - (void)handlesPrintScriptCommand:(NSScriptCommand*)command {
AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_PRINT); AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_PRINT);
@ -41,10 +41,10 @@ index cb9d140..528091d 100644
- (void)handlesSaveScriptCommand:(NSScriptCommand*)command { - (void)handlesSaveScriptCommand:(NSScriptCommand*)command {
diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc
index 5820bb1..a1a8f08 100644 index a9291a2..1a50724 100644
--- components/printing/common/print_messages.cc --- components/printing/common/print_messages.cc
+++ components/printing/common/print_messages.cc +++ components/printing/common/print_messages.cc
@@ -105,7 +105,6 @@ void PrintMsg_PrintPages_Params::Reset() { @@ -107,7 +107,6 @@ void PrintMsg_PrintPages_Params::Reset() {
pages = std::vector<int>(); pages = std::vector<int>();
} }
@ -52,16 +52,16 @@ index 5820bb1..a1a8f08 100644
PrintHostMsg_RequestPrintPreview_Params:: PrintHostMsg_RequestPrintPreview_Params::
PrintHostMsg_RequestPrintPreview_Params() PrintHostMsg_RequestPrintPreview_Params()
: is_modifiable(false), : is_modifiable(false),
@@ -127,4 +126,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: @@ -129,4 +128,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
PrintHostMsg_SetOptionsFromDocument_Params:: PrintHostMsg_SetOptionsFromDocument_Params::
~PrintHostMsg_SetOptionsFromDocument_Params() { ~PrintHostMsg_SetOptionsFromDocument_Params() {
} }
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h
index 3d1e71a..a876c2a 100644 index 3679499..b2d2544 100644
--- components/printing/common/print_messages.h --- components/printing/common/print_messages.h
+++ components/printing/common/print_messages.h +++ components/printing/common/print_messages.h
@@ -73,7 +73,6 @@ struct PrintMsg_PrintPages_Params { @@ -74,7 +74,6 @@ struct PrintMsg_PrintPages_Params {
std::vector<int> pages; std::vector<int> pages;
}; };
@ -69,7 +69,7 @@ index 3d1e71a..a876c2a 100644
struct PrintHostMsg_RequestPrintPreview_Params { struct PrintHostMsg_RequestPrintPreview_Params {
PrintHostMsg_RequestPrintPreview_Params(); PrintHostMsg_RequestPrintPreview_Params();
~PrintHostMsg_RequestPrintPreview_Params(); ~PrintHostMsg_RequestPrintPreview_Params();
@@ -92,7 +91,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params { @@ -93,7 +92,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
printing::DuplexMode duplex; printing::DuplexMode duplex;
printing::PageRanges page_ranges; printing::PageRanges page_ranges;
}; };
@ -77,7 +77,7 @@ index 3d1e71a..a876c2a 100644
#endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
@@ -182,7 +180,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) @@ -186,7 +184,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
IPC_STRUCT_TRAITS_MEMBER(to) IPC_STRUCT_TRAITS_MEMBER(to)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -85,7 +85,7 @@ index 3d1e71a..a876c2a 100644
IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
IPC_STRUCT_TRAITS_MEMBER(is_modifiable) IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
IPC_STRUCT_TRAITS_MEMBER(webnode_only) IPC_STRUCT_TRAITS_MEMBER(webnode_only)
@@ -203,7 +200,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params) @@ -207,7 +204,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
// Specifies page range to be printed. // Specifies page range to be printed.
IPC_STRUCT_TRAITS_MEMBER(page_ranges) IPC_STRUCT_TRAITS_MEMBER(page_ranges)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -93,7 +93,7 @@ index 3d1e71a..a876c2a 100644
IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
IPC_STRUCT_TRAITS_MEMBER(content_width) IPC_STRUCT_TRAITS_MEMBER(content_width)
@@ -223,7 +219,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) @@ -227,7 +223,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
IPC_STRUCT_TRAITS_MEMBER(pages) IPC_STRUCT_TRAITS_MEMBER(pages)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -101,7 +101,7 @@ index 3d1e71a..a876c2a 100644
// Parameters to describe a rendered document. // Parameters to describe a rendered document.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
// A shared memory handle to metafile data. // A shared memory handle to metafile data.
@@ -280,7 +275,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params) @@ -284,7 +279,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
// Indicates whether the existing preview data needs to be cleared or not. // Indicates whether the existing preview data needs to be cleared or not.
IPC_STRUCT_MEMBER(bool, clear_preview_data) IPC_STRUCT_MEMBER(bool, clear_preview_data)
IPC_STRUCT_END() IPC_STRUCT_END()
@ -109,7 +109,7 @@ index 3d1e71a..a876c2a 100644
// Parameters to describe a rendered page. // Parameters to describe a rendered page.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params)
@@ -319,22 +313,20 @@ IPC_STRUCT_END() @@ -323,22 +317,20 @@ IPC_STRUCT_END()
// Messages sent from the browser to the renderer. // Messages sent from the browser to the renderer.
@ -134,7 +134,7 @@ index 3d1e71a..a876c2a 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING) #if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Tells the RenderFrame to switch the CSS to print media type, renders every // Tells the RenderFrame to switch the CSS to print media type, renders every
@@ -352,13 +344,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone, @@ -356,13 +348,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
// Tells the RenderFrame whether printing is enabled or not. // Tells the RenderFrame whether printing is enabled or not.
IPC_MESSAGE_ROUTED1(PrintMsg_SetPrintingEnabled, bool /* enabled */) IPC_MESSAGE_ROUTED1(PrintMsg_SetPrintingEnabled, bool /* enabled */)
@ -148,15 +148,15 @@ index 3d1e71a..a876c2a 100644
// Messages sent from the renderer to the browser. // Messages sent from the renderer to the browser.
@@ -414,7 +404,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, @@ -418,7 +408,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
int /* fd in browser */) // Used only by Chrome OS. int /* fd in browser */)
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW) -#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Asks the browser to do print preview. // Asks the browser to do print preview.
IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
PrintHostMsg_RequestPrintPreview_Params /* params */) PrintHostMsg_RequestPrintPreview_Params /* params */)
@@ -448,7 +437,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, @@ -452,7 +441,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
// The memory handle in this message is already valid in the browser process. // The memory handle in this message is already valid in the browser process.
IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
PrintHostMsg_DidPreviewDocument_Params /* params */) PrintHostMsg_DidPreviewDocument_Params /* params */)
@ -164,7 +164,7 @@ index 3d1e71a..a876c2a 100644
// This is sent when there are invalid printer settings. // This is sent when there are invalid printer settings.
IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
@@ -457,7 +445,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) @@ -461,7 +449,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
int /* document cookie */) int /* document cookie */)
@ -172,16 +172,16 @@ index 3d1e71a..a876c2a 100644
// Tell the browser print preview failed. // Tell the browser print preview failed.
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
int /* document cookie */) int /* document cookie */)
@@ -484,4 +471,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, @@ -488,4 +475,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
// Notify the browser to set print presets based on source PDF document. // Notify the browser to set print presets based on source PDF document.
IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
PrintHostMsg_SetOptionsFromDocument_Params /* params */) PrintHostMsg_SetOptionsFromDocument_Params /* params */)
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
diff --git components/printing/renderer/print_web_view_helper.cc components/printing/renderer/print_web_view_helper.cc diff --git components/printing/renderer/print_web_view_helper.cc components/printing/renderer/print_web_view_helper.cc
index e343eef..025671c 100644 index 3144c40..8679f72 100644
--- components/printing/renderer/print_web_view_helper.cc --- components/printing/renderer/print_web_view_helper.cc
+++ components/printing/renderer/print_web_view_helper.cc +++ components/printing/renderer/print_web_view_helper.cc
@@ -88,6 +88,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f; @@ -89,6 +89,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
bool g_is_preview_enabled = true; bool g_is_preview_enabled = true;
@ -191,7 +191,7 @@ index e343eef..025671c 100644
const char kPageLoadScriptFormat[] = const char kPageLoadScriptFormat[] =
"document.open(); document.write(%s); document.close();"; "document.open(); document.write(%s); document.close();";
@@ -102,9 +105,6 @@ void ExecuteScript(blink::WebFrame* frame, @@ -103,9 +106,6 @@ void ExecuteScript(blink::WebFrame* frame,
std::string script = base::StringPrintf(script_format, json.c_str()); std::string script = base::StringPrintf(script_format, json.c_str());
frame->executeScript(blink::WebString(base::UTF8ToUTF16(script))); frame->executeScript(blink::WebString(base::UTF8ToUTF16(script)));
} }
@ -201,7 +201,7 @@ index e343eef..025671c 100644
int GetDPI(const PrintMsg_Print_Params* print_params) { int GetDPI(const PrintMsg_Print_Params* print_params) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
@@ -321,7 +321,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, @@ -323,7 +323,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
return plugin && plugin->supportsPaginatedPrint(); return plugin && plugin->supportsPaginatedPrint();
} }
@ -209,15 +209,15 @@ index e343eef..025671c 100644
// Returns true if the current destination printer is PRINT_TO_PDF. // Returns true if the current destination printer is PRINT_TO_PDF.
bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) { bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
bool print_to_pdf = false; bool print_to_pdf = false;
@@ -343,7 +342,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame, @@ -345,7 +344,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
} }
return frame_has_custom_page_size_style; return frame_has_custom_page_size_style;
} }
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
#if BUILDFLAG(ENABLE_PRINTING)
// Disable scaling when either: // Disable scaling when either:
// - The PDF specifies disabling scaling. @@ -401,7 +399,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
@@ -397,7 +395,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
} }
#endif #endif
@ -225,7 +225,7 @@ index e343eef..025671c 100644
bool FitToPageEnabled(const base::DictionaryValue& job_settings) { bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
bool fit_to_paper_size = false; bool fit_to_paper_size = false;
if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) { if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) {
@@ -440,7 +437,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( @@ -444,7 +441,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
} }
return blink::WebPrintScalingOptionFitToPrintableArea; return blink::WebPrintScalingOptionFitToPrintableArea;
} }
@ -233,7 +233,7 @@ index e343eef..025671c 100644
// Helper function to scale and round an integer value with a double valued // Helper function to scale and round an integer value with a double valued
// scaling. // scaling.
@@ -559,7 +555,6 @@ blink::WebView* FrameReference::view() { @@ -563,7 +559,6 @@ blink::WebView* FrameReference::view() {
return view_; return view_;
} }
@ -241,7 +241,7 @@ index e343eef..025671c 100644
// static - Not anonymous so that platform implementations can use it. // static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::PrintHeaderAndFooter( void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebCanvas* canvas, blink::WebCanvas* canvas,
@@ -617,7 +612,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter( @@ -621,7 +616,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
web_view->close(); web_view->close();
} }
@ -249,7 +249,7 @@ index e343eef..025671c 100644
// static - Not anonymous so that platform implementations can use it. // static - Not anonymous so that platform implementations can use it.
float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame, float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
@@ -902,6 +896,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame, @@ -906,6 +900,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame,
print_for_preview_(false), print_for_preview_(false),
delegate_(std::move(delegate)), delegate_(std::move(delegate)),
print_node_in_progress_(false), print_node_in_progress_(false),
@ -257,7 +257,7 @@ index e343eef..025671c 100644
is_loading_(false), is_loading_(false),
is_scripted_preview_delayed_(false), is_scripted_preview_delayed_(false),
ipc_nesting_level_(0), ipc_nesting_level_(0),
@@ -961,10 +956,8 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) { @@ -966,10 +961,8 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) {
return; return;
if (g_is_preview_enabled) { if (g_is_preview_enabled) {
@ -268,7 +268,7 @@ index e343eef..025671c 100644
} else { } else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING) #if BUILDFLAG(ENABLE_BASIC_PRINTING)
Print(web_frame, blink::WebNode(), true /* is_scripted? */); Print(web_frame, blink::WebNode(), true /* is_scripted? */);
@@ -988,14 +981,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { @@ -997,14 +990,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages) IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog) IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@ -283,7 +283,7 @@ index e343eef..025671c 100644
IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled) IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled)
IPC_MESSAGE_UNHANDLED(handled = false) IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP() IPC_END_MESSAGE_MAP()
@@ -1033,7 +1022,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { @@ -1048,7 +1037,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
} }
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@ -291,7 +291,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnPrintForPrintPreview( void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) { const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1); CHECK_LE(ipc_nesting_level_, 1);
@@ -1092,7 +1080,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( @@ -1107,7 +1095,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT); DidFinishPrinting(FAIL_PRINT);
} }
} }
@ -299,7 +299,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout( void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points, const PageSizeMargins& page_layout_in_points,
@@ -1117,7 +1104,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( @@ -1132,7 +1119,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS); ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
} }
@ -307,7 +307,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
@@ -1302,7 +1288,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { @@ -1317,7 +1303,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
return true; return true;
} }
@ -316,7 +316,7 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::RenderPreviewPage( bool PrintWebViewHelper::RenderPreviewPage(
int page_number, int page_number,
const PrintMsg_Print_Params& print_params) { const PrintMsg_Print_Params& print_params) {
@@ -1332,7 +1318,7 @@ bool PrintWebViewHelper::RenderPreviewPage( @@ -1347,7 +1333,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
} }
return PreviewPageRendered(page_number, draft_metafile.get()); return PreviewPageRendered(page_number, draft_metafile.get());
} }
@ -325,7 +325,7 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::FinalizePrintReadyDocument() { bool PrintWebViewHelper::FinalizePrintReadyDocument() {
DCHECK(!is_print_ready_metafile_sent_); DCHECK(!is_print_ready_metafile_sent_);
@@ -1362,7 +1348,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { @@ -1377,7 +1363,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params)); Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
return true; return true;
} }
@ -333,7 +333,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnPrintingDone(bool success) { void PrintWebViewHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
@@ -1377,7 +1362,6 @@ void PrintWebViewHelper::OnSetPrintingEnabled(bool enabled) { @@ -1392,7 +1377,6 @@ void PrintWebViewHelper::OnSetPrintingEnabled(bool enabled) {
is_printing_enabled_ = enabled; is_printing_enabled_ = enabled;
} }
@ -341,7 +341,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) { void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
@@ -1388,7 +1372,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) { @@ -1403,7 +1387,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
// that instead. // that instead.
auto plugin = delegate_->GetPdfElement(frame); auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.isNull()) { if (!plugin.isNull()) {
@ -351,7 +351,7 @@ index e343eef..025671c 100644
return; return;
} }
print_preview_context_.InitWithFrame(frame); print_preview_context_.InitWithFrame(frame);
@@ -1396,7 +1382,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) { @@ -1411,7 +1397,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
? PRINT_PREVIEW_USER_INITIATED_SELECTION ? PRINT_PREVIEW_USER_INITIATED_SELECTION
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
} }
@ -359,10 +359,10 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::IsPrintingEnabled() const { bool PrintWebViewHelper::IsPrintingEnabled() const {
return is_printing_enabled_; return is_printing_enabled_;
@@ -1420,11 +1405,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { @@ -1433,11 +1418,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
print_node_in_progress_ = true;
// Make a copy of the node, in case RenderView::OnContextMenuClosed resets
// its |context_menu_node_|.
- if (g_is_preview_enabled) { - if (g_is_preview_enabled) {
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW) -#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+ if (g_is_preview_enabled || force_print_preview_) { + if (g_is_preview_enabled || force_print_preview_) {
@ -371,8 +371,8 @@ index e343eef..025671c 100644
-#endif -#endif
} else { } else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING) #if BUILDFLAG(ENABLE_BASIC_PRINTING)
blink::WebNode duplicate_node(node); // Make a copy of the node, in case RenderView::OnContextMenuClosed() resets
@@ -1490,7 +1473,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { @@ -1526,7 +1509,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
} }
break; break;
@ -380,7 +380,7 @@ index e343eef..025671c 100644
case FAIL_PREVIEW: case FAIL_PREVIEW:
int cookie = int cookie =
print_pages_params_ ? print_pages_params_->params.document_cookie : 0; print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
@@ -1502,7 +1484,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { @@ -1538,7 +1520,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
} }
print_preview_context_.Failed(notify_browser_of_print_failure_); print_preview_context_.Failed(notify_browser_of_print_failure_);
break; break;
@ -388,7 +388,7 @@ index e343eef..025671c 100644
} }
prep_frame_view_.reset(); prep_frame_view_.reset();
print_pages_params_.reset(); print_pages_params_.reset();
@@ -1634,7 +1615,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, @@ -1670,7 +1651,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true; return true;
} }
@ -396,15 +396,15 @@ index e343eef..025671c 100644
bool PrintWebViewHelper::SetOptionsFromPdfDocument( bool PrintWebViewHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) { PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -1743,7 +1723,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( @@ -1777,7 +1757,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS);
return true; return false;
} }
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
#if BUILDFLAG(ENABLE_BASIC_PRINTING) #if BUILDFLAG(ENABLE_BASIC_PRINTING)
bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame, void PrintWebViewHelper::GetPrintSettingsFromUser(
@@ -1857,7 +1836,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -1884,7 +1863,6 @@ void PrintWebViewHelper::PrintPageInternal(
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
@ -412,7 +412,7 @@ index e343eef..025671c 100644
if (params.params.display_header_footer) { if (params.params.display_header_footer) {
// TODO(thestig): Figure out why Linux needs this. It is almost certainly // TODO(thestig): Figure out why Linux needs this. It is almost certainly
// |printingMinimumShrinkFactor| from Blink. // |printingMinimumShrinkFactor| from Blink.
@@ -1872,7 +1850,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -1899,7 +1877,6 @@ void PrintWebViewHelper::PrintPageInternal(
scale_factor / fudge_factor, page_layout_in_points, scale_factor / fudge_factor, page_layout_in_points,
params.params); params.params);
} }
@ -420,7 +420,7 @@ index e343eef..025671c 100644
float webkit_scale_factor = float webkit_scale_factor =
RenderPageContent(frame, params.page_number, canvas_area, content_area, RenderPageContent(frame, params.page_number, canvas_area, content_area,
@@ -1908,7 +1885,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( @@ -1935,7 +1912,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
return true; return true;
} }
@ -428,7 +428,7 @@ index e343eef..025671c 100644
void PrintWebViewHelper::ShowScriptedPrintPreview() { void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) { if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false; is_scripted_preview_delayed_ = false;
@@ -2036,7 +2012,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, @@ -2066,7 +2042,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params)); Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true; return true;
} }
@ -437,10 +437,10 @@ index e343eef..025671c 100644
PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext() PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext()
: total_page_count_(0), : total_page_count_(0),
diff --git components/printing/renderer/print_web_view_helper.h components/printing/renderer/print_web_view_helper.h diff --git components/printing/renderer/print_web_view_helper.h components/printing/renderer/print_web_view_helper.h
index 2dad908..fea05fd 100644 index e603411..ec4b7d8 100644
--- components/printing/renderer/print_web_view_helper.h --- components/printing/renderer/print_web_view_helper.h
+++ components/printing/renderer/print_web_view_helper.h +++ components/printing/renderer/print_web_view_helper.h
@@ -143,9 +143,7 @@ class PrintWebViewHelper @@ -145,9 +145,7 @@ class PrintWebViewHelper
OK, OK,
FAIL_PRINT_INIT, FAIL_PRINT_INIT,
FAIL_PRINT, FAIL_PRINT,
@ -450,7 +450,7 @@ index 2dad908..fea05fd 100644
}; };
enum PrintPreviewErrorBuckets { enum PrintPreviewErrorBuckets {
@@ -181,10 +179,8 @@ class PrintWebViewHelper @@ -183,10 +181,8 @@ class PrintWebViewHelper
void OnPrintForSystemDialog(); void OnPrintForSystemDialog();
void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); void OnPrintForPrintPreview(const base::DictionaryValue& job_settings);
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@ -461,7 +461,7 @@ index 2dad908..fea05fd 100644
void OnPrintingDone(bool success); void OnPrintingDone(bool success);
// Get |page_size| and |content_area| information from // Get |page_size| and |content_area| information from
@@ -197,7 +193,6 @@ class PrintWebViewHelper @@ -199,7 +195,6 @@ class PrintWebViewHelper
// Update |ignore_css_margins_| based on settings. // Update |ignore_css_margins_| based on settings.
void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
@ -469,7 +469,7 @@ index 2dad908..fea05fd 100644
// Prepare frame for creating preview document. // Prepare frame for creating preview document.
void PrepareFrameForPreviewDocument(); void PrepareFrameForPreviewDocument();
@@ -214,7 +209,6 @@ class PrintWebViewHelper @@ -216,7 +211,6 @@ class PrintWebViewHelper
// Finalize the print ready preview document. // Finalize the print ready preview document.
bool FinalizePrintReadyDocument(); bool FinalizePrintReadyDocument();
@ -477,7 +477,7 @@ index 2dad908..fea05fd 100644
// Enable/Disable printing. // Enable/Disable printing.
void OnSetPrintingEnabled(bool enabled); void OnSetPrintingEnabled(bool enabled);
@@ -242,7 +236,6 @@ class PrintWebViewHelper @@ -246,7 +240,6 @@ class PrintWebViewHelper
const blink::WebNode& node, const blink::WebNode& node,
int* number_of_pages); int* number_of_pages);
@ -485,15 +485,15 @@ index 2dad908..fea05fd 100644
// Set options for print preset from source PDF document. // Set options for print preset from source PDF document.
bool SetOptionsFromPdfDocument( bool SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options); PrintHostMsg_SetOptionsFromDocument_Params* options);
@@ -253,7 +246,6 @@ class PrintWebViewHelper @@ -257,7 +250,6 @@ class PrintWebViewHelper
bool UpdatePrintSettings(blink::WebLocalFrame* frame, bool UpdatePrintSettings(blink::WebLocalFrame* frame,
const blink::WebNode& node, const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings); const base::DictionaryValue& passed_job_settings);
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Get final print settings from the user. // Get final print settings from the user.
// Return false if the user cancels or on error. @@ -335,7 +327,6 @@ class PrintWebViewHelper
@@ -328,7 +320,6 @@ class PrintWebViewHelper
const PrintMsg_PrintPages_Params& params, const PrintMsg_PrintPages_Params& params,
int page_count); int page_count);
@ -501,7 +501,7 @@ index 2dad908..fea05fd 100644
// Given the |device| and |canvas| to draw on, prints the appropriate headers // Given the |device| and |canvas| to draw on, prints the appropriate headers
// and footers using strings from |header_footer_info| on to the canvas. // and footers using strings from |header_footer_info| on to the canvas.
static void PrintHeaderAndFooter(blink::WebCanvas* canvas, static void PrintHeaderAndFooter(blink::WebCanvas* canvas,
@@ -338,7 +329,6 @@ class PrintWebViewHelper @@ -345,7 +336,6 @@ class PrintWebViewHelper
float webkit_scale_factor, float webkit_scale_factor,
const PageSizeMargins& page_layout_in_points, const PageSizeMargins& page_layout_in_points,
const PrintMsg_Print_Params& params); const PrintMsg_Print_Params& params);
@ -509,15 +509,15 @@ index 2dad908..fea05fd 100644
// Script Initiated Printing ------------------------------------------------ // Script Initiated Printing ------------------------------------------------
@@ -348,7 +338,6 @@ class PrintWebViewHelper @@ -355,7 +345,6 @@ class PrintWebViewHelper
bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame, bool IsScriptInitiatedPrintAllowed(blink::WebLocalFrame* frame,
bool user_initiated); bool user_initiated);
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW) -#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Shows scripted print preview when options from plugin are available. // Shows scripted print preview when options from plugin are available.
void ShowScriptedPrintPreview(); void ShowScriptedPrintPreview();
@@ -364,7 +353,6 @@ class PrintWebViewHelper @@ -373,7 +362,6 @@ class PrintWebViewHelper
// |metafile| is the rendered page. Otherwise |metafile| is NULL. // |metafile| is the rendered page. Otherwise |metafile| is NULL.
// Returns true if print preview should continue, false on failure. // Returns true if print preview should continue, false on failure.
bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile); bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile);
@ -525,7 +525,7 @@ index 2dad908..fea05fd 100644
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
@@ -516,6 +504,7 @@ class PrintWebViewHelper @@ -525,6 +513,7 @@ class PrintWebViewHelper
ScriptingThrottler scripting_throttler_; ScriptingThrottler scripting_throttler_;
bool print_node_in_progress_; bool print_node_in_progress_;
@ -537,7 +537,7 @@ diff --git components/printing/renderer/print_web_view_helper_mac.mm components/
index ff49472..b107439 100644 index ff49472..b107439 100644
--- components/printing/renderer/print_web_view_helper_mac.mm --- components/printing/renderer/print_web_view_helper_mac.mm
+++ components/printing/renderer/print_web_view_helper_mac.mm +++ components/printing/renderer/print_web_view_helper_mac.mm
@@ -69,7 +69,6 @@ @@ -69,7 +69,6 @@ void PrintWebViewHelper::PrintPageInternal(
Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params)); Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params));
} }
@ -545,7 +545,7 @@ index ff49472..b107439 100644
bool PrintWebViewHelper::RenderPreviewPage( bool PrintWebViewHelper::RenderPreviewPage(
int page_number, int page_number,
const PrintMsg_Print_Params& print_params) { const PrintMsg_Print_Params& print_params) {
@@ -106,7 +105,6 @@ @@ -106,7 +105,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
} }
return PreviewPageRendered(page_number, draft_metafile.get()); return PreviewPageRendered(page_number, draft_metafile.get());
} }
@ -553,7 +553,7 @@ index ff49472..b107439 100644
void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
int page_number, int page_number,
@@ -142,14 +140,12 @@ @@ -142,14 +140,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsPreviewMetafile(*canvas, is_preview); skia::SetIsPreviewMetafile(*canvas, is_preview);

View File

@ -1,5 +1,5 @@
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index 573b5d9..e61cfa0 100644 index 93a1da4..476d7cc 100644
--- content/browser/frame_host/render_frame_message_filter.cc --- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc +++ content/browser/frame_host/render_frame_message_filter.cc
@@ -491,7 +491,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( @@ -491,7 +491,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(

View File

@ -1,8 +1,8 @@
diff --git render_view_host_impl.h render_view_host_impl.h diff --git render_view_host_impl.h render_view_host_impl.h
index e8890aa..910a25b 100644 index a2a0359..d5d2ff7 100644
--- render_view_host_impl.h --- render_view_host_impl.h
+++ render_view_host_impl.h +++ render_view_host_impl.h
@@ -167,6 +167,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost, @@ -158,6 +158,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
void set_is_swapped_out(bool is_swapped_out) { void set_is_swapped_out(bool is_swapped_out) {
is_swapped_out_ = is_swapped_out; is_swapped_out_ = is_swapped_out;
} }

View File

@ -1,5 +1,5 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
index 689ae2c..52e405d 100644 index 53c4808..21d741a 100644
--- render_widget_host_view_mac.mm --- render_widget_host_view_mac.mm
+++ render_widget_host_view_mac.mm +++ render_widget_host_view_mac.mm
@@ -462,9 +462,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, @@ -462,9 +462,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,

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