Update to Chromium revision d483fb77 (#474934)

- CefLifeSpanHandler::OnBeforePopup is now called on the UI thread.
- Remove CefBrowserSettings.javascript_open_windows which is no
  longer supported.
This commit is contained in:
Marshall Greenblatt
2017-05-31 17:33:30 +02:00
parent 12150b43d2
commit 5c79944b31
141 changed files with 2174 additions and 1364 deletions

View File

@@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
index 1c73b7f..606f29c 100644
index 16599b1..e489af1 100644
--- content/browser/renderer_host/browser_compositor_view_mac.h
+++ content/browser/renderer_host/browser_compositor_view_mac.h
@@ -51,9 +51,11 @@ class BrowserCompositorMac : public DelegatedFrameHostClient {
@@ -15,7 +15,7 @@ index 1c73b7f..606f29c 100644
void DidCreateNewRendererCompositorFrameSink(
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
index fba983b..8cf9629 100644
index 4121584..c821275 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -202,6 +202,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
@@ -31,7 +31,7 @@ index fba983b..8cf9629 100644
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
if (recyclable_compositor_)
return recyclable_compositor_->accelerated_widget_mac();
@@ -421,8 +427,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
@@ -420,8 +426,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
}
gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {

View File

@@ -1,8 +1,8 @@
diff --git content/browser/frame_host/render_widget_host_view_guest.cc content/browser/frame_host/render_widget_host_view_guest.cc
index fc720a7..1c30365 100644
index b7e4883..2dfd11e 100644
--- content/browser/frame_host/render_widget_host_view_guest.cc
+++ content/browser/frame_host/render_widget_host_view_guest.cc
@@ -247,13 +247,14 @@ void RenderWidgetHostViewGuest::Destroy() {
@@ -246,13 +246,14 @@ void RenderWidgetHostViewGuest::Destroy() {
}
gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {

View File

@@ -1,8 +1,8 @@
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
index e6baddc7..17dff91 100644
index 1f985ec..47bf303 100644
--- content/browser/browser_plugin/browser_plugin_guest.cc
+++ content/browser/browser_plugin/browser_plugin_guest.cc
@@ -316,14 +316,20 @@ void BrowserPluginGuest::InitInternal(
@@ -322,14 +322,20 @@ void BrowserPluginGuest::InitInternal(
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
}
@@ -25,7 +25,7 @@ index e6baddc7..17dff91 100644
}
RendererPreferences* renderer_prefs =
@@ -799,7 +805,8 @@ void BrowserPluginGuest::OnWillAttachComplete(
@@ -805,7 +811,8 @@ void BrowserPluginGuest::OnWillAttachComplete(
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) {
web_contents_view->CreateViewForWidget(
@@ -36,10 +36,10 @@ index e6baddc7..17dff91 100644
}
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
index d0c4ffa..6399af8 100644
index d890e64..1965603 100644
--- content/browser/frame_host/interstitial_page_impl.cc
+++ content/browser/frame_host/interstitial_page_impl.cc
@@ -598,7 +598,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
@@ -605,7 +605,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
WebContentsView* wcv =
static_cast<WebContentsImpl*>(web_contents())->GetView();
RenderWidgetHostViewBase* view =
@@ -69,7 +69,7 @@ index e4401f8..f2fdb9b 100644
// Creates a new View that holds a popup and receives messages for it.
virtual RenderWidgetHostViewBase* CreateViewForPopupWidget(
diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc
index 68481ad..4018641 100644
index 84b906e..ec0d014 100644
--- content/browser/web_contents/web_contents_view_aura.cc
+++ content/browser/web_contents/web_contents_view_aura.cc
@@ -846,7 +846,8 @@ void WebContentsViewAura::CreateView(
@@ -91,7 +91,7 @@ index 68481ad..4018641 100644
g_create_render_widget_host_view
? g_create_render_widget_host_view(render_widget_host,
diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h
index fc703087..2a1c368 100644
index c52692e..63402a6 100644
--- content/browser/web_contents/web_contents_view_aura.h
+++ content/browser/web_contents/web_contents_view_aura.h
@@ -118,7 +118,7 @@ class CONTENT_EXPORT WebContentsViewAura
@@ -198,10 +198,10 @@ index 0102d7e..b89d66c 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.h content/browser/web_contents/web_contents_view_mac.h
index 4141b7f..921bc79 100644
index b0a1a1d..12fce1d3 100644
--- content/browser/web_contents/web_contents_view_mac.h
+++ content/browser/web_contents/web_contents_view_mac.h
@@ -90,7 +90,7 @@ class WebContentsViewMac : public WebContentsView,
@@ -91,7 +91,7 @@ class WebContentsViewMac : public WebContentsView,
gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@@ -211,10 +211,10 @@ index 4141b7f..921bc79 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
index 2b45749..21c19b3 100644
index ebd0ce3..64a9d85 100644
--- content/browser/web_contents/web_contents_view_mac.mm
+++ content/browser/web_contents/web_contents_view_mac.mm
@@ -348,7 +348,8 @@ void WebContentsViewMac::CreateView(
@@ -352,7 +352,8 @@ void WebContentsViewMac::CreateView(
}
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@@ -224,7 +224,7 @@ index 2b45749..21c19b3 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -360,6 +361,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@@ -364,6 +365,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
render_widget_host->GetView());
}
@@ -233,7 +233,7 @@ index 2b45749..21c19b3 100644
g_create_render_widget_host_view
? g_create_render_widget_host_view(render_widget_host,
diff --git content/public/browser/browser_plugin_guest_delegate.h content/public/browser/browser_plugin_guest_delegate.h
index a32205c..49f3c35 100644
index 61662f4..6a4648f 100644
--- content/public/browser/browser_plugin_guest_delegate.h
+++ content/public/browser/browser_plugin_guest_delegate.h
@@ -19,6 +19,7 @@ namespace content {
@@ -244,7 +244,7 @@ index a32205c..49f3c35 100644
// Objects implement this interface to get notified about changes in the guest
// WebContents and to provide necessary functionality.
@@ -85,6 +86,10 @@ class CONTENT_EXPORT BrowserPluginGuestDelegate {
@@ -78,6 +79,10 @@ class CONTENT_EXPORT BrowserPluginGuestDelegate {
// content module.
virtual void SetGuestHost(GuestHost* guest_host) {}
@@ -256,10 +256,10 @@ index a32205c..49f3c35 100644
// reported from the guest renderer should be ignored. The reported value
// from the guest renderer is incorrect in situations where BrowserPlugin is
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 44793e9..77603b2 100644
index 255217d..1571064 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -179,6 +179,8 @@ void MimeHandlerViewGuest::CreateWebContents(
@@ -174,6 +174,8 @@ void MimeHandlerViewGuest::CreateWebContents(
WebContents::CreateParams params(browser_context(),
guest_site_instance.get());
params.guest_delegate = this;
@@ -268,7 +268,7 @@ index 44793e9..77603b2 100644
callback.Run(WebContents::Create(params));
}
@@ -203,6 +205,18 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
@@ -194,6 +196,18 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
return false;
}
@@ -288,11 +288,11 @@ index 44793e9..77603b2 100644
WebContents* source,
const content::OpenURLParams& params) {
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
index d237318..3701bd2 100644
index f3fb783..642342c 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -83,6 +83,10 @@ class MimeHandlerViewGuest :
bool ShouldHandleFindRequestsForEmbedder() const final;
@@ -87,6 +87,10 @@ class MimeHandlerViewGuest :
void DidInitialize(const base::DictionaryValue& create_params) final;
bool ZoomPropagatesFromEmbedderToGuest() const final;
+ // content::BrowserPluginGuestDelegate implementation
@@ -303,7 +303,7 @@ index d237318..3701bd2 100644
content::WebContents* OpenURLFromTab(
content::WebContents* source,
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h
index e065104d..e67ae566e 100644
index 0928bf2..e954278 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h
@@ -6,9 +6,9 @@
@@ -317,7 +317,7 @@ index e065104d..e67ae566e 100644
struct ContextMenuParams;
} // namespace content
@@ -22,6 +22,14 @@ class MimeHandlerViewGuestDelegate {
@@ -20,6 +20,14 @@ class MimeHandlerViewGuestDelegate {
MimeHandlerViewGuestDelegate() {}
virtual ~MimeHandlerViewGuestDelegate() {}

View File

@@ -1,8 +1,8 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index de5a0d8..59251d3 100644
index b7429b1..a65dfbf 100644
--- chrome/common/chrome_content_client.cc
+++ chrome/common/chrome_content_client.cc
@@ -82,7 +82,7 @@
@@ -81,7 +81,7 @@
#endif
#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
index 25b59f0..5d1c80f 100644
index 409df10..e1df182 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -217,6 +217,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
@@ -240,6 +240,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
std::unique_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
@@ -17,7 +17,7 @@ index 25b59f0..5d1c80f 100644
if (command_line->HasSwitch(switches::kHeadless))
return base::WrapUnique(new cc::SoftwareOutputDevice);
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index fe85a4e..e5584d2 100644
index 54a104a..ba76d90 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -18,6 +18,7 @@
@@ -28,7 +28,7 @@ index fe85a4e..e5584d2 100644
#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
@@ -168,6 +169,17 @@ class COMPOSITOR_EXPORT ContextFactory {
@@ -166,6 +167,17 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual void RemoveObserver(ContextFactoryObserver* observer) = 0;
};
@@ -46,7 +46,7 @@ index fe85a4e..e5584d2 100644
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -200,6 +212,9 @@ class COMPOSITOR_EXPORT Compositor
@@ -198,6 +210,9 @@ class COMPOSITOR_EXPORT Compositor
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@@ -56,7 +56,7 @@ index fe85a4e..e5584d2 100644
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -377,6 +392,8 @@ class COMPOSITOR_EXPORT Compositor
@@ -381,6 +396,8 @@ class COMPOSITOR_EXPORT Compositor
ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 47820a5..520ca4cd 100644
index ecc7952..69ef4b4 100644
--- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc
@@ -475,8 +475,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
@@ -476,8 +476,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(
@@ -38,7 +38,7 @@ index f8b651f..ec39f8d 100644
content::WebPluginInfo* plugin) override;
diff --git chrome/browser/plugins/plugin_info_message_filter.cc chrome/browser/plugins/plugin_info_message_filter.cc
index 09b5753..11a5f32 100644
index 8c31c98..beef4cb 100644
--- chrome/browser/plugins/plugin_info_message_filter.cc
+++ chrome/browser/plugins/plugin_info_message_filter.cc
@@ -451,8 +451,8 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
@@ -53,7 +53,7 @@ index 09b5753..11a5f32 100644
}
}
diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm
index 0ce31db0..58c4633 100644
index fd8c993..7f70c96 100644
--- chrome/browser/ui/cocoa/drag_util.mm
+++ chrome/browser/ui/cocoa/drag_util.mm
@@ -54,7 +54,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
@@ -66,10 +66,10 @@ index 0ce31db0..58c4633 100644
}
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index c147373..2e7cb5f 100644
index ea5764b..ae06854 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -591,6 +591,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
@@ -585,6 +585,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
content::PluginService::GetInstance()->GetPluginInfo(
-1, // process ID
MSG_ROUTING_NONE, // routing ID
@@ -78,10 +78,10 @@ index c147373..2e7cb5f 100644
mime_type, false, NULL, &plugin, NULL));
}
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
index 8dca644..d60c069 100644
index 7563fdf..d4e0a38 100644
--- content/browser/frame_host/navigation_handle_impl.cc
+++ content/browser/frame_host/navigation_handle_impl.cc
@@ -265,12 +265,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
@@ -294,12 +294,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
@@ -95,10 +95,10 @@ index 8dca644..d60c069 100644
}
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
index ccd8ee7..cc52a93 100644
index 2bdb04d..b28722e 100644
--- content/browser/frame_host/render_frame_host_impl.cc
+++ content/browser/frame_host/render_frame_host_impl.cc
@@ -814,10 +814,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
@@ -865,10 +865,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup)
IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup)
#endif
@@ -106,10 +106,10 @@ index ccd8ee7..cc52a93 100644
IPC_MESSAGE_HANDLER(FrameHostMsg_NavigationHandledByEmbedder,
OnNavigationHandledByEmbedder)
-#endif
IPC_MESSAGE_HANDLER(FrameHostMsg_RequestOverlayRoutingToken,
OnRequestOverlayRoutingToken)
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowCreatedWindow, OnShowCreatedWindow)
IPC_END_MESSAGE_MAP()
@@ -1229,6 +1227,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
@@ -1323,6 +1321,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
if (navigation_handle_) {
navigation_handle_->set_net_error_code(
static_cast<net::Error>(params.error_code));
@@ -117,7 +117,7 @@ index ccd8ee7..cc52a93 100644
}
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
@@ -2425,14 +2424,12 @@ void RenderFrameHostImpl::OnHidePopup() {
@@ -2573,14 +2572,12 @@ void RenderFrameHostImpl::OnHidePopup() {
}
#endif
@@ -130,13 +130,13 @@ index ccd8ee7..cc52a93 100644
}
-#endif
void RenderFrameHostImpl::OnShowCreatedWindow(int pending_widget_routing_id,
WindowOpenDisposition disposition,
void RenderFrameHostImpl::OnRequestOverlayRoutingToken() {
// Make sure that we have a token.
diff --git content/browser/frame_host/render_frame_host_impl.h content/browser/frame_host/render_frame_host_impl.h
index 7d13f01..9b2d494 100644
index 1d1de6e..bd05959 100644
--- content/browser/frame_host/render_frame_host_impl.h
+++ content/browser/frame_host/render_frame_host_impl.h
@@ -783,8 +783,8 @@ class CONTENT_EXPORT RenderFrameHostImpl
@@ -801,8 +801,8 @@ class CONTENT_EXPORT RenderFrameHostImpl
void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params);
void OnHidePopup();
#endif
@@ -147,10 +147,10 @@ index 7d13f01..9b2d494 100644
mojo::ScopedMessagePipeHandle pipe);
#endif
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index 5b8f571..958ebfb1 100644
index bbbb37d..1fa30da 100644
--- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc
@@ -446,6 +446,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
@@ -449,6 +449,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
void RenderFrameMessageFilter::OnGetPlugins(
bool refresh,
@@ -158,7 +158,7 @@ index 5b8f571..958ebfb1 100644
const url::Origin& main_frame_origin,
IPC::Message* reply_msg) {
// Don't refresh if the specified threshold has not been passed. Note that
@@ -467,18 +468,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
@@ -470,18 +471,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
PluginServiceImpl::GetInstance()->GetPlugins(
base::Bind(&RenderFrameMessageFilter::GetPluginsCallback, this, reply_msg,
@@ -180,7 +180,7 @@ index 5b8f571..958ebfb1 100644
int routing_id = MSG_ROUTING_NONE;
// In this loop, copy the WebPluginInfo (and do not use a reference) because
// the filter might mutate it.
@@ -487,7 +489,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
@@ -490,7 +492,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
if (!filter ||
filter->IsPluginAvailable(child_process_id, routing_id,
resource_context_, main_frame_origin.GetURL(),
@@ -189,7 +189,7 @@ index 5b8f571..958ebfb1 100644
plugins.push_back(plugin);
}
}
@@ -499,6 +501,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
@@ -502,6 +504,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
void RenderFrameMessageFilter::OnGetPluginInfo(
int render_frame_id,
const GURL& url,
@@ -197,7 +197,7 @@ index 5b8f571..958ebfb1 100644
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool* found,
@@ -507,8 +510,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
@@ -510,8 +513,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
bool allow_wildcard = true;
*found = plugin_service_->GetPluginInfo(
render_process_id_, render_frame_id, resource_context_, url,
@@ -209,10 +209,10 @@ index 5b8f571..958ebfb1 100644
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h
index 05500b4..cd00c4c 100644
index 3f49cc4..c593146 100644
--- content/browser/frame_host/render_frame_message_filter.h
+++ content/browser/frame_host/render_frame_message_filter.h
@@ -125,13 +125,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter
@@ -124,13 +124,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter
#if BUILDFLAG(ENABLE_PLUGINS)
void OnGetPlugins(bool refresh,
@@ -245,10 +245,10 @@ index 11adad4..283f116 100644
if (stale) {
// Refresh the plugins asynchronously.
diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
index 480c659..ec4d108 100644
index 4bdfa1d..cf9b916 100644
--- content/browser/plugin_service_impl.cc
+++ content/browser/plugin_service_impl.cc
@@ -243,6 +243,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
@@ -242,6 +242,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
int render_frame_id,
ResourceContext* context,
const GURL& url,
@@ -256,7 +256,7 @@ index 480c659..ec4d108 100644
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
@@ -259,7 +260,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
@@ -258,7 +259,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
for (size_t i = 0; i < plugins.size(); ++i) {
if (!filter_ ||
filter_->IsPluginAvailable(render_process_id, render_frame_id, context,
@@ -267,10 +267,10 @@ index 480c659..ec4d108 100644
if (actual_mime_type)
*actual_mime_type = mime_types[i];
diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h
index 9e7a5ef..ee721d0 100644
index 85b64da..e77f1bb 100644
--- content/browser/plugin_service_impl.h
+++ content/browser/plugin_service_impl.h
@@ -70,6 +70,7 @@ class CONTENT_EXPORT PluginServiceImpl
@@ -64,6 +64,7 @@ class CONTENT_EXPORT PluginServiceImpl
int render_frame_id,
ResourceContext* context,
const GURL& url,
@@ -279,10 +279,10 @@ index 9e7a5ef..ee721d0 100644
const std::string& mime_type,
bool allow_wildcard,
diff --git content/common/frame_messages.h content/common/frame_messages.h
index b8be34e..db85a84 100644
index 7077b9a..5fa68b1 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -1277,8 +1277,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
@@ -1298,8 +1298,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
// Used to get the list of plugins. |main_frame_origin| is used to handle
// exceptions for plugin content settings.
@@ -293,7 +293,7 @@ index b8be34e..db85a84 100644
url::Origin /* main_frame_origin */,
std::vector<content::WebPluginInfo> /* plugins */)
@@ -1286,9 +1287,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
@@ -1307,9 +1308,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
// type. If there is no matching plugin, |found| is false.
// |actual_mime_type| is the actual mime type supported by the
// found plugin.
@@ -305,7 +305,7 @@ index b8be34e..db85a84 100644
url::Origin /* main_frame_origin */,
std::string /* mime_type */,
bool /* found */,
@@ -1648,9 +1650,9 @@ IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply,
@@ -1677,9 +1679,9 @@ IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply,
IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply,
int /* nfr_request_id */,
float /* distance */)
@@ -317,10 +317,10 @@ index b8be34e..db85a84 100644
// Adding a new message? Stick to the sort order above: first platform
// independent FrameMsg, then ifdefs for platform specific FrameMsg, then
diff --git content/ppapi_plugin/ppapi_blink_platform_impl.cc content/ppapi_plugin/ppapi_blink_platform_impl.cc
index 6c24359..279edb2 100644
index e9b8930..42e3aec 100644
--- content/ppapi_plugin/ppapi_blink_platform_impl.cc
+++ content/ppapi_plugin/ppapi_blink_platform_impl.cc
@@ -211,6 +211,7 @@ blink::WebURLLoader* PpapiBlinkPlatformImpl::CreateURLLoader() {
@@ -213,6 +213,7 @@ std::unique_ptr<blink::WebURLLoader> PpapiBlinkPlatformImpl::CreateURLLoader() {
void PpapiBlinkPlatformImpl::GetPluginList(
bool refresh,
@@ -329,19 +329,19 @@ index 6c24359..279edb2 100644
blink::WebPluginListBuilder* builder) {
NOTREACHED();
diff --git content/ppapi_plugin/ppapi_blink_platform_impl.h content/ppapi_plugin/ppapi_blink_platform_impl.h
index afcf809..1c9af66 100644
index 84d29a5..3541ff0 100644
--- content/ppapi_plugin/ppapi_blink_platform_impl.h
+++ content/ppapi_plugin/ppapi_blink_platform_impl.h
@@ -45,6 +45,7 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl {
blink::WebThemeEngine* ThemeEngine() override;
blink::WebURLLoader* CreateURLLoader() override;
std::unique_ptr<blink::WebURLLoader> CreateURLLoader() override;
void GetPluginList(bool refresh,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder*) override;
blink::WebData LoadResource(const char* name) override;
diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h
index c404ac8..9dd87e7 100644
index ac05c13..762262b 100644
--- content/public/browser/plugin_service.h
+++ content/public/browser/plugin_service.h
@@ -74,6 +74,7 @@ class PluginService {
@@ -365,10 +365,10 @@ index 3b610b1..7c439e0 100644
WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.cc content/public/renderer/content_renderer_client.cc
index d29d85f..6c32ef2 100644
index 02565ee..de8fa6e 100644
--- content/public/renderer/content_renderer_client.cc
+++ content/public/renderer/content_renderer_client.cc
@@ -97,7 +97,6 @@ bool ContentRendererClient::AllowPopup() {
@@ -104,7 +104,6 @@ bool ContentRendererClient::AllowPopup() {
return false;
}
@@ -376,7 +376,7 @@ index d29d85f..6c32ef2 100644
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
bool is_content_initiated,
@@ -110,6 +109,7 @@ bool ContentRendererClient::HandleNavigation(
@@ -117,6 +116,7 @@ bool ContentRendererClient::HandleNavigation(
return false;
}
@@ -385,10 +385,20 @@ index d29d85f..6c32ef2 100644
return false;
}
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index d544fb7..260079c 100644
index 0e554ba..8ac5c54 100644
--- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h
@@ -197,7 +197,6 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -75,6 +75,9 @@ class CONTENT_EXPORT ContentRendererClient {
// Notifies us that the RenderThread has been created.
virtual void RenderThreadStarted() {}
+ // Notifies that the RenderThread can now send sync IPC messages.
+ virtual void RenderThreadConnected() {}
+
// Notifies that a new RenderFrame has been created.
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
@@ -190,7 +193,6 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed.
virtual bool AllowPopup();
@@ -396,7 +406,7 @@ index d544fb7..260079c 100644
// TODO(sgurun) This callback is deprecated and will be removed as soon
// as android webview completes implementation of a resource throttle based
// shouldoverrideurl implementation. See crbug.com/325351
@@ -213,6 +212,7 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -206,6 +208,7 @@ class CONTENT_EXPORT ContentRendererClient {
blink::WebNavigationPolicy default_policy,
bool is_redirect);
@@ -404,21 +414,44 @@ index d544fb7..260079c 100644
// Indicates if the Android MediaPlayer should be used instead of Chrome's
// built in media player for the given |url|. Defaults to false.
virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
index ebf4cd4..27a9df4 100644
--- content/public/renderer/render_frame_observer.h
+++ content/public/renderer/render_frame_observer.h
@@ -115,6 +115,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
virtual void DidObserveLoadingBehavior(
blink::WebLoadingBehaviorFlag behavior) {}
+ // Called when this frame gains focus.
+ virtual void FrameFocused() {}
+
// Called when the focused node has changed to |node|.
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index 6922b94..473d148 100644
index d1e9d50..ad7c36d7 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -2795,7 +2795,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
@@ -2902,7 +2902,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
std::string mime_type;
bool found = false;
Send(new FrameHostMsg_GetPluginInfo(
- routing_id_, params.url, frame->Top()->GetSecurityOrigin(),
+ routing_id_, params.url, frame->Parent() == nullptr,
+ frame->Top()->GetSecurityOrigin(),
- routing_id_, params.url, frame_->Top()->GetSecurityOrigin(),
+ routing_id_, params.url, frame_->Parent() == nullptr,
+ frame_->Top()->GetSecurityOrigin(),
params.mime_type.Utf8(), &found, &info, &mime_type));
if (!found)
return NULL;
@@ -5364,9 +5365,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
return nullptr;
@@ -3390,6 +3391,8 @@ void RenderFrameImpl::FrameDetached(blink::WebLocalFrame* frame,
void RenderFrameImpl::FrameFocused() {
Send(new FrameHostMsg_FrameFocused(routing_id_));
+ for (auto& observer : observers_)
+ observer.FrameFocused();
}
void RenderFrameImpl::WillCommitProvisionalLoad() {
@@ -5495,9 +5498,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
(!IsBrowserSideNavigationEnabled() ||
url != pending_navigation_params_->request_params.redirects[0]));
@@ -430,7 +463,7 @@ index 6922b94..473d148 100644
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation(
@@ -5379,7 +5379,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
@@ -5510,7 +5512,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
}
return blink::kWebNavigationPolicyIgnore;
}
@@ -438,11 +471,24 @@ index 6922b94..473d148 100644
Referrer referrer(
RenderViewImpl::GetReferrerFromRequest(frame_, info.url_request));
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 116d31a8..ef645bb 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -754,6 +754,8 @@ void RenderThreadImpl::Init(
StartServiceManagerConnection();
+ GetContentClient()->renderer()->RenderThreadConnected();
+
field_trial_syncer_.InitFieldTrialObserving(
*base::CommandLine::ForCurrentProcess(), switches::kSingleProcess);
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 4ba0c48..46f2afde 100644
index a540286..41b19d4 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -737,6 +737,7 @@ blink::WebMIDIAccessor* RendererBlinkPlatformImpl::CreateMIDIAccessor(
@@ -738,6 +738,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor(
void RendererBlinkPlatformImpl::GetPluginList(
bool refresh,
@@ -450,7 +496,7 @@ index 4ba0c48..46f2afde 100644
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) {
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -744,7 +745,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
@@ -745,7 +746,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
if (!plugin_refresh_allowed_)
refresh = false;
RenderThread::Get()->Send(
@@ -461,10 +507,10 @@ index 4ba0c48..46f2afde 100644
builder->AddPlugin(WebString::FromUTF16(plugin.name),
WebString::FromUTF16(plugin.desc),
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index 19306df..a731786 100644
index b931470..af3719a 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -121,6 +121,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -124,6 +124,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
cc::FrameSinkId GenerateFrameSinkId() override;
void GetPluginList(bool refresh,
@@ -472,3 +518,75 @@ index 19306df..a731786 100644
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) override;
blink::WebPublicSuffixList* PublicSuffixList() override;
diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc
index 3a48c59..d10ef64 100644
--- content/shell/browser/shell_plugin_service_filter.cc
+++ content/shell/browser/shell_plugin_service_filter.cc
@@ -18,6 +18,7 @@ bool ShellPluginServiceFilter::IsPluginAvailable(
int render_frame_id,
const void* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
WebPluginInfo* plugin) {
return plugin->name == base::ASCIIToUTF16("Blink Test Plugin") ||
diff --git content/shell/browser/shell_plugin_service_filter.h content/shell/browser/shell_plugin_service_filter.h
index 7767a62..8a95377 100644
--- content/shell/browser/shell_plugin_service_filter.h
+++ content/shell/browser/shell_plugin_service_filter.h
@@ -21,6 +21,7 @@ class ShellPluginServiceFilter : public PluginServiceFilter {
int render_frame_id,
const void* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
WebPluginInfo* plugin) override;
diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc
index 6746b9f..8634ada 100644
--- content/test/fake_plugin_service.cc
+++ content/test/fake_plugin_service.cc
@@ -29,6 +29,7 @@ bool FakePluginService::GetPluginInfo(int render_process_id,
int render_frame_id,
ResourceContext* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h
index db23a83..57a4c536 100644
--- content/test/fake_plugin_service.h
+++ content/test/fake_plugin_service.h
@@ -30,6 +30,7 @@ class FakePluginService : public PluginService {
int render_frame_id,
ResourceContext* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc
index 7150daf..69fcc9e 100644
--- content/test/test_blink_web_unit_test_support.cc
+++ content/test/test_blink_web_unit_test_support.cc
@@ -289,6 +289,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() {
void TestBlinkWebUnitTestSupport::GetPluginList(
bool refresh,
+ bool is_main_frame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) {
builder->AddPlugin("pdf", "pdf", "pdf-files");
diff --git content/test/test_blink_web_unit_test_support.h content/test/test_blink_web_unit_test_support.h
index 78b7d2c..62a52cb 100644
--- content/test/test_blink_web_unit_test_support.h
+++ content/test/test_blink_web_unit_test_support.h
@@ -68,6 +68,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl {
const blink::WebSize& size) override;
void GetPluginList(bool refresh,
+ bool is_main_frame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) override;

View File

@@ -1,5 +1,5 @@
diff --git build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn
index c4ca09c..40b981e 100644
index 4d385dd..1b51f2d 100644
--- build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn
+++ build/secondary/third_party/crashpad/crashpad/handler/BUILD.gn
@@ -2,6 +2,8 @@
@@ -11,7 +11,7 @@ index c4ca09c..40b981e 100644
static_library("handler_lib") {
sources = [
"crash_report_upload_thread.cc",
@@ -28,8 +30,18 @@ static_library("handler_lib") {
@@ -30,8 +32,18 @@ static_library("handler_lib") {
"../snapshot",
"../tools:tool_support",
"//base",
@@ -31,7 +31,7 @@ index c4ca09c..40b981e 100644
cflags = [ "/wd4201" ]
}
diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
index 78b04f4..abf9c98 100644
index e9578be..2561824 100644
--- chrome/common/crash_keys.cc
+++ chrome/common/crash_keys.cc
@@ -4,6 +4,8 @@
@@ -43,7 +43,7 @@ index 78b04f4..abf9c98 100644
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/format_macros.h"
@@ -88,7 +90,7 @@ const char kViewCount[] = "view-count";
@@ -86,7 +88,7 @@ const char kViewCount[] = "view-count";
const char kZeroEncodeDetails[] = "zero-encode-details";
@@ -52,7 +52,7 @@ index 78b04f4..abf9c98 100644
// The following keys may be chunked by the underlying crash logging system,
// but ultimately constitute a single key-value pair.
//
@@ -254,10 +256,16 @@ size_t RegisterChromeCrashKeys() {
@@ -226,10 +228,16 @@ size_t RegisterChromeCrashKeys() {
// 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.
@@ -71,7 +71,7 @@ index 78b04f4..abf9c98 100644
// Register the extension IDs.
{
@@ -291,7 +299,7 @@ size_t RegisterChromeCrashKeys() {
@@ -263,7 +271,7 @@ size_t RegisterChromeCrashKeys() {
return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength);
}
@@ -80,7 +80,7 @@ index 78b04f4..abf9c98 100644
static const char* const kIgnoreSwitches[] = {
switches::kEnableLogging,
switches::kFlagSwitchesBegin,
@@ -347,7 +355,7 @@ static bool IsBoringSwitch(const std::string& flag) {
@@ -319,7 +327,7 @@ static bool IsBoringSwitch(const std::string& flag) {
}
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
@@ -90,7 +90,7 @@ index 78b04f4..abf9c98 100644
void SetActiveExtensions(const std::set<std::string>& extensions) {
diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h
index 7abe208..424a2a4 100644
index 93fb0b0..3e543d2 100644
--- chrome/common/crash_keys.h
+++ chrome/common/crash_keys.h
@@ -22,10 +22,18 @@ class CommandLine;
@@ -113,7 +113,7 @@ index 7abe208..424a2a4 100644
// on the given |command_line|.
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
index 40f611f..b5e7d64 100644
index c8197e9..21ad726 100644
--- chrome_elf/BUILD.gn
+++ chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@
@@ -423,10 +423,10 @@ index 9f69c19..2abaee00 100644
} // namespace crash_reporter
diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc
index dcec346..6272df6 100644
index ba04da1..aa3f21a 100644
--- components/crash/content/app/crashpad.cc
+++ components/crash/content/app/crashpad.cc
@@ -142,7 +142,8 @@ void InitializeCrashpadImpl(bool initial_client,
@@ -143,7 +143,8 @@ void InitializeCrashpadImpl(bool initial_client,
// fallback. Forwarding is turned off for debug-mode builds even for the
// browser process, because the system's crash reporter can take a very long
// time to chew on symbols.
@@ -437,7 +437,7 @@ index dcec346..6272df6 100644
crashpad::TriState::kDisabled);
}
diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm
index 3bae07e..12b0a16 100644
index 485c2b4..3b5f3ea 100644
--- components/crash/content/app/crashpad_mac.mm
+++ components/crash/content/app/crashpad_mac.mm
@@ -16,11 +16,14 @@
@@ -455,7 +455,7 @@ index 3bae07e..12b0a16 100644
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
#include "third_party/crashpad/crashpad/client/crashpad_client.h"
#include "third_party/crashpad/crashpad/client/crashpad_info.h"
@@ -40,9 +43,10 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -42,9 +45,10 @@ base::FilePath PlatformCrashpadInitialization(
if (initial_client) {
@autoreleasepool {
@@ -469,7 +469,7 @@ index 3bae07e..12b0a16 100644
// Is there a way to recover if this fails?
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
@@ -54,16 +58,27 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -56,16 +60,27 @@ base::FilePath PlatformCrashpadInitialization(
// crash server won't have symbols for any other build types.
std::string url = "https://clients2.google.com/cr/report";
#else
@@ -502,7 +502,7 @@ index 3bae07e..12b0a16 100644
#if defined(GOOGLE_CHROME_BUILD)
// Empty means stable.
@@ -79,12 +94,16 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -81,12 +96,16 @@ base::FilePath PlatformCrashpadInitialization(
process_annotations["channel"] = "";
}
@@ -524,21 +524,21 @@ index 3bae07e..12b0a16 100644
std::vector<std::string> arguments;
@@ -105,6 +124,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
arguments.push_back(
@@ -108,6 +127,12 @@ base::FilePath PlatformCrashpadInitialization(
"--reset-own-crash-exception-port-to-system-default");
}
+
+ // Since we're using the same subprocess helper exe we must specify the
+ // process type.
+ arguments.push_back(std::string("--type=") + switches::kCrashpadHandler);
+
+ crash_reporter_client->GetCrashOptionalArguments(&arguments);
+
bool result = GetCrashpadClient().StartHandler(
handler_path, database_path, metrics_path, url, process_annotations,
arguments, true, false);
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
index 94a350f..61667a8 100644
index 6fdfd83..1d5a2a9 100644
--- components/crash/content/app/crashpad_win.cc
+++ components/crash/content/app/crashpad_win.cc
@@ -33,8 +33,8 @@ void GetPlatformCrashpadAnnotations(
@@ -564,7 +564,7 @@ index 94a350f..61667a8 100644
#endif
}
@@ -80,7 +80,7 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -82,7 +82,7 @@ base::FilePath PlatformCrashpadInitialization(
#if defined(GOOGLE_CHROME_BUILD)
std::string url = "https://clients2.google.com/cr/report";
#else
@@ -573,7 +573,7 @@ index 94a350f..61667a8 100644
#endif
// Allow the crash server to be overridden for testing. If the variable
@@ -100,22 +100,26 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -102,13 +102,14 @@ base::FilePath PlatformCrashpadInitialization(
crashpad::TriState::kEnabled, kIndirectMemoryLimit);
}
@@ -590,9 +590,10 @@ index 94a350f..61667a8 100644
if (embedded_handler) {
- start_arguments.push_back(std::string("--type=") +
- switches::kCrashpadHandler);
// The prefetch argument added here has to be documented in
// chrome_switches.cc, below the kPrefetchArgument* constants. A constant
// can't be used here because crashpad can't depend on Chrome.
if (!user_data_dir.empty()) {
start_arguments.push_back(std::string("--user-data-dir=") +
user_data_dir);
@@ -119,9 +120,12 @@ base::FilePath PlatformCrashpadInitialization(
start_arguments.push_back("/prefetch:7");
} else {
base::FilePath exe_dir = exe_file.DirName();

View File

@@ -146,28 +146,28 @@ index b64f74f..0c3c22e 100644
struct Data;
diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.h third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
index 14debac..c25c653 100644
index c769efe..daec6cd 100644
--- third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
+++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
@@ -78,7 +78,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
@@ -89,7 +89,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
//! This method may be called from any thread.
void ReportPending();
void ReportPending(const UUID& report_uuid);
- private:
+ protected:
//! \brief The result code from UploadReport().
enum class UploadResult {
//! \brief The crash report was uploaded successfully.
@@ -101,7 +101,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
//! \brief Obtains all pending reports from the database, and calls
//! ProcessPendingReport() to process each one.
@@ -117,7 +117,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
//! object was constructed with \a watch_pending_reports, it will also scan
//! the crash report database for other pending reports, and process those as
//! well.
- void ProcessPendingReports();
+ virtual void ProcessPendingReports();
//! \brief Processes a single pending report from the database.
//!
@@ -115,7 +115,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
@@ -131,7 +131,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
//! remain in the “pending” state. If the upload fails and no more retries are
//! desired, or report upload is disabled, it will be marked as “completed” in
//! the database without ever having been uploaded.
@@ -177,7 +177,7 @@ index 14debac..c25c653 100644
//! \brief Attempts to upload a crash report.
//!
diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc
index 641bf0f..3a86eb3 100644
index e6d05e2..93e5eb1 100644
--- third_party/crashpad/crashpad/handler/handler_main.cc
+++ third_party/crashpad/crashpad/handler/handler_main.cc
@@ -35,8 +35,10 @@
@@ -191,7 +191,7 @@ index 641bf0f..3a86eb3 100644
#include "client/crash_report_database.h"
#include "client/crashpad_client.h"
#include "client/crashpad_info.h"
@@ -75,6 +77,10 @@
@@ -76,6 +78,10 @@
#include "util/win/session_end_watcher.h"
#endif // OS_MACOSX
@@ -202,8 +202,8 @@ index 641bf0f..3a86eb3 100644
namespace crashpad {
namespace {
@@ -144,6 +150,9 @@ struct Options {
bool monitor_self;
@@ -147,6 +153,9 @@ struct Options {
bool periodic_tasks;
bool rate_limit;
bool upload_gzip;
+ int max_uploads;
@@ -212,7 +212,7 @@ index 641bf0f..3a86eb3 100644
};
// Splits |key_value| on '=' and inserts the resulting key and value into |map|.
@@ -425,6 +434,9 @@ int HandlerMain(int argc,
@@ -430,6 +439,9 @@ int HandlerMain(int argc,
kOptionResetOwnCrashExceptionPortToSystemDefault,
#endif // OS_MACOSX
kOptionURL,
@@ -222,7 +222,7 @@ index 641bf0f..3a86eb3 100644
// Standard options.
kOptionHelp = -2,
@@ -470,6 +482,9 @@ int HandlerMain(int argc,
@@ -476,6 +488,9 @@ int HandlerMain(int argc,
{"url", required_argument, nullptr, kOptionURL},
{"help", no_argument, nullptr, kOptionHelp},
{"version", no_argument, nullptr, kOptionVersion},
@@ -232,7 +232,7 @@ index 641bf0f..3a86eb3 100644
{nullptr, 0, nullptr, 0},
};
@@ -564,6 +579,27 @@ int HandlerMain(int argc,
@@ -575,6 +590,27 @@ int HandlerMain(int argc,
options.url = optarg;
break;
}
@@ -260,24 +260,32 @@ index 641bf0f..3a86eb3 100644
case kOptionHelp: {
Usage(me);
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly);
@@ -721,12 +757,19 @@ int HandlerMain(int argc,
@@ -734,17 +770,27 @@ int HandlerMain(int argc,
// TODO(scottmg): options.rate_limit should be removed when we have a
// configurable database setting to control upload limiting.
// See https://crashpad.chromium.org/bug/23.
+#if BUILDFLAG(ENABLE_CEF)
+ CefCrashReportUploadThread upload_thread(
+ database.get(), options.url, options.rate_limit, options.upload_gzip,
+ options.max_uploads);
+ CefCrashReportUploadThread upload_thread(database.get(),
+ options.url,
+ options.periodic_tasks,
+ options.rate_limit,
+ options.upload_gzip,
+ options.max_uploads);
+#else
CrashReportUploadThread upload_thread(
database.get(), options.url, options.rate_limit, options.upload_gzip);
CrashReportUploadThread upload_thread(database.get(),
options.url,
options.periodic_tasks,
options.rate_limit,
options.upload_gzip);
+#endif
upload_thread.Start();
PruneCrashReportThread prune_thread(database.get(),
- PruneCondition::GetDefault());
+ PruneCondition::GetDefault(options.max_database_size,
+ options.max_database_age));
prune_thread.Start();
std::unique_ptr<PruneCrashReportThread> prune_thread;
if (options.periodic_tasks) {
prune_thread.reset(new PruneCrashReportThread(
- database.get(), PruneCondition::GetDefault()));
+ database.get(), PruneCondition::GetDefault(options.max_database_size,
+ options.max_database_age)));
prune_thread->Start();
}
CrashReportExceptionHandler exception_handler(database.get(),

View File

@@ -1,8 +1,8 @@
diff --git .gn .gn
index cd7ed79..0c318f9 100644
index c91f911..bd906bc 100644
--- .gn
+++ .gn
@@ -257,6 +257,8 @@ exec_script_whitelist =
@@ -261,6 +261,8 @@ exec_script_whitelist =
# in the Chromium repo outside of //build.
"//build_overrides/build.gni",
@@ -12,11 +12,11 @@ index cd7ed79..0c318f9 100644
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index d24c2da..7f0d451 100644
index 9429718..1f8c486 100644
--- BUILD.gn
+++ BUILD.gn
@@ -158,6 +158,7 @@ group("gn_all") {
# and whether there should be other targets that are iOS-only and missing.
@@ -154,6 +154,7 @@ group("gn_all") {
if (!is_ios && !is_fuchsia) {
deps += [
"//cc:cc_unittests",
+ "//cef",
@@ -91,10 +91,10 @@ index e8b0849..0bfc676 100644
diff --git build/vs_toolchain.py build/vs_toolchain.py
index 90a562d..8c63b12 100755
index bb8f96c..6902237 100755
--- build/vs_toolchain.py
+++ build/vs_toolchain.py
@@ -78,11 +78,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
@@ -79,11 +79,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs)
os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH']
elif sys.platform == 'win32' and not depot_tools_win_toolchain:
@@ -114,20 +114,20 @@ index 90a562d..8c63b12 100755
# directory in order to run binaries locally, but they are needed in order
# to create isolates or the mini_installer. Copying them to the output
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index 4e303dc..a0398f1 100644
index 1f9a1fc..aa69e8c 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -249,7 +249,7 @@ template("chrome_paks") {
additional_source_patterns = invoker.additional_locale_source_patterns
}
input_locales = locales
- output_dir = "${invoker.output_dir}/locales"
+ output_dir = "${invoker.output_dir}/chrome/locales"
if (is_mac) {
output_locales = locales_as_mac_outputs
@@ -245,7 +245,7 @@ template("chrome_paks") {
])
input_locales = locales
- output_dir = "${invoker.output_dir}/locales"
+ output_dir = "${invoker.output_dir}/chrome/locales"
if (is_mac) {
output_locales = locales_as_mac_outputs
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
index 5d2fe25..dd08482 100644
index 2afab1a..c8791ea 100644
--- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn
@@ -128,7 +128,7 @@ template("generate_mini_installer") {

View File

@@ -1,17 +0,0 @@
diff --git gpu/command_buffer/service/feature_info.cc gpu/command_buffer/service/feature_info.cc
index 32e72c6..712d3ac 100644
--- gpu/command_buffer/service/feature_info.cc
+++ gpu/command_buffer/service/feature_info.cc
@@ -1493,8 +1493,10 @@ void FeatureInfo::InitializeFloatAndHalfFloatFeatures(
}
enable_ext_color_buffer_float = full_float_support;
}
- // Likewise for EXT_color_buffer_half_float on ES2 contexts.
- if (IsWebGL1OrES2Context() && !enable_ext_color_buffer_half_float) {
+ // Likewise for EXT_color_buffer_half_float on ES2 contexts. On desktop,
+ // require at least GL 3.0, to ensure that all formats are defined.
+ if (IsWebGL1OrES2Context() && !enable_ext_color_buffer_half_float &&
+ (gl_version_info_->is_es || gl_version_info_->IsAtLeastGL(3, 0))) {
bool full_half_float_support = true;
GLenum internal_formats[] = {
GL_R16F, GL_RG16F, GL_RGBA16F,

View File

@@ -1,8 +1,8 @@
diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids
index 4e3fd2d..2cf62da 100644
index 25abc65..04e8eab 100644
--- tools/gritsettings/resource_ids
+++ tools/gritsettings/resource_ids
@@ -362,4 +362,11 @@
@@ -371,4 +371,11 @@
# Please read the header and find the right section above instead.
# Resource ids starting at 31000 are reserved for projects built on Chromium.

View File

@@ -1,57 +0,0 @@
diff --git chrome/browser/ui/views/BUILD.gn chrome/browser/ui/views/BUILD.gn
index 47aa8b5bdbc9..d198a017a63c 100644
--- chrome/browser/ui/views/BUILD.gn
+++ chrome/browser/ui/views/BUILD.gn
@@ -27,6 +27,7 @@ component("views") {
deps = [
"//base",
"//chrome/app:command_ids",
+ "//content/public/browser",
"//printing/features",
"//skia",
"//ui/base",
diff --git extensions/browser/api/BUILD.gn extensions/browser/api/BUILD.gn
index dcf2bdb8fe74..96c9bf870c67 100644
--- extensions/browser/api/BUILD.gn
+++ extensions/browser/api/BUILD.gn
@@ -25,6 +25,8 @@ source_set("api") {
]
public_deps = [
+ "//content/public/browser",
+ "//content/public/common",
"//extensions/browser/api/activity_log",
"//extensions/browser/api/alarms",
"//extensions/browser/api/app_current_window_internal",
diff --git extensions/common/BUILD.gn extensions/common/BUILD.gn
index 8af643d9d426..189cf47e7756 100644
--- extensions/common/BUILD.gn
+++ extensions/common/BUILD.gn
@@ -271,6 +271,7 @@ if (enable_extensions) {
public_deps = [
":common_constants",
":mojo",
+ "//content/public/common",
"//ipc",
"//skia",
]
@@ -284,7 +285,6 @@ if (enable_extensions) {
"//chrome:resources",
"//components/crx_file",
"//components/url_matcher",
- "//content/public/common",
"//crypto",
"//device/bluetooth",
"//device/usb",
diff --git extensions/renderer/BUILD.gn extensions/renderer/BUILD.gn
index fca1114a561b..b049678396ee 100644
--- extensions/renderer/BUILD.gn
+++ extensions/renderer/BUILD.gn
@@ -245,6 +245,7 @@ source_set("renderer") {
"//components/guest_view/renderer",
"//content:resources",
"//extensions:extensions_resources",
+ "//extensions/common",
"//extensions/common/api",
"//gin",
"//mojo/edk/js",

View File

@@ -1,35 +1,8 @@
diff --git base/message_loop/message_loop.cc base/message_loop/message_loop.cc
index 3d55920..721aca1 100644
--- base/message_loop/message_loop.cc
+++ base/message_loop/message_loop.cc
@@ -96,12 +96,6 @@ MessageLoop::~MessageLoop() {
// may be current.
DCHECK((pump_ && current() == this) || (!pump_ && current() != this));
- // iOS just attaches to the loop, it doesn't Run it.
- // TODO(stuartmorgan): Consider wiring up a Detach().
-#if !defined(OS_IOS)
- DCHECK(!run_loop_);
-#endif
-
#if defined(OS_WIN)
if (in_high_res_mode_)
Time::ActivateHighResolutionTimer(false);
@@ -319,6 +313,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
in_high_res_mode_(false),
#endif
nestable_tasks_allowed_(true),
+#if defined(OS_WIN)
+ os_modal_loop_(false),
+#endif // OS_WIN
pump_factory_(pump_factory),
run_loop_(nullptr),
current_pending_task_(nullptr),
diff --git base/message_loop/message_loop.h base/message_loop/message_loop.h
index 2ef4537..9c657f8 100644
index fa25e78..cd62826 100644
--- base/message_loop/message_loop.h
+++ base/message_loop/message_loop.h
@@ -303,6 +303,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
@@ -288,6 +288,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate,
void AddTaskObserver(TaskObserver* task_observer);
void RemoveTaskObserver(TaskObserver* task_observer);
@@ -43,24 +16,24 @@ index 2ef4537..9c657f8 100644
+ }
+#endif // OS_WIN
+
// Can only be called from the thread that owns the MessageLoop.
bool is_running() const;
@@ -444,6 +454,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// Returns true if the message loop has high resolution timers enabled.
// Provided for testing.
bool HasHighResolutionTasks();
@@ -416,6 +426,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate,
// insider a (accidentally induced?) nested message pump.
bool nestable_tasks_allowed_;
+#if defined(OS_WIN)
+ // Should be set to true before calling Windows APIs like TrackPopupMenu, etc.
+ // which enter a modal message loop.
+ bool os_modal_loop_;
+ bool os_modal_loop_ = false;
+#endif
+
// pump_factory_.Run() is called to create a message pump for this loop
// if type_ is TYPE_CUSTOM and pump_ is null.
MessagePumpFactoryCallback pump_factory_;
diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc
index d52c785..a43b5b3 100644
index 6f48da1..e427941 100644
--- base/message_loop/message_pump_win.cc
+++ base/message_loop/message_pump_win.cc
@@ -366,20 +366,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {

View File

@@ -1,5 +1,5 @@
diff --git net/base/network_delegate.h net/base/network_delegate.h
index f602f3c..091f53e 100644
index eaa1e30..18b486d 100644
--- net/base/network_delegate.h
+++ net/base/network_delegate.h
@@ -16,6 +16,7 @@
@@ -10,9 +10,9 @@ index f602f3c..091f53e 100644
#include "net/proxy/proxy_retry_info.h"
class GURL;
@@ -112,6 +113,10 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
const GURL& target_url,
const GURL& referrer_url) const;
@@ -123,6 +124,10 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
bool CanUseReportingClient(const url::Origin& origin,
const GURL& endpoint) const;
+ virtual std::unique_ptr<SourceStream> CreateSourceStream(
+ net::URLRequest* request,
@@ -22,10 +22,10 @@ index f602f3c..091f53e 100644
// This is the interface for subclasses of NetworkDelegate to implement. These
// 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
index 464e920..9c729b3 100644
index 050ba28..05684c8 100644
--- net/url_request/url_request_job.cc
+++ net/url_request/url_request_job.cc
@@ -500,6 +500,12 @@ void URLRequestJob::NotifyHeadersComplete() {
@@ -499,6 +499,12 @@ void URLRequestJob::NotifyHeadersComplete() {
DCHECK(!source_stream_);
source_stream_ = SetUpSourceStream();

View File

@@ -55,11 +55,11 @@ index 7111970..f751d6c 100644
} // namespace net
diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc
index 2e829ad..5272c10 100644
index e838cbe..d2f6f0f 100644
--- net/http/transport_security_state.cc
+++ net/http/transport_security_state.cc
@@ -1382,8 +1382,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) {
g_ct_required_for_testing = *required ? 1 : -1;
@@ -1537,8 +1537,10 @@ void TransportSecurityState::ClearReportCachesForTesting() {
sent_expect_ct_reports_cache_.Clear();
}
-// static
@@ -72,12 +72,12 @@ index 2e829ad..5272c10 100644
// We consider built-in information to be timely for 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
index 5d3c126..2c970e8 100644
index 19ba839..a0b9810 100644
--- net/http/transport_security_state.h
+++ net/http/transport_security_state.h
@@ -479,6 +479,10 @@ class NET_EXPORT TransportSecurityState
// nullptr to reset.
static void SetShouldRequireCTForTesting(bool* required);
@@ -576,6 +576,10 @@ class NET_EXPORT TransportSecurityState
// Expect-CT reports.
void ClearReportCachesForTesting();
+ void set_enforce_net_security_expiration(bool enforce) {
+ enforce_net_security_expiration_ = enforce;
@@ -86,7 +86,7 @@ index 5d3c126..2c970e8 100644
private:
friend class TransportSecurityStateTest;
friend class TransportSecurityStateStaticFuzzer;
@@ -503,7 +507,7 @@ class NET_EXPORT TransportSecurityState
@@ -596,7 +600,7 @@ class NET_EXPORT TransportSecurityState
// IsBuildTimely returns true if the current build is new enough ensure that
// built in security information (i.e. HSTS preloading and pinning
// information) is timely.
@@ -95,7 +95,7 @@ index 5d3c126..2c970e8 100644
// Helper method for actually checking pins.
PKPStatus CheckPublicKeyPinsImpl(
@@ -594,6 +598,8 @@ class NET_EXPORT TransportSecurityState
@@ -704,6 +708,8 @@ class NET_EXPORT TransportSecurityState
// True if public key pinning bypass is enabled for local trust anchors.
bool enable_pkp_bypass_for_local_trust_anchors_;

View File

@@ -1,13 +1,12 @@
diff --git net/url_request/url_request.h net/url_request/url_request.h
index e1406f3..ed9aa91 100644
index 95a2667..68d7bfb 100644
--- net/url_request/url_request.h
+++ net/url_request/url_request.h
@@ -651,10 +651,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// Returns the error status of the request.
// Do not use! Going to be protected!
const URLRequestStatus& status() const { return status_; }
@@ -657,10 +657,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
return traffic_annotation_;
}
- protected:
+
// Allow the URLRequestJob class to control the is_pending() flag.
void set_is_pending(bool value) { is_pending_ = value; }

View File

@@ -0,0 +1,136 @@
diff --git net/base/network_change_notifier_win.cc net/base/network_change_notifier_win.cc
index 9b2b35e..1dc2038 100644
--- net/base/network_change_notifier_win.cc
+++ net/base/network_change_notifier_win.cc
@@ -14,6 +14,7 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
+#include "base/task_runner_util.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
@@ -136,8 +137,6 @@ NetworkChangeNotifierWin::NetworkChangeCalculatorParamsWin() {
//
NetworkChangeNotifier::ConnectionType
NetworkChangeNotifierWin::RecomputeCurrentConnectionType() const {
- DCHECK(CalledOnValidThread());
-
EnsureWinsockInit();
// The following code was adapted from:
@@ -205,6 +204,18 @@ NetworkChangeNotifierWin::RecomputeCurrentConnectionType() const {
: NetworkChangeNotifier::CONNECTION_NONE;
}
+void NetworkChangeNotifierWin::RecomputeCurrentConnectionTypeOnDnsThread(
+ base::Callback<void(ConnectionType)> reply_callback) const {
+ // Unretained is safe in this call because this object owns the thread and the
+ // thread is stopped in this object's destructor.
+ base::PostTaskAndReplyWithResult(
+ dns_config_service_thread_->message_loop()->task_runner().get(),
+ FROM_HERE,
+ base::Bind(&NetworkChangeNotifierWin::RecomputeCurrentConnectionType,
+ base::Unretained(this)),
+ reply_callback);
+}
+
NetworkChangeNotifier::ConnectionType
NetworkChangeNotifierWin::GetCurrentConnectionType() const {
base::AutoLock auto_lock(last_computed_connection_type_lock_);
@@ -225,12 +236,13 @@ void NetworkChangeNotifierWin::OnObjectSignaled(HANDLE object) {
// Start watching for the next address change.
WatchForAddressChange();
- NotifyObservers();
+ RecomputeCurrentConnectionTypeOnDnsThread(base::Bind(
+ &NetworkChangeNotifierWin::NotifyObservers, weak_factory_.GetWeakPtr()));
}
-void NetworkChangeNotifierWin::NotifyObservers() {
+void NetworkChangeNotifierWin::NotifyObservers(ConnectionType connection_type) {
DCHECK(CalledOnValidThread());
- SetCurrentConnectionType(RecomputeCurrentConnectionType());
+ SetCurrentConnectionType(connection_type);
NotifyObserversOfIPAddressChange();
// Calling GetConnectionType() at this very moment is likely to give
@@ -274,8 +286,11 @@ void NetworkChangeNotifierWin::WatchForAddressChange() {
// Treat the transition from NotifyAddrChange failing to succeeding as a
// network change event, since network changes were not being observed in
// that interval.
- if (sequential_failures_ > 0)
- NotifyObservers();
+ if (sequential_failures_ > 0) {
+ RecomputeCurrentConnectionTypeOnDnsThread(
+ base::Bind(&NetworkChangeNotifierWin::NotifyObservers,
+ weak_factory_.GetWeakPtr()));
+ }
if (sequential_failures_ < 2000) {
UMA_HISTOGRAM_COUNTS_10000("Net.NotifyAddrChangeFailures",
@@ -305,7 +320,14 @@ bool NetworkChangeNotifierWin::WatchForAddressChangeInternal() {
}
void NetworkChangeNotifierWin::NotifyParentOfConnectionTypeChange() {
- SetCurrentConnectionType(RecomputeCurrentConnectionType());
+ RecomputeCurrentConnectionTypeOnDnsThread(base::Bind(
+ &NetworkChangeNotifierWin::NotifyParentOfConnectionTypeChangeImpl,
+ weak_factory_.GetWeakPtr()));
+}
+
+void NetworkChangeNotifierWin::NotifyParentOfConnectionTypeChangeImpl(
+ ConnectionType connection_type) {
+ SetCurrentConnectionType(connection_type);
bool current_offline = IsOffline();
offline_polls_++;
// If we continue to appear offline, delay sending out the notification in
@@ -323,10 +345,10 @@ void NetworkChangeNotifierWin::NotifyParentOfConnectionTypeChange() {
NotifyObserversOfConnectionTypeChange();
double max_bandwidth_mbps = 0.0;
- ConnectionType connection_type = CONNECTION_NONE;
+ ConnectionType max_connection_type = CONNECTION_NONE;
GetCurrentMaxBandwidthAndConnectionType(&max_bandwidth_mbps,
- &connection_type);
- NotifyObserversOfMaxBandwidthChange(max_bandwidth_mbps, connection_type);
+ &max_connection_type);
+ NotifyObserversOfMaxBandwidthChange(max_bandwidth_mbps, max_connection_type);
}
} // namespace net
diff --git net/base/network_change_notifier_win.h net/base/network_change_notifier_win.h
index 94bab7f..6871499 100644
--- net/base/network_change_notifier_win.h
+++ net/base/network_change_notifier_win.h
@@ -9,6 +9,7 @@
#include <memory>
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
@@ -62,15 +63,21 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
// It is not thread safe, see crbug.com/324913.
virtual ConnectionType RecomputeCurrentConnectionType() const;
+ // Calls RecomputeCurrentConnectionTypeImpl on the DNS thread and runs
+ // |reply_callback| with the type on the calling thread.
+ virtual void RecomputeCurrentConnectionTypeOnDnsThread(
+ base::Callback<void(ConnectionType)> reply_callback) const;
+
void SetCurrentConnectionType(ConnectionType connection_type);
// Notifies IP address change observers of a change immediately, and notifies
// network state change observers on a delay. Must only be called on the
// thread |this| was created on.
- void NotifyObservers();
+ void NotifyObservers(ConnectionType connection_type);
// Forwards connection type notifications to parent class.
void NotifyParentOfConnectionTypeChange();
+ void NotifyParentOfConnectionTypeChangeImpl(ConnectionType connection_type);
// Tries to start listening for a single subsequent address change. Returns
// false on failure. The caller is responsible for updating |is_watching_|.

View File

@@ -1,8 +1,8 @@
diff --git BUILD.gn BUILD.gn
index 1d8f353..419c18d 100644
index 5802752..94c247e 100644
--- BUILD.gn
+++ BUILD.gn
@@ -220,6 +220,10 @@ static_library("pdfium") {
@@ -222,6 +222,10 @@ static_library("pdfium") {
if (pdf_is_complete_lib) {
complete_static_lib = true
}
@@ -14,10 +14,10 @@ index 1d8f353..419c18d 100644
static_library("test_support") {
diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
index 5010c17..ffc81fd 100644
index f20e8ab..bc34b85 100644
--- fpdfsdk/fpdfview.cpp
+++ fpdfsdk/fpdfview.cpp
@@ -31,6 +31,7 @@
@@ -35,6 +35,7 @@
#include "fpdfsdk/fsdk_define.h"
#include "fpdfsdk/fsdk_pauseadapter.h"
#include "fpdfsdk/javascript/ijs_runtime.h"
@@ -25,11 +25,11 @@ index 5010c17..ffc81fd 100644
#include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h"
#include "third_party/base/allocator/partition_allocator/partition_alloc.h"
@@ -421,6 +422,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
@@ -382,6 +383,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy();
+ FXJS_Release();
delete g_pCodecModule;
g_pCodecModule = nullptr;
IJS_Runtime::Destroy();

View File

@@ -1,8 +1,8 @@
diff --git content/public/common/common_param_traits_macros.h content/public/common/common_param_traits_macros.h
index 3dd2e75..9f61aad 100644
index 5ff2bb0..a1a62f2 100644
--- content/public/common/common_param_traits_macros.h
+++ content/public/common/common_param_traits_macros.h
@@ -201,6 +201,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
@@ -205,6 +205,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
@@ -11,10 +11,10 @@ index 3dd2e75..9f61aad 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git content/public/common/web_preferences.cc content/public/common/web_preferences.cc
index 72f7bd8..850e591 100644
index 1e00ba5..d829b4f 100644
--- content/public/common/web_preferences.cc
+++ content/public/common/web_preferences.cc
@@ -172,6 +172,7 @@ WebPreferences::WebPreferences()
@@ -171,6 +171,7 @@ WebPreferences::WebPreferences()
spatial_navigation_enabled(false),
use_solid_color_scrollbars(false),
navigate_on_drag_drop(true),
@@ -23,10 +23,10 @@ index 72f7bd8..850e591 100644
inert_visual_viewport(false),
record_whole_document(false),
diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h
index ae9756c..d0f2f1b 100644
index 80816ae..46de601 100644
--- content/public/common/web_preferences.h
+++ content/public/common/web_preferences.h
@@ -184,6 +184,7 @@ struct CONTENT_EXPORT WebPreferences {
@@ -190,6 +190,7 @@ struct CONTENT_EXPORT WebPreferences {
bool spatial_navigation_enabled;
bool use_solid_color_scrollbars;
bool navigate_on_drag_drop;
@@ -35,10 +35,10 @@ index ae9756c..d0f2f1b 100644
bool inert_visual_viewport;
bool record_whole_document;
diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc
index 7d6113c..d600026 100644
index de3e891..d703c8e 100644
--- content/renderer/render_view_impl.cc
+++ content/renderer/render_view_impl.cc
@@ -1383,6 +1383,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
@@ -1396,6 +1396,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
blink::WebView* web_view,
CompositorDependencies* compositor_deps) {
ApplyWebPreferences(prefs, web_view);

View File

@@ -78,7 +78,7 @@ index de03634..76ee3a7 100644
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h
index d11d28d..e075be3 100644
index 32b0451..9ccb733 100644
--- components/printing/common/print_messages.h
+++ components/printing/common/print_messages.h
@@ -74,7 +74,6 @@ struct PrintMsg_PrintPages_Params {
@@ -121,7 +121,7 @@ index d11d28d..e075be3 100644
// Parameters to describe a rendered document.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
// A shared memory handle to metafile data.
@@ -271,7 +266,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
@@ -265,7 +260,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
// Indicates whether the existing preview data needs to be cleared or not.
IPC_STRUCT_MEMBER(bool, clear_preview_data)
IPC_STRUCT_END()
@@ -129,7 +129,7 @@ index d11d28d..e075be3 100644
// Parameters to describe a rendered page.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params)
@@ -314,22 +308,20 @@ IPC_STRUCT_END()
@@ -308,22 +302,20 @@ IPC_STRUCT_END()
// Messages sent from the browser to the renderer.
@@ -154,7 +154,7 @@ index d11d28d..e075be3 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Tells the RenderFrame to switch the CSS to print media type, renders every
@@ -347,13 +339,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
@@ -341,13 +333,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
// Tells the RenderFrame whether printing is enabled or not.
IPC_MESSAGE_ROUTED1(PrintMsg_SetPrintingEnabled, bool /* enabled */)
@@ -168,7 +168,7 @@ index d11d28d..e075be3 100644
// Messages sent from the renderer to the browser.
@@ -409,7 +399,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
@@ -403,7 +393,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
int /* fd in browser */)
#endif // defined(OS_ANDROID)
@@ -176,7 +176,7 @@ index d11d28d..e075be3 100644
// Asks the browser to do print preview.
IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
PrintHostMsg_RequestPrintPreview_Params /* params */)
@@ -443,7 +432,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
@@ -437,7 +426,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
// The memory handle in this message is already valid in the browser process.
IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
PrintHostMsg_DidPreviewDocument_Params /* params */)
@@ -184,7 +184,7 @@ index d11d28d..e075be3 100644
// This is sent when there are invalid printer settings.
IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
@@ -452,7 +440,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
@@ -446,7 +434,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
int /* document cookie */)
@@ -192,36 +192,16 @@ index d11d28d..e075be3 100644
// Tell the browser print preview failed.
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
int /* document cookie */)
@@ -479,4 +466,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
@@ -473,4 +460,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
// Notify the browser to set print presets based on source PDF document.
IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
PrintHostMsg_SetOptionsFromDocument_Params /* params */)
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
diff --git components/printing/renderer/print_web_view_helper.cc components/printing/renderer/print_web_view_helper.cc
index 7f22427..bf43260 100644
index 3c3c4b1..b07223d 100644
--- components/printing/renderer/print_web_view_helper.cc
+++ components/printing/renderer/print_web_view_helper.cc
@@ -89,6 +89,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
bool g_is_preview_enabled = true;
+#else
+bool g_is_preview_enabled = false;
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
const char kPageLoadScriptFormat[] =
"document.open(); document.write(%s); document.close();";
@@ -103,9 +106,6 @@ void ExecuteScript(blink::WebFrame* frame,
std::string script = base::StringPrintf(script_format, json.c_str());
frame->ExecuteScript(blink::WebString::FromUTF8(script));
}
-#else
-bool g_is_preview_enabled = false;
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
int GetDPI(const PrintMsg_Print_Params* print_params) {
#if defined(OS_MACOSX)
@@ -319,7 +319,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
@@ -320,7 +320,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
return plugin && plugin->SupportsPaginatedPrint();
}
@@ -229,7 +209,7 @@ index 7f22427..bf43260 100644
// Returns true if the current destination printer is PRINT_TO_PDF.
bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
bool print_to_pdf = false;
@@ -341,7 +340,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
@@ -342,7 +341,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
}
return frame_has_custom_page_size_style;
}
@@ -237,7 +217,7 @@ index 7f22427..bf43260 100644
#if BUILDFLAG(ENABLE_PRINTING)
// Disable scaling when either:
@@ -397,7 +395,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
@@ -398,7 +396,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
}
#endif
@@ -245,7 +225,7 @@ index 7f22427..bf43260 100644
bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
bool fit_to_paper_size = false;
if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) {
@@ -440,7 +437,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
@@ -441,7 +438,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
}
return blink::kWebPrintScalingOptionFitToPrintableArea;
}
@@ -253,23 +233,7 @@ index 7f22427..bf43260 100644
// Helper function to scale and round an integer value with a double valued
// scaling.
@@ -559,7 +555,6 @@ blink::WebView* FrameReference::view() {
return view_;
}
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebCanvas* canvas,
@@ -617,7 +612,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
web_view->Close();
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
// static - Not anonymous so that platform implementations can use it.
float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
@@ -909,6 +903,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame,
@@ -916,6 +912,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame,
print_for_preview_(false),
delegate_(std::move(delegate)),
print_node_in_progress_(false),
@@ -277,7 +241,7 @@ index 7f22427..bf43260 100644
is_loading_(false),
is_scripted_preview_delayed_(false),
ipc_nesting_level_(0),
@@ -970,10 +965,8 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) {
@@ -978,10 +975,8 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) {
return;
if (g_is_preview_enabled) {
@@ -288,7 +252,7 @@ index 7f22427..bf43260 100644
} else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
Print(web_frame, blink::WebNode(), true /* is_scripted? */);
@@ -1001,14 +994,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
@@ -1007,14 +1002,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@@ -303,7 +267,7 @@ index 7f22427..bf43260 100644
IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -1052,7 +1041,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
@@ -1062,7 +1053,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
}
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@@ -311,7 +275,7 @@ index 7f22427..bf43260 100644
void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1);
@@ -1112,7 +1100,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
@@ -1122,7 +1112,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT);
}
}
@@ -319,7 +283,7 @@ index 7f22427..bf43260 100644
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points,
@@ -1137,7 +1124,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
@@ -1147,7 +1136,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
}
@@ -327,7 +291,7 @@ index 7f22427..bf43260 100644
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1)
return;
@@ -1333,7 +1319,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
@@ -1342,7 +1330,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
return true;
}
@@ -336,7 +300,7 @@ index 7f22427..bf43260 100644
bool PrintWebViewHelper::RenderPreviewPage(
int page_number,
const PrintMsg_Print_Params& print_params) {
@@ -1361,7 +1347,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
@@ -1371,7 +1359,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
}
return PreviewPageRendered(page_number, draft_metafile.get());
}
@@ -345,7 +309,7 @@ index 7f22427..bf43260 100644
bool PrintWebViewHelper::FinalizePrintReadyDocument() {
DCHECK(!is_print_ready_metafile_sent_);
@@ -1391,7 +1377,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
@@ -1401,7 +1389,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
return true;
}
@@ -353,7 +317,7 @@ index 7f22427..bf43260 100644
void PrintWebViewHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1)
@@ -1406,7 +1391,6 @@ void PrintWebViewHelper::OnSetPrintingEnabled(bool enabled) {
@@ -1416,7 +1403,6 @@ void PrintWebViewHelper::OnSetPrintingEnabled(bool enabled) {
is_printing_enabled_ = enabled;
}
@@ -361,7 +325,7 @@ index 7f22427..bf43260 100644
void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
if (ipc_nesting_level_ > 1)
return;
@@ -1417,7 +1401,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
@@ -1427,7 +1413,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
// that instead.
auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.IsNull()) {
@@ -371,7 +335,7 @@ index 7f22427..bf43260 100644
return;
}
print_preview_context_.InitWithFrame(frame);
@@ -1425,7 +1411,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
@@ -1435,7 +1423,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
? PRINT_PREVIEW_USER_INITIATED_SELECTION
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
}
@@ -379,7 +343,7 @@ index 7f22427..bf43260 100644
bool PrintWebViewHelper::IsPrintingEnabled() const {
return is_printing_enabled_;
@@ -1447,11 +1432,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
@@ -1457,11 +1444,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
print_node_in_progress_ = true;
@@ -392,7 +356,7 @@ index 7f22427..bf43260 100644
} else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Make a copy of the node, in case RenderView::OnContextMenuClosed() resets
@@ -1540,7 +1523,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
@@ -1550,7 +1535,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
}
break;
@@ -400,7 +364,7 @@ index 7f22427..bf43260 100644
case FAIL_PREVIEW:
int cookie =
print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
@@ -1552,7 +1534,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
@@ -1562,7 +1546,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
}
print_preview_context_.Failed(notify_browser_of_print_failure_);
break;
@@ -408,7 +372,7 @@ index 7f22427..bf43260 100644
}
prep_frame_view_.reset();
print_pages_params_.reset();
@@ -1685,7 +1666,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
@@ -1695,7 +1678,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true;
}
@@ -416,7 +380,7 @@ index 7f22427..bf43260 100644
bool PrintWebViewHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -1792,7 +1772,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
@@ -1802,7 +1784,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS);
return false;
}
@@ -424,34 +388,7 @@ index 7f22427..bf43260 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
void PrintWebViewHelper::GetPrintSettingsFromUser(
@@ -1854,10 +1833,8 @@ void PrintWebViewHelper::PrintPageInternal(const PrintMsg_Print_Params& params,
PageSizeMargins page_layout_in_points;
double css_scale_factor = 1.0f;
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (params.scale_factor >= kEpsilon)
css_scale_factor = params.scale_factor;
-#endif
// Save the original page size here to avoid rounding errors incurred by
// converting to pixels and back and by scaling the page for reflow and
@@ -1904,7 +1881,6 @@ void PrintWebViewHelper::PrintPageInternal(const PrintMsg_Print_Params& params,
MetafileSkiaWrapper::SetMetafileOnCanvas(canvas, metafile);
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (params.display_header_footer) {
// TODO(thestig): Figure out why Linux needs this. It is almost certainly
// |printingMinimumShrinkFactor| from Blink.
@@ -1918,7 +1894,6 @@ void PrintWebViewHelper::PrintPageInternal(const PrintMsg_Print_Params& params,
canvas, page_number + 1, print_preview_context_.total_page_count(),
*frame, scale_factor / fudge_factor, page_layout_in_points, params);
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
float webkit_scale_factor = RenderPageContent(
frame, page_number, canvas_area, content_area, scale_factor, canvas);
@@ -1953,7 +1928,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
@@ -1960,7 +1941,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
return true;
}
@@ -459,7 +396,7 @@ index 7f22427..bf43260 100644
void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false;
@@ -2084,7 +2058,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
@@ -2091,7 +2071,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true;
}
@@ -468,7 +405,7 @@ index 7f22427..bf43260 100644
PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext()
: total_page_count_(0),
diff --git components/printing/renderer/print_web_view_helper.h components/printing/renderer/print_web_view_helper.h
index 652fbf0..0050918 100644
index c4339d4..433fb26 100644
--- components/printing/renderer/print_web_view_helper.h
+++ components/printing/renderer/print_web_view_helper.h
@@ -153,9 +153,7 @@ class PrintWebViewHelper
@@ -524,23 +461,7 @@ index 652fbf0..0050918 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Get final print settings from the user.
@@ -346,7 +338,6 @@ class PrintWebViewHelper
const PrintMsg_PrintPages_Params& params,
int page_count);
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Given the |device| and |canvas| to draw on, prints the appropriate headers
// and footers using strings from |header_footer_info| on to the canvas.
static void PrintHeaderAndFooter(blink::WebCanvas* canvas,
@@ -356,7 +347,6 @@ class PrintWebViewHelper
float webkit_scale_factor,
const PageSizeMargins& page_layout_in_points,
const PrintMsg_Print_Params& params);
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Script Initiated Printing ------------------------------------------------
@@ -366,7 +356,6 @@ class PrintWebViewHelper
@@ -367,7 +359,6 @@ class PrintWebViewHelper
bool IsScriptInitiatedPrintAllowed(blink::WebLocalFrame* frame,
bool user_initiated);
@@ -548,7 +469,7 @@ index 652fbf0..0050918 100644
// Shows scripted print preview when options from plugin are available.
void ShowScriptedPrintPreview();
@@ -384,7 +373,6 @@ class PrintWebViewHelper
@@ -385,7 +376,6 @@ class PrintWebViewHelper
// |metafile| is the rendered page. Otherwise |metafile| is NULL.
// Returns true if print preview should continue, false on failure.
bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile);
@@ -556,7 +477,7 @@ index 652fbf0..0050918 100644
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
@@ -537,6 +525,7 @@ class PrintWebViewHelper
@@ -545,6 +535,7 @@ class PrintWebViewHelper
ScriptingThrottler scripting_throttler_;
bool print_node_in_progress_;
@@ -565,10 +486,10 @@ index 652fbf0..0050918 100644
bool is_loading_;
bool is_scripted_preview_delayed_;
diff --git components/printing/renderer/print_web_view_helper_mac.mm components/printing/renderer/print_web_view_helper_mac.mm
index 4c1c5b9..538845c 100644
index a00cfa0..4608dc0 100644
--- components/printing/renderer/print_web_view_helper_mac.mm
+++ components/printing/renderer/print_web_view_helper_mac.mm
@@ -74,7 +74,6 @@ void PrintWebViewHelper::PrintPagesInternal(
@@ -76,7 +76,6 @@ void PrintWebViewHelper::PrintPagesInternal(
}
}
@@ -576,7 +497,7 @@ index 4c1c5b9..538845c 100644
bool PrintWebViewHelper::RenderPreviewPage(
int page_number,
const PrintMsg_Print_Params& print_params) {
@@ -111,7 +110,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
@@ -115,7 +114,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
}
return PreviewPageRendered(page_number, draft_metafile.get());
}
@@ -584,29 +505,3 @@ index 4c1c5b9..538845c 100644
void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
int page_number,
@@ -147,14 +145,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
MetafileSkiaWrapper::SetMetafileOnCanvas(canvas, metafile);
cc::SetIsPreviewMetafile(canvas, is_preview);
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (params.display_header_footer) {
PrintHeaderAndFooter(static_cast<blink::WebCanvas*>(canvas),
page_number + 1,
print_preview_context_.total_page_count(), *frame,
scale_factor, page_layout_in_points, params);
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
RenderPageContent(frame, page_number, canvas_area, content_area,
scale_factor, static_cast<blink::WebCanvas*>(canvas));
}
diff --git components/resources/printing_resources.grdp components/resources/printing_resources.grdp
index 7213746..32b8b1e 100644
--- components/resources/printing_resources.grdp
+++ components/resources/printing_resources.grdp
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
- <if expr="enable_print_preview">
<include name="IDR_PRINT_PREVIEW_PAGE" file="../printing/resources/print_preview_page.html" flattenhtml="true" allowexternalscript="false" type="BINDATA" />
- </if>
</grit-part>

View File

@@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/render_view_host_impl.h content/browser/renderer_host/render_view_host_impl.h
index bcc702b..3753c50 100644
index c36ebdd..48aa3571 100644
--- content/browser/renderer_host/render_view_host_impl.h
+++ content/browser/renderer_host/render_view_host_impl.h
@@ -154,6 +154,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,

View File

@@ -1,14 +0,0 @@
diff --git content/browser/renderer_host/render_widget_host_view_mac.mm content/browser/renderer_host/render_widget_host_view_mac.mm
index 896170a..4beadf9 100644
--- content/browser/renderer_host/render_widget_host_view_mac.mm
+++ content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -453,9 +453,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
// Paint this view host with |background_color_| when there is no content
// ready to draw.
background_layer_.reset([[CALayer alloc] init]);
- // Set the default color to be white. This is the wrong thing to do, but many
- // UI components expect this view to be opaque.
- [background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
[cocoa_view_ setLayer:background_layer_];
[cocoa_view_ setWantsLayer:YES];

View File

@@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index 3e49165..ba55f02 100644
index e327836..17f65e1 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -740,8 +740,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer(
@@ -747,8 +747,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer(
background_color_ = color;
bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;

View File

@@ -97,7 +97,7 @@ index 2907619..f941fba 100644
SupervisedUserSettingsServiceFactory();
diff --git chrome/browser/ui/prefs/prefs_tab_helper.cc chrome/browser/ui/prefs/prefs_tab_helper.cc
index a46d449..8c9a6b8 100644
index 175e4db..e5361c5 100644
--- chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -11,8 +11,8 @@
@@ -110,7 +110,7 @@ index a46d449..8c9a6b8 100644
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -434,12 +434,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
@@ -438,12 +438,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
GetInstance()->GetServiceForBrowserContext(profile, true));
}
@@ -125,7 +125,7 @@ index a46d449..8c9a6b8 100644
PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
"PrefWatcher",
@@ -460,6 +458,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
@@ -464,6 +462,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
}
};

View File

@@ -1,16 +1,31 @@
diff --git services/service_manager/embedder/main.cc services/service_manager/embedder/main.cc
index 0debd91780b5..34c770b08ac2 100644
index e661492..8a282fd 100644
--- services/service_manager/embedder/main.cc
+++ services/service_manager/embedder/main.cc
@@ -29,7 +29,6 @@
#endif
@@ -325,13 +325,30 @@ int RunService(MainDelegate* delegate) {
return exit_code;
}
#if defined(OS_MACOSX)
-#include "base/mac/scoped_nsautorelease_pool.h"
#include "services/service_manager/embedder/mac_init.h"
+ProcessType GetProcessType(MainDelegate* delegate,
+ const base::CommandLine& command_line) {
+ ProcessType process_type = delegate->OverrideProcessType();
+ if (process_type == ProcessType::kDefault) {
+ const std::string& type_switch =
+ command_line.GetSwitchValueASCII(switches::kProcessType);
+ if (type_switch == switches::kProcessTypeServiceManager) {
+ process_type = ProcessType::kServiceManager;
+ } else if (type_switch == switches::kProcessTypeService) {
+ process_type = ProcessType::kService;
+ } else {
+ process_type = ProcessType::kEmbedder;
+ }
+ }
+ return process_type;
+}
+
} // namespace
#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
@@ -98,7 +97,7 @@ MainParams::MainParams(MainDelegate* delegate) : delegate(delegate) {}
MainParams::MainParams(MainDelegate* delegate) : delegate(delegate) {}
MainParams::~MainParams() {}
@@ -19,7 +34,7 @@ index 0debd91780b5..34c770b08ac2 100644
MainDelegate* delegate = params.delegate;
DCHECK(delegate);
@@ -151,13 +150,7 @@ int Main(const MainParams& params) {
@@ -399,30 +416,14 @@ int Main(const MainParams& params) {
MainDelegate::InitializeParams init_params;
#if defined(OS_MACOSX)
@@ -34,45 +49,75 @@ index 0debd91780b5..34c770b08ac2 100644
InitializeMac();
#endif
@@ -173,10 +166,17 @@ int Main(const MainParams& params) {
base::debug::GlobalActivityTracker::PROCESS_LAUNCH_FAILED);
tracker->process_data().SetInt("exit-code", exit_code);
}
- return exit_code;
mojo::edk::Configuration mojo_config;
- ProcessType process_type = delegate->OverrideProcessType();
- if (process_type == ProcessType::kDefault) {
- std::string type_switch =
- command_line.GetSwitchValueASCII(switches::kProcessType);
- if (type_switch == switches::kProcessTypeServiceManager) {
- mojo_config.is_broker_process = true;
- process_type = ProcessType::kServiceManager;
- } else if (type_switch == switches::kProcessTypeService) {
- process_type = ProcessType::kService;
- } else {
- process_type = ProcessType::kEmbedder;
- }
- }
+ const ProcessType process_type = GetProcessType(delegate, command_line);
+ if (process_type == ProcessType::kServiceManager)
+ mojo_config.is_broker_process = true;
mojo_config.max_message_num_bytes = kMaximumMojoMessageSize;
delegate->OverrideMojoConfiguration(&mojo_config);
mojo::edk::Init(mojo_config);
@@ -449,6 +450,16 @@ int Main(const MainParams& params) {
trace_config, base::trace_event::TraceLog::RECORDING_MODE);
}
+ return exit_code;
+}
+
+int MainRun(MainParams& params) {
+ MainDelegate* delegate = params.delegate;
+ DCHECK(delegate);
+
+ int exit_code = 0;
+ const ProcessType process_type =
+ GetProcessType(delegate, *base::CommandLine::ForCurrentProcess());
switch (process_type) {
case ProcessType::kDefault:
NOTREACHED();
@@ -470,6 +481,8 @@ int Main(const MainParams& params) {
break;
}
- exit_code = delegate->Run();
+ base::debug::GlobalActivityTracker* tracker =
+ base::debug::GlobalActivityTracker::Get();
+ int exit_code = delegate->Run();
if (tracker) {
if (exit_code == 0) {
tracker->SetProcessPhaseIfEnabled(
@@ -187,13 +187,35 @@ int Main(const MainParams& params) {
tracker->process_data().SetInt("exit-code", exit_code);
@@ -481,14 +494,39 @@ int Main(const MainParams& params) {
}
}
+ return exit_code;
+}
+
+void MainShutdown(MainParams& params) {
+ MainDelegate* delegate = params.delegate;
+ DCHECK(delegate);
+
#if defined(OS_MACOSX)
- autorelease_pool.reset();
+ params.autorelease_pool.reset();
#endif
delegate->ShutDown();
+ const ProcessType process_type =
+ GetProcessType(delegate, *base::CommandLine::ForCurrentProcess());
if (process_type == ProcessType::kEmbedder)
delegate->ShutDownEmbedderProcess();
+}
+
- return exit_code;
+int Main(MainParams& params) {
+#if defined(OS_MACOSX)
+ // We need this pool for all the objects created before we get to the event
@@ -82,17 +127,18 @@ index 0debd91780b5..34c770b08ac2 100644
+ params.autorelease_pool =
+ base::MakeUnique<base::mac::ScopedNSAutoreleasePool>();
+#endif
+
+ int exit_code = MainInitialize(params);
+ if (exit_code >= 0)
+ return exit_code;
+ exit_code = MainRun(params);
+ MainShutdown(params);
return exit_code;
+ return exit_code;
}
} // namespace service_manager
diff --git services/service_manager/embedder/main.h services/service_manager/embedder/main.h
index e86697a26d0f..771acd80a3e1 100644
index e86697a..771acd8 100644
--- services/service_manager/embedder/main.h
+++ services/service_manager/embedder/main.h
@@ -5,9 +5,15 @@
@@ -134,7 +180,7 @@ index e86697a26d0f..771acd80a3e1 100644
} // namespace service_manager
diff --git services/service_manager/embedder/set_process_title.cc services/service_manager/embedder/set_process_title.cc
index 80b9a0ab2ffc..5162354006b0 100644
index 80b9a0a..5162354 100644
--- services/service_manager/embedder/set_process_title.cc
+++ services/service_manager/embedder/set_process_title.cc
@@ -44,7 +44,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) {

View File

@@ -14,10 +14,10 @@ index e9ad038..2a10c80 100644
}
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
index 3192cd0..39b1518 100644
index 92a2e89..e4cacfe 100644
--- content/browser/blob_storage/chrome_blob_storage_context.cc
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -73,6 +73,11 @@ class BlobHandleImpl : public BlobHandle {
@@ -76,6 +76,11 @@ class BlobHandleImpl : public BlobHandle {
ChromeBlobStorageContext::ChromeBlobStorageContext() {}
@@ -30,10 +30,10 @@ index 3192cd0..39b1518 100644
BrowserContext* context) {
if (!context->GetUserData(kBlobStorageContextKeyName)) {
diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h
index 4c7cfac..4d5c09c 100644
index ad4a2a2..7c4212c 100644
--- content/browser/blob_storage/chrome_blob_storage_context.h
+++ content/browser/blob_storage/chrome_blob_storage_context.h
@@ -43,6 +43,7 @@ class CONTENT_EXPORT ChromeBlobStorageContext
@@ -45,6 +45,7 @@ class CONTENT_EXPORT ChromeBlobStorageContext
public:
ChromeBlobStorageContext();
@@ -41,11 +41,27 @@ index 4c7cfac..4d5c09c 100644
static ChromeBlobStorageContext* GetFor(
BrowserContext* browser_context);
diff --git content/browser/bluetooth/web_bluetooth_service_impl.cc content/browser/bluetooth/web_bluetooth_service_impl.cc
index 36d4ea7..f696c5b 100644
--- content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -1194,9 +1194,9 @@ url::Origin WebBluetoothServiceImpl::GetOrigin() {
}
BluetoothAllowedDevices& WebBluetoothServiceImpl::allowed_devices() {
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
+ StoragePartition* partition =
BrowserContext::GetDefaultStoragePartition(
- web_contents()->GetBrowserContext()));
+ web_contents()->GetBrowserContext());
scoped_refptr<BluetoothAllowedDevicesMap> allowed_devices_map =
partition->GetBluetoothAllowedDevicesMap();
return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin());
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
index b7a99d5..b9f70ea 100644
index 0f23bbe..b21982f 100644
--- content/browser/browser_context.cc
+++ content/browser/browser_context.cc
@@ -114,7 +114,14 @@ StoragePartition* GetStoragePartitionFromConfig(
@@ -125,7 +125,14 @@ StoragePartition* GetStoragePartitionFromConfig(
if (browser_context->IsOffTheRecord())
in_memory = true;
@@ -61,9 +77,9 @@ index b7a99d5..b9f70ea 100644
}
void SaveSessionStateOnIOThread(
@@ -505,6 +512,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
: nullptr;
}
@@ -543,6 +550,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
BrowserContext::BrowserContext()
: media_device_id_salt_(CreateRandomMediaDeviceIDSalt()) {}
+// static
+const void* BrowserContext::GetStoragePartitionMapUserDataKey() {
@@ -90,11 +106,74 @@ index 242d33e..4dfb463 100644
BackgroundSyncContext* sync_context = partition->GetBackgroundSyncContext();
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc
index f32156a..c2373f8 100644
--- content/browser/loader/navigation_url_loader_network_service.cc
+++ content/browser/loader/navigation_url_loader_network_service.cc
@@ -196,8 +196,8 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
: nullptr,
appcache_handle ? appcache_handle->core() : nullptr,
request_info_.get(), base::Passed(std::move(factory_ptr_info)),
- static_cast<StoragePartitionImpl*>(storage_partition)
- ->url_loader_factory_getter(),
+ scoped_refptr<URLLoaderFactoryGetter>(
+ storage_partition->url_loader_factory_getter()),
base::Bind(&GetWebContentsFromFrameTreeNodeID,
request_info_->frame_tree_node_id),
base::Passed(std::move(loader_associated_request)),
diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc
index 73f3cba..55d488b 100644
--- content/browser/payments/payment_app_provider_impl.cc
+++ content/browser/payments/payment_app_provider_impl.cc
@@ -153,8 +153,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps(
GetAllPaymentAppsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
- BrowserContext::GetDefaultStoragePartition(browser_context));
+ StoragePartition* partition =
+ BrowserContext::GetDefaultStoragePartition(browser_context);
scoped_refptr<PaymentAppContextImpl> payment_app_context =
partition->GetPaymentAppContext();
@@ -171,10 +171,11 @@ void PaymentAppProviderImpl::InvokePaymentApp(
const InvokePaymentAppCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
- BrowserContext::GetDefaultStoragePartition(browser_context));
+ StoragePartition* partition =
+ BrowserContext::GetDefaultStoragePartition(browser_context);
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context =
- partition->GetServiceWorkerContext();
+ static_cast<ServiceWorkerContextWrapper*>(
+ partition->GetServiceWorkerContext());
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index 9986ff6..0d2abbd 100644
index ec0d400..49261d1 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -661,7 +661,7 @@ void RenderProcessHostImpl::EarlyZygoteLaunch() {
@@ -482,7 +482,7 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
// own non-shared process.
if (partition != default_partition || is_for_guests_only) {
RenderProcessHostImpl* host = new RenderProcessHostImpl(
- browser_context_, static_cast<StoragePartitionImpl*>(partition),
+ browser_context_, partition,
is_for_guests_only);
host->SetIsNeverSuitableForReuse();
return host;
@@ -494,7 +494,7 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
return host_;
host_ = new RenderProcessHostImpl(
- browser_context_, static_cast<StoragePartitionImpl*>(partition),
+ browser_context_, partition,
false /* for guests only */);
host_->SetIsNeverSuitableForReuse();
host_->AddObserver(this);
@@ -907,7 +907,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
RenderProcessHostImpl::RenderProcessHostImpl(
BrowserContext* browser_context,
@@ -103,7 +182,7 @@ index 9986ff6..0d2abbd 100644
bool is_for_guests_only)
: fast_shutdown_started_(false),
deleting_soon_(false),
@@ -691,7 +691,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -939,7 +939,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
indexed_db_factory_(new IndexedDBDispatcherHost(
id_,
storage_partition_impl_->GetURLRequestContext(),
@@ -113,7 +192,7 @@ index 9986ff6..0d2abbd 100644
ChromeBlobStorageContext::GetFor(browser_context_))),
channel_connected_(false),
sent_render_process_ready_(false),
@@ -722,7 +723,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -970,7 +971,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
}
push_messaging_manager_.reset(new PushMessagingManager(
@@ -123,7 +202,7 @@ index 9986ff6..0d2abbd 100644
AddObserver(indexed_db_factory_.get());
#if defined(OS_MACOSX)
@@ -926,7 +928,7 @@ bool RenderProcessHostImpl::Init() {
@@ -1176,7 +1178,7 @@ bool RenderProcessHostImpl::Init() {
}
void RenderProcessHostImpl::EnableSendQueue() {
@@ -132,7 +211,7 @@ index 9986ff6..0d2abbd 100644
InitializeChannelProxy();
}
@@ -1020,6 +1022,22 @@ void RenderProcessHostImpl::ResetChannelProxy() {
@@ -1273,6 +1275,22 @@ void RenderProcessHostImpl::ResetChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -155,7 +234,7 @@ index 9986ff6..0d2abbd 100644
AddFilter(new ResourceSchedulerFilter(GetID()));
MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
@@ -1034,8 +1052,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1287,8 +1305,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
new RenderMessageFilter(
GetID(), GetBrowserContext(), request_context.get(),
widget_helper_.get(), media_internals,
@@ -166,7 +245,7 @@ index 9986ff6..0d2abbd 100644
AddFilter(render_message_filter.get());
render_frame_message_filter_ = new RenderFrameMessageFilter(
@@ -1065,10 +1083,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1317,10 +1335,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
ChromeBlobStorageContext::GetFor(browser_context);
resource_message_filter_ = new ResourceMessageFilter(
@@ -179,7 +258,7 @@ index 9986ff6..0d2abbd 100644
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
AddFilter(resource_message_filter_.get());
@@ -1092,10 +1110,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1344,10 +1362,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service()));
AddFilter(new AppCacheDispatcherHost(
@@ -192,7 +271,7 @@ index 9986ff6..0d2abbd 100644
#if BUILDFLAG(ENABLE_WEBRTC)
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(
@@ -1135,13 +1153,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1386,13 +1404,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
new CacheStorageDispatcherHost();
@@ -208,7 +287,7 @@ index 9986ff6..0d2abbd 100644
AddFilter(service_worker_filter.get());
AddFilter(new SharedWorkerMessageFilter(
@@ -1149,12 +1166,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1400,12 +1417,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
WorkerStoragePartition(
storage_partition_impl_->GetURLRequestContext(),
storage_partition_impl_->GetMediaURLRequestContext(),
@@ -224,7 +303,7 @@ index 9986ff6..0d2abbd 100644
base::Bind(&RenderWidgetHelper::GetNextRoutingID,
base::Unretained(widget_helper_.get()))));
@@ -1170,11 +1187,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1421,11 +1438,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
GetID(), storage_partition_impl_->GetQuotaManager(),
GetContentClient()->browser()->CreateQuotaPermissionContext()));
@@ -237,7 +316,7 @@ index 9986ff6..0d2abbd 100644
resource_context, service_worker_context, browser_context);
AddFilter(notification_message_filter_.get());
@@ -1191,6 +1205,11 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1441,6 +1455,11 @@ void RenderProcessHostImpl::CreateMessageFilters() {
void RenderProcessHostImpl::RegisterMojoInterfaces() {
auto registry = base::MakeUnique<service_manager::BinderRegistry>();
@@ -249,7 +328,7 @@ index 9986ff6..0d2abbd 100644
channel_->AddAssociatedInterfaceForIOThread(
base::Bind(&IndexedDBDispatcherHost::AddBinding,
base::Unretained(indexed_db_factory_.get())));
@@ -1252,8 +1271,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -1488,8 +1507,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
AddUIThreadInterface(
registry.get(),
base::Bind(&PlatformNotificationContextImpl::CreateService,
@@ -259,7 +338,7 @@ index 9986ff6..0d2abbd 100644
GetID()));
AddUIThreadInterface(
registry.get(),
@@ -1451,6 +1469,7 @@ void RenderProcessHostImpl::ForceReleaseWorkerRefCounts() {
@@ -1725,6 +1743,7 @@ void RenderProcessHostImpl::ForceReleaseWorkerRefCounts() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!is_worker_ref_count_disabled_);
is_worker_ref_count_disabled_ = true;
@@ -267,19 +346,30 @@ index 9986ff6..0d2abbd 100644
if (!GetWorkerRefCount())
return;
service_worker_ref_count_ = 0;
@@ -3064,8 +3083,8 @@ RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSiteInstance(
g_render_process_host_factory_->CreateRenderProcessHost(
browser_context, site_instance);
} else {
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
- BrowserContext::GetStoragePartition(browser_context, site_instance));
+ StoragePartition* partition =
+ BrowserContext::GetStoragePartition(browser_context, site_instance);
render_process_host = new RenderProcessHostImpl(
browser_context, partition, is_for_guests_only);
}
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
index aa6898d..f19264e 100644
index 8d5033e..45b8a7c 100644
--- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h
@@ -75,7 +75,6 @@ class RenderWidgetHost;
class RenderWidgetHostImpl;
@@ -80,7 +80,6 @@ class RenderWidgetHostImpl;
class ResourceMessageFilter;
class SiteInstanceImpl;
class StoragePartition;
-class StoragePartitionImpl;
namespace mojom {
class StoragePartitionService;
@@ -111,7 +110,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
typedef base::Thread* (*RendererMainThreadFactoryFunction)(
const InProcessChildThreadParams& params);
@@ -112,7 +111,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider) {
public:
RenderProcessHostImpl(BrowserContext* browser_context,
@@ -288,7 +378,7 @@ index aa6898d..f19264e 100644
bool is_for_guests_only);
~RenderProcessHostImpl() override;
@@ -516,10 +515,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -581,10 +580,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// called.
int instance_id_ = 1;
@@ -301,29 +391,13 @@ index aa6898d..f19264e 100644
// The observers watching our lifetime.
base::ObserverList<RenderProcessHostObserver> observers_;
diff --git content/browser/site_instance_impl.cc content/browser/site_instance_impl.cc
index a4c8862..2312f35 100644
--- content/browser/site_instance_impl.cc
+++ content/browser/site_instance_impl.cc
@@ -198,9 +198,8 @@ RenderProcessHost* SiteInstanceImpl::GetProcess() {
process_ = g_render_process_host_factory_->CreateRenderProcessHost(
browser_context, this);
} else {
- StoragePartitionImpl* partition =
- static_cast<StoragePartitionImpl*>(
- BrowserContext::GetStoragePartition(browser_context, this));
+ StoragePartition* partition =
+ BrowserContext::GetStoragePartition(browser_context, this);
process_ = new RenderProcessHostImpl(browser_context, partition,
is_for_guests_only);
}
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
index 5b706ff..6d7f7cd 100644
index 58a6de1..4835648 100644
--- content/browser/storage_partition_impl.h
+++ content/browser/storage_partition_impl.h
@@ -78,12 +78,11 @@ class CONTENT_EXPORT StoragePartitionImpl
ZoomLevelDelegate* GetZoomLevelDelegate() override;
PlatformNotificationContextImpl* GetPlatformNotificationContext() override;
@@ -110,12 +110,11 @@ class CONTENT_EXPORT StoragePartitionImpl
const base::Closure& callback) override;
void Flush() override;
void ClearBluetoothAllowedDevicesMapForTesting() override;
-
- BackgroundFetchContext* GetBackgroundFetchContext();
@@ -339,8 +413,24 @@ index 5b706ff..6d7f7cd 100644
// mojom::StoragePartitionService interface.
void OpenLocalStorage(
@@ -123,7 +122,8 @@ class CONTENT_EXPORT StoragePartitionImpl
BrowserContext* browser_context() const;
@@ -124,17 +123,20 @@ class CONTENT_EXPORT StoragePartitionImpl
// Returns the NetworkContext associated with this storage partition. Only
// used when the network service is enabled.
- mojom::NetworkContext* network_context() { return network_context_.get(); }
+ mojom::NetworkContext* network_context() override {
+ return network_context_.get();
+ }
- scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter() {
- return url_loader_factory_getter_;
+ URLLoaderFactoryGetter* url_loader_factory_getter() override {
+ return url_loader_factory_getter_.get();
}
// Can return nullptr while |this| is being destroyed.
- BrowserContext* browser_context() const;
+ BrowserContext* browser_context() const override;
// Called by each renderer process once.
- void Bind(mojo::InterfaceRequest<mojom::StoragePartitionService> request);
@@ -350,10 +440,10 @@ index 5b706ff..6d7f7cd 100644
struct DataDeletionHelper;
struct QuotaManagedDataDeletionHelper;
diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc
index 3782205..d3b4f07 100644
index 22e3c06..883114d 100644
--- content/browser/streams/stream_context.cc
+++ content/browser/streams/stream_context.cc
@@ -21,6 +21,11 @@ namespace content {
@@ -22,6 +22,11 @@ namespace content {
StreamContext::StreamContext() {}
@@ -377,20 +467,60 @@ index 075ae3e..57fb5fd 100644
CONTENT_EXPORT static StreamContext* GetFor(BrowserContext* browser_context);
void InitializeOnIOThread();
diff --git content/browser/webui/web_ui_url_loader_factory.cc content/browser/webui/web_ui_url_loader_factory.cc
index e85627c..3f55353 100644
--- content/browser/webui/web_ui_url_loader_factory.cc
+++ content/browser/webui/web_ui_url_loader_factory.cc
@@ -18,7 +18,6 @@
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/histogram_internals_url_loader.h"
#include "content/browser/resource_context_impl.h"
-#include "content/browser/storage_partition_impl.h"
#include "content/browser/webui/network_error_url_loader.h"
#include "content/browser/webui/url_data_manager_backend.h"
#include "content/browser/webui/url_data_source_impl.h"
@@ -26,6 +25,7 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "mojo/public/cpp/bindings/binding_set.h"
@@ -210,8 +210,8 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory,
public:
WebUIURLLoaderFactory(FrameTreeNode* ftn)
: frame_tree_node_id_(ftn->frame_tree_node_id()),
- storage_partition_(static_cast<StoragePartitionImpl*>(
- ftn->current_frame_host()->GetProcess()->GetStoragePartition())) {
+ storage_partition_(
+ ftn->current_frame_host()->GetProcess()->GetStoragePartition()) {
ftn->AddObserver(this);
}
@@ -278,7 +278,7 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory,
private:
int frame_tree_node_id_;
- StoragePartitionImpl* storage_partition_;
+ StoragePartition* storage_partition_;
mojo::BindingSet<mojom::URLLoaderFactory> loader_factory_bindings_;
DISALLOW_COPY_AND_ASSIGN(WebUIURLLoaderFactory);
diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h
index 89461da..619996f 100644
index 7a895f2..687da7c 100644
--- content/public/browser/browser_context.h
+++ content/public/browser/browser_context.h
@@ -171,6 +171,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
static ServiceManagerConnection* GetServiceManagerConnectionFor(
BrowserContext* browser_context);
@@ -185,6 +185,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
BrowserContext();
+ static const void* GetStoragePartitionMapUserDataKey();
+
~BrowserContext() override;
// Shuts down the storage partitions associated to this browser context.
@@ -246,6 +248,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
@@ -266,6 +268,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
const base::FilePath& partition_path,
bool in_memory) = 0;
@@ -406,7 +536,7 @@ index 89461da..619996f 100644
// Registers per-browser-context services to be loaded in the browser process
diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h
index 4d4021d..00f0c6a 100644
index 60e5c7d..14f50b3 100644
--- content/public/browser/storage_partition.h
+++ content/public/browser/storage_partition.h
@@ -13,6 +13,7 @@
@@ -417,7 +547,7 @@ index 4d4021d..00f0c6a 100644
#include "net/cookies/cookie_store.h"
class GURL;
@@ -41,16 +42,25 @@ class DatabaseTracker;
@@ -41,12 +42,18 @@ class DatabaseTracker;
namespace content {
class AppCacheService;
@@ -428,24 +558,29 @@ index 4d4021d..00f0c6a 100644
class BrowserContext;
class CacheStorageContext;
class DOMStorageContext;
class HostZoomLevelContext;
class HostZoomMap;
class IndexedDBContext;
+class PaymentAppContextImpl;
class PlatformNotificationContext;
class ServiceWorkerContext;
+class URLLoaderFactoryGetter;
#if !defined(OS_ANDROID)
class HostZoomLevelContext;
@@ -54,6 +61,11 @@ class HostZoomMap;
class ZoomLevelDelegate;
#endif // !defined(OS_ANDROID)
+namespace mojom {
+class NetworkContext;
+class StoragePartitionService;
+}
+
// Defines what persistent state a child process can access.
//
// The StoragePartition defines the view each child process has of the
@@ -74,6 +84,11 @@ class CONTENT_EXPORT StoragePartition {
virtual HostZoomLevelContext* GetHostZoomLevelContext() = 0;
@@ -79,6 +91,11 @@ class CONTENT_EXPORT StoragePartition {
virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0;
#endif // !defined(OS_ANDROID)
virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0;
+ virtual BackgroundFetchContext* GetBackgroundFetchContext() = 0;
+ virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
@@ -455,10 +590,14 @@ index 4d4021d..00f0c6a 100644
enum : uint32_t {
REMOVE_DATA_MASK_APPCACHE = 1 << 0,
@@ -179,6 +194,10 @@ class CONTENT_EXPORT StoragePartition {
@@ -184,6 +201,14 @@ class CONTENT_EXPORT StoragePartition {
// Clear the bluetooth allowed devices map. For test use only.
virtual void ClearBluetoothAllowedDevicesMapForTesting() = 0;
+ virtual mojom::NetworkContext* network_context() = 0;
+ virtual URLLoaderFactoryGetter* url_loader_factory_getter() = 0;
+ virtual BrowserContext* browser_context() const = 0;
+
+ // Called by each renderer process once.
+ virtual void Bind(
+ mojo::InterfaceRequest<mojom::StoragePartitionService> request) = 0;

View File

@@ -1,17 +1,15 @@
diff --git base/supports_user_data.h base/supports_user_data.h
index 233ce38..02e690b 100644
index 56522e2..b945297 100644
--- base/supports_user_data.h
+++ base/supports_user_data.h
@@ -39,10 +39,10 @@ class BASE_EXPORT SupportsUserData {
@@ -37,9 +37,9 @@ class BASE_EXPORT SupportsUserData {
// Multiple user data values can be stored under different keys.
// This object will TAKE OWNERSHIP of the given data pointer, and will
// delete the object if it is changed or the object is destroyed.
// TODO: remove the raw ptr version of SetUserData once everything uses
// the unique_ptr version, see crbug.com/690937.
- Data* GetUserData(const void* key) const;
- void SetUserData(const void* key, Data* data);
- void SetUserData(const void* key, std::unique_ptr<Data> data);
- void RemoveUserData(const void* key);
+ virtual Data* GetUserData(const void* key) const;
+ virtual void SetUserData(const void* key, Data* data);
+ virtual void SetUserData(const void* key, std::unique_ptr<Data> data);
+ virtual void RemoveUserData(const void* key);

View File

@@ -1,5 +1,5 @@
diff --git ui/base/dragdrop/os_exchange_data_provider_aurax11.cc ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
index 9b93593..fe0f44a 100644
index 2e4b975..d0cb122 100644
--- ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
+++ ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
@@ -162,7 +162,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url,

View File

@@ -1,123 +0,0 @@
diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h
index 15199209..a45b1ac 100644
--- ui/views/animation/ink_drop_host_view.h
+++ ui/views/animation/ink_drop_host_view.h
@@ -122,6 +122,8 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
// of CreateInkDrop() delegates to this function.
std::unique_ptr<InkDropImpl> CreateDefaultInkDropImpl();
+ InkDropMode ink_drop_mode() const { return ink_drop_mode_; }
+
private:
class InkDropGestureHandler;
friend class InkDropGestureHandler;
diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h
index 6dade72..7dd110d 100644
--- ui/views/controls/button/label_button.h
+++ ui/views/controls/button/label_button.h
@@ -116,9 +116,11 @@ class VIEWS_EXPORT LabelButton : public CustomButton,
// these bounds if they need room to do manual painting.
virtual gfx::Rect GetChildAreaBounds();
+ public:
// Sets the font list used by this button.
virtual void SetFontList(const gfx::FontList& font_list);
+ protected:
// View:
void OnPaint(gfx::Canvas* canvas) override;
void OnFocus() override;
diff --git ui/views/controls/button/menu_button.cc ui/views/controls/button/menu_button.cc
index 173194b..8bb4f6e 100644
--- ui/views/controls/button/menu_button.cc
+++ ui/views/controls/button/menu_button.cc
@@ -193,7 +193,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) {
gfx::Size MenuButton::GetPreferredSize() const {
gfx::Size prefsize = LabelButton::GetPreferredSize();
if (show_menu_marker_) {
- prefsize.Enlarge(menu_marker_->width() + kMenuMarkerPaddingLeft +
+ prefsize.Enlarge(menu_marker_->width() + GetMarkerPaddingLeft() +
kMenuMarkerPaddingRight,
0);
}
@@ -323,7 +323,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() {
gfx::Size s = size();
if (show_menu_marker_) {
- s.set_width(s.width() - menu_marker_->width() - kMenuMarkerPaddingLeft -
+ s.set_width(s.width() - menu_marker_->width() - GetMarkerPaddingLeft() -
kMenuMarkerPaddingRight);
}
@@ -412,4 +412,10 @@ int MenuButton::GetMaximumScreenXCoordinate() {
return monitor_bounds.right() - 1;
}
+int MenuButton::GetMarkerPaddingLeft() const {
+ if (!image()->GetImage().isNull() || !label()->text().empty())
+ return kMenuMarkerPaddingLeft;
+ return kMenuMarkerPaddingRight;
+}
+
} // namespace views
diff --git ui/views/controls/button/menu_button.h ui/views/controls/button/menu_button.h
index b0ddf331..4d573ed 100644
--- ui/views/controls/button/menu_button.h
+++ ui/views/controls/button/menu_button.h
@@ -54,6 +54,9 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
~MenuButton() override;
bool show_menu_marker() const { return show_menu_marker_; }
+ void set_show_menu_marker(bool show_menu_marker) {
+ show_menu_marker_ = show_menu_marker;
+ }
void set_menu_marker(const gfx::ImageSkia* menu_marker) {
menu_marker_ = menu_marker;
}
@@ -116,6 +119,9 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
// use this to make sure a menu is never shown off screen.
int GetMaximumScreenXCoordinate();
+ // Only apply left padding if there's an image or label.
+ int GetMarkerPaddingLeft() const;
+
// We use a time object in order to keep track of when the menu was closed.
// The time is used for simulating menu behavior for the menu button; that
// is, if the menu is shown and the button is pressed, we need to close the
diff --git ui/views/test/ui_controls_factory_desktop_aurax11.cc ui/views/test/ui_controls_factory_desktop_aurax11.cc
index 117a268..6065c73 100644
--- ui/views/test/ui_controls_factory_desktop_aurax11.cc
+++ ui/views/test/ui_controls_factory_desktop_aurax11.cc
@@ -146,10 +146,6 @@ class UIControlsDesktopX11 : public UIControlsAura {
aura::test::QueryLatestMousePositionRequestInHost(host);
host->ConvertPixelsToDIP(&root_current_location);
- auto* screen = views::test::TestDesktopScreenX11::GetInstance();
- DCHECK_EQ(screen, display::Screen::GetScreen());
- screen->set_cursor_screen_point(gfx::Point(screen_x, screen_y));
-
if (root_location != root_current_location && button_down_mask == 0) {
// Move the cursor because EnterNotify/LeaveNotify are generated with the
// current mouse position as a result of XGrabPointer()
diff --git ui/views/view.h ui/views/view.h
index bfa107c..01df3f4cd 100644
--- ui/views/view.h
+++ ui/views/view.h
@@ -18,6 +18,7 @@
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/supports_user_data.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_enums.h"
#include "ui/base/accelerators/accelerator.h"
@@ -115,7 +116,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
public ui::LayerOwner,
public ui::AcceleratorTarget,
public ui::EventTarget,
- public ui::EventHandler {
+ public ui::EventHandler,
+ public base::SupportsUserData {
public:
using Views = std::vector<View*>;

View File

@@ -101,11 +101,24 @@ index 00fe00c..bc4fd59 100644
DISALLOW_COPY_AND_ASSIGN(RenderText);
};
diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h
index 68e5b60..3861921 100644
--- ui/views/animation/ink_drop_host_view.h
+++ ui/views/animation/ink_drop_host_view.h
@@ -130,6 +130,8 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
// of CreateInkDrop() delegates to this function.
std::unique_ptr<InkDropImpl> CreateDefaultInkDropImpl();
+ InkDropMode ink_drop_mode() const { return ink_drop_mode_; }
+
private:
class InkDropGestureHandler;
friend class InkDropGestureHandler;
diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc
index d114946..30f4283 100644
index aa8dae7..05c89b3 100644
--- ui/views/controls/button/label_button.cc
+++ ui/views/controls/button/label_button.cc
@@ -236,6 +236,7 @@ gfx::Size LabelButton::GetPreferredSize() const {
@@ -192,6 +192,7 @@ gfx::Size LabelButton::GetPreferredSize() const {
Label label(GetText(), {label_->font_list()});
label.SetLineHeight(label_->line_height());
label.SetShadows(label_->shadows());
@@ -113,11 +126,94 @@ index d114946..30f4283 100644
if (style_ == STYLE_BUTTON && PlatformStyle::kDefaultLabelButtonHasBoldFont) {
// Some text appears wider when rendered normally than when rendered bold.
@@ -404,6 +405,11 @@ std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight()
gfx::RectF(image()->GetMirroredBounds()).CenterPoint());
}
+void LabelButton::SetFontList(const gfx::FontList& font_list) {
+ cached_normal_font_list_ = font_list;
+ label_->SetFontList(cached_normal_font_list_);
+}
+
void LabelButton::StateChanged(ButtonState old_state) {
const gfx::Size previous_image_size(image_->GetPreferredSize());
UpdateImage();
diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h
index 8495c43..da7997e 100644
--- ui/views/controls/button/label_button.h
+++ ui/views/controls/button/label_button.h
@@ -109,6 +109,9 @@ class VIEWS_EXPORT LabelButton : public CustomButton,
std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override;
std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override;
+ // Sets the font list used by this button.
+ void SetFontList(const gfx::FontList& font_list);
+
protected:
ImageView* image() const { return image_; }
Label* label() const { return label_; }
diff --git ui/views/controls/button/menu_button.cc ui/views/controls/button/menu_button.cc
index 33740d8..42c4cbc 100644
--- ui/views/controls/button/menu_button.cc
+++ ui/views/controls/button/menu_button.cc
@@ -194,7 +194,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) {
gfx::Size MenuButton::GetPreferredSize() const {
gfx::Size prefsize = LabelButton::GetPreferredSize();
if (show_menu_marker_) {
- prefsize.Enlarge(menu_marker_->width() + kMenuMarkerPaddingLeft +
+ prefsize.Enlarge(menu_marker_->width() + GetMarkerPaddingLeft() +
kMenuMarkerPaddingRight,
0);
}
@@ -324,7 +324,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() {
gfx::Size s = size();
if (show_menu_marker_) {
- s.set_width(s.width() - menu_marker_->width() - kMenuMarkerPaddingLeft -
+ s.set_width(s.width() - menu_marker_->width() - GetMarkerPaddingLeft() -
kMenuMarkerPaddingRight);
}
@@ -416,4 +416,10 @@ int MenuButton::GetMaximumScreenXCoordinate() {
return monitor_bounds.right() - 1;
}
+int MenuButton::GetMarkerPaddingLeft() const {
+ if (!image()->GetImage().isNull() || !label()->text().empty())
+ return kMenuMarkerPaddingLeft;
+ return kMenuMarkerPaddingRight;
+}
+
} // namespace views
diff --git ui/views/controls/button/menu_button.h ui/views/controls/button/menu_button.h
index 0d87c31..bcaa1ec 100644
--- ui/views/controls/button/menu_button.h
+++ ui/views/controls/button/menu_button.h
@@ -57,6 +57,9 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
~MenuButton() override;
bool show_menu_marker() const { return show_menu_marker_; }
+ void set_show_menu_marker(bool show_menu_marker) {
+ show_menu_marker_ = show_menu_marker;
+ }
void set_menu_marker(const gfx::ImageSkia* menu_marker) {
menu_marker_ = menu_marker;
}
@@ -121,6 +124,9 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
// use this to make sure a menu is never shown off screen.
int GetMaximumScreenXCoordinate();
+ // Only apply left padding if there's an image or label.
+ int GetMarkerPaddingLeft() const;
+
// We use a time object in order to keep track of when the menu was closed.
// The time is used for simulating menu behavior for the menu button; that
// is, if the menu is shown and the button is pressed, we need to close the
diff --git ui/views/controls/label.cc ui/views/controls/label.cc
index 762227f..18a7293 100644
index 2523f9a..ef64aac 100644
--- ui/views/controls/label.cc
+++ ui/views/controls/label.cc
@@ -27,6 +27,7 @@
@@ -26,6 +26,7 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/text_elider.h"
@@ -125,12 +221,10 @@ index 762227f..18a7293 100644
#include "ui/native_theme/native_theme.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/background.h"
@@ -36,6 +37,25 @@
#include "ui/views/selection_controller.h"
namespace views {
+
+namespace {
@@ -42,6 +43,20 @@ namespace {
gfx::Insets NonBorderInsets(const Label& label) {
return label.GetInsets() - label.View::GetInsets();
}
+
+// Strips accelerator character prefixes in |text| if needed, based on |flags|.
+// Returns a range in |text| to underline or Range::InvalidRange() if
@@ -145,13 +239,10 @@ index 762227f..18a7293 100644
+ }
+ return gfx::Range::InvalidRange();
+}
+
+} // namespace
+
// static
} // namespace
const char Label::kViewClassName[] = "Label";
const int Label::kFocusBorderPadding = 1;
@@ -215,6 +235,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
@@ -221,6 +236,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
ResetLayout();
}
@@ -167,7 +258,7 @@ index 762227f..18a7293 100644
void Label::SetTooltipText(const base::string16& tooltip_text) {
DCHECK(handles_tooltips_);
tooltip_text_ = tooltip_text;
@@ -449,7 +478,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText(
@@ -446,7 +470,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText(
render_text->SetFontList(font_list());
render_text->set_shadows(shadows());
render_text->SetCursorEnabled(false);
@@ -189,10 +280,10 @@ index 762227f..18a7293 100644
}
diff --git ui/views/controls/label.h ui/views/controls/label.h
index f9c49d0..b1fa1fa 100644
index 0fa4db8..6d48a9b 100644
--- ui/views/controls/label.h
+++ ui/views/controls/label.h
@@ -147,6 +147,10 @@ class VIEWS_EXPORT Label : public View,
@@ -144,6 +144,10 @@ class VIEWS_EXPORT Label : public View,
void SetElideBehavior(gfx::ElideBehavior elide_behavior);
gfx::ElideBehavior elide_behavior() const { return elide_behavior_; }
@@ -203,7 +294,7 @@ index f9c49d0..b1fa1fa 100644
// Sets the tooltip text. Default behavior for a label (single-line) is to
// show the full text if it is wider than its bounds. Calling this overrides
// the default behavior and lets you set a custom tooltip. To revert to
@@ -367,6 +371,7 @@ class VIEWS_EXPORT Label : public View,
@@ -365,6 +369,7 @@ class VIEWS_EXPORT Label : public View,
bool collapse_when_hidden_;
int fixed_width_;
int max_width_;
@@ -212,10 +303,10 @@ index f9c49d0..b1fa1fa 100644
// TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is
// closed.
diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc
index 3f9436d..0bf813a1 100644
index 7c44dd17..2da694b 100644
--- ui/views/controls/menu/menu_controller.cc
+++ ui/views/controls/menu/menu_controller.cc
@@ -2261,8 +2261,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem(
@@ -2259,8 +2259,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem(
void MenuController::OpenSubmenuChangeSelectionIfCan() {
MenuItemView* item = pending_state_.item;
@@ -230,7 +321,7 @@ index 3f9436d..0bf813a1 100644
MenuItemView* to_select = NULL;
if (item->GetSubmenu()->GetMenuItemCount() > 0)
to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN);
@@ -2277,8 +2282,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
@@ -2275,8 +2280,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
void MenuController::CloseSubmenu() {
MenuItemView* item = state_.item;
DCHECK(item);
@@ -243,7 +334,7 @@ index 3f9436d..0bf813a1 100644
SetSelection(item, SELECTION_UPDATE_IMMEDIATELY);
else if (item->GetParentMenuItem()->GetParentMenuItem())
diff --git ui/views/controls/menu/menu_delegate.h ui/views/controls/menu/menu_delegate.h
index db99e54..7c67a04 100644
index 4dea63f..ef50b71 100644
--- ui/views/controls/menu/menu_delegate.h
+++ ui/views/controls/menu/menu_delegate.h
@@ -10,6 +10,7 @@
@@ -254,11 +345,10 @@ index db99e54..7c67a04 100644
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/ui_base_types.h"
@@ -75,6 +76,22 @@ class VIEWS_EXPORT MenuDelegate {
// Whether this item should be displayed with the normal text color, even if
@@ -76,6 +77,22 @@ class VIEWS_EXPORT MenuDelegate {
// it's disabled.
virtual bool GetShouldUseNormalForegroundColor(int command_id) const;
+
+ // Override the text color of a given menu item dependent on the |command_id|
+ // and its |is_hovered| state. |is_minor| will be true for accelerator text.
+ // Returns true if it chooses to override the color.
@@ -274,9 +364,10 @@ index db99e54..7c67a04 100644
+ bool is_hovered,
+ SkColor* override_color) const
+ { return false; }
+
// The tooltip shown for the menu item. This is invoked when the user
// hovers over the item, and no tooltip text has been set for that item.
virtual base::string16 GetTooltipText(int id,
@@ -208,6 +225,11 @@ class VIEWS_EXPORT MenuDelegate {
bool* has_mnemonics,
MenuButton** button);
@@ -290,10 +381,10 @@ index db99e54..7c67a04 100644
virtual int GetMaxWidthForMenu(MenuItemView* menu);
diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc
index 450cf5a..2a0cbcf 100644
index c2d98e2..8d12a05 100644
--- ui/views/controls/menu/menu_item_view.cc
+++ ui/views/controls/menu/menu_item_view.cc
@@ -759,7 +759,12 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
@@ -761,7 +761,12 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
// only need the background when we want it to look different, as when we're
// selected.
ui::NativeTheme* native_theme = GetNativeTheme();
@@ -307,7 +398,7 @@ index 450cf5a..2a0cbcf 100644
gfx::Rect item_bounds(0, 0, width(), height());
AdjustBoundsForRTLUI(&item_bounds);
@@ -871,6 +876,13 @@ void MenuItemView::PaintMinorText(gfx::Canvas* canvas, SkColor color) {
@@ -873,6 +878,13 @@ void MenuItemView::PaintMinorText(gfx::Canvas* canvas, SkColor color) {
SkColor MenuItemView::GetTextColor(bool minor,
bool render_selection,
bool emphasized) const {
@@ -322,7 +413,7 @@ index 450cf5a..2a0cbcf 100644
minor ? ui::NativeTheme::kColorId_MenuItemSubtitleColor
: ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor;
diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc
index bc04dcb..1f821d9 100644
index 06a9d3c..c602a13 100644
--- ui/views/controls/menu/menu_model_adapter.cc
+++ ui/views/controls/menu/menu_model_adapter.cc
@@ -245,6 +245,77 @@ void MenuModelAdapter::SelectionChanged(MenuItemView* menu) {
@@ -404,7 +495,7 @@ index bc04dcb..1f821d9 100644
// Look up the menu model for this menu.
const std::map<MenuItemView*, ui::MenuModel*>::const_iterator map_iterator =
diff --git ui/views/controls/menu/menu_model_adapter.h ui/views/controls/menu/menu_model_adapter.h
index c9799da..401e7a7 100644
index 0ac493c..741769e 100644
--- ui/views/controls/menu/menu_model_adapter.h
+++ ui/views/controls/menu/menu_model_adapter.h
@@ -76,6 +76,20 @@ class VIEWS_EXPORT MenuModelAdapter : public MenuDelegate {
@@ -427,7 +518,7 @@ index c9799da..401e7a7 100644
+ SkColor* override_color) const override;
void WillShowMenu(MenuItemView* menu) override;
void WillHideMenu(MenuItemView* menu) override;
void OnMenuClosed(MenuItemView* menu, MenuRunner::RunResult result) override;
void OnMenuClosed(MenuItemView* menu) override;
diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc
index 124442a..c5cfe8b 100644
--- ui/views/controls/menu/menu_scroll_view_container.cc
@@ -444,3 +535,40 @@ index 124442a..c5cfe8b 100644
arrow_ = BubbleBorderTypeFromAnchor(
content_view_->GetMenuItem()->GetMenuController()->GetAnchorPosition());
diff --git ui/views/test/ui_controls_factory_desktop_aurax11.cc ui/views/test/ui_controls_factory_desktop_aurax11.cc
index 117a268..6065c73 100644
--- ui/views/test/ui_controls_factory_desktop_aurax11.cc
+++ ui/views/test/ui_controls_factory_desktop_aurax11.cc
@@ -146,10 +146,6 @@ class UIControlsDesktopX11 : public UIControlsAura {
aura::test::QueryLatestMousePositionRequestInHost(host);
host->ConvertPixelsToDIP(&root_current_location);
- auto* screen = views::test::TestDesktopScreenX11::GetInstance();
- DCHECK_EQ(screen, display::Screen::GetScreen());
- screen->set_cursor_screen_point(gfx::Point(screen_x, screen_y));
-
if (root_location != root_current_location && button_down_mask == 0) {
// Move the cursor because EnterNotify/LeaveNotify are generated with the
// current mouse position as a result of XGrabPointer()
diff --git ui/views/view.h ui/views/view.h
index 410e2a5..0ba4765 100644
--- ui/views/view.h
+++ ui/views/view.h
@@ -18,6 +18,7 @@
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/supports_user_data.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_enums.h"
#include "ui/base/accelerators/accelerator.h"
@@ -115,7 +116,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
public ui::LayerOwner,
public ui::AcceleratorTarget,
public ui::EventTarget,
- public ui::EventHandler {
+ public ui::EventHandler,
+ public base::SupportsUserData {
public:
using Views = std::vector<View*>;

View File

@@ -1,24 +1,8 @@
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
index 4dd0e59..d9394c7 100644
index 527e5ea..de52a1e 100644
--- content/browser/renderer_host/render_widget_host_view_base.cc
+++ content/browser/renderer_host/render_widget_host_view_base.cc
@@ -40,6 +40,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
current_device_scale_factor_(0),
current_display_rotation_(display::Display::ROTATE_0),
text_input_manager_(nullptr),
+ has_external_parent_(false),
renderer_frame_number_(0),
weak_factory_(this) {}
@@ -138,7 +139,6 @@ void RenderWidgetHostViewBase::SetIsInVR(bool is_in_vr) {
}
bool RenderWidgetHostViewBase::IsInVR() const {
- NOTIMPLEMENTED();
return false;
}
@@ -310,6 +310,14 @@ void RenderWidgetHostViewBase::FocusedNodeTouched(
@@ -299,6 +299,14 @@ void RenderWidgetHostViewBase::FocusedNodeTouched(
DVLOG(1) << "FocusedNodeTouched: " << editable;
}
@@ -34,17 +18,17 @@ index 4dd0e59..d9394c7 100644
return renderer_frame_number_;
}
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
index 3f0cdab..581b984 100644
index 904897a..38f6e28 100644
--- content/browser/renderer_host/render_widget_host_view_base.h
+++ content/browser/renderer_host/render_widget_host_view_base.h
@@ -73,6 +73,7 @@ class BrowserAccessibilityDelegate;
@@ -72,6 +72,7 @@ class BrowserAccessibilityDelegate;
class BrowserAccessibilityManager;
class RenderWidgetHostImpl;
class RenderWidgetHostViewBaseObserver;
+class RenderWidgetHostViewGuest;
class SyntheticGestureTarget;
class TextInputManager;
class WebCursor;
class TouchSelectionControllerClientManager;
@@ -119,6 +120,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
void EndFrameSubscription() override;
void FocusedNodeTouched(const gfx::Point& location_dips_screen,
@@ -54,7 +38,7 @@ index 3f0cdab..581b984 100644
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
// that handle content embedded within other RenderWidgetHostViews.
@@ -353,6 +356,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
@@ -355,6 +358,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// helps to position the full screen widget on the correct monitor.
virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0;
@@ -67,19 +51,19 @@ index 3f0cdab..581b984 100644
// Sets the cursor to the one associated with the specified cursor_type
virtual void UpdateCursor(const WebCursor& cursor) = 0;
@@ -454,6 +463,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// destroyed before the RWHV is destroyed.
TextInputManager* text_input_manager_;
@@ -469,6 +478,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
const bool wheel_scroll_latching_enabled_;
+ // True if the widget has a external parent view/window outside of the
+ // Chromium-controlled view/window hierarchy.
+ bool has_external_parent_;
+
private:
void FlushInput();
gfx::Rect current_display_area_;
diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc
index 980a6780..cfcc1e2 100644
index 0401ce6..99e85e9 100644
--- content/browser/renderer_host/render_widget_host_view_event_handler.cc
+++ content/browser/renderer_host/render_widget_host_view_event_handler.cc
@@ -28,6 +28,10 @@
@@ -93,7 +77,7 @@ index 980a6780..cfcc1e2 100644
#if defined(OS_WIN)
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/public/common/context_menu_params.h"
@@ -822,6 +826,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
@@ -847,6 +851,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
}
}
#endif
@@ -141,7 +125,7 @@ index f772f64..7d13f9f 100644
return host ? host->GetAcceleratedWidget() : NULL;
}
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index fd25fc6..80b8093 100644
index e99be28..4d3fec5 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -85,6 +85,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin(
@@ -200,7 +184,7 @@ index 12d0616..ec5742a 100644
// a reference.
corewm::TooltipWin* tooltip_;
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 4215122..846f45e 100644
index e7fd89c..d3b2621 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -198,6 +198,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
@@ -247,7 +231,7 @@ index 4215122..846f45e 100644
return ToDIPRect(bounds_in_pixels_);
}
@@ -1293,6 +1300,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels(
@@ -1296,6 +1303,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels(
}
gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const {
@@ -256,7 +240,7 @@ index 4215122..846f45e 100644
return bounds_in_pixels_.origin();
}
@@ -1419,9 +1428,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
@@ -1422,9 +1431,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
attribute_mask |= CWBorderPixel;
swa.border_pixel = 0;
@@ -273,7 +257,7 @@ index 4215122..846f45e 100644
bounds_in_pixels_.y(), bounds_in_pixels_.width(),
bounds_in_pixels_.height(),
0, // border width
@@ -2040,6 +2055,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
@@ -2042,6 +2057,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
}
break;
}
@@ -333,7 +317,7 @@ index 757b780..45d57ae 100644
base::WeakPtrFactory<DesktopWindowTreeHostX11> weak_factory_;
diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc
index de3ac38..b417146 100644
index fbce29e..0538a4c 100644
--- ui/views/widget/widget.cc
+++ ui/views/widget/widget.cc
@@ -131,6 +131,7 @@ Widget::InitParams::InitParams(Type type)
@@ -368,7 +352,7 @@ index de3ac38..b417146 100644
// This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492
diff --git ui/views/widget/widget.h ui/views/widget/widget.h
index 36b86ea..9a39084 100644
index 63fcb9d..7237ae6 100644
--- ui/views/widget/widget.h
+++ ui/views/widget/widget.h
@@ -253,6 +253,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@@ -380,10 +364,10 @@ index 36b86ea..9a39084 100644
// the NativeWidget may specify a default size. If the parent is specified,
// |bounds| is in the parent's coordinate system. If the parent is not
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
index 7590741..0e06a35 100644
index 3c67457..e34a9a6 100644
--- ui/views/win/hwnd_message_handler.cc
+++ ui/views/win/hwnd_message_handler.cc
@@ -2664,8 +2664,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -2670,8 +2670,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
active_mouse_tracking_flags_ = 0;
} else if (event.type() == ui::ET_MOUSEWHEEL) {
// Reroute the mouse wheel to the window under the pointer if applicable.

View File

@@ -1,8 +1,8 @@
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
index 6c9c358..fe5df86 100644
index 627a0e5..21c6210 100644
--- content/browser/web_contents/web_contents_impl.cc
+++ content/browser/web_contents/web_contents_impl.cc
@@ -1581,6 +1581,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -1692,6 +1692,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
@@ -15,7 +15,7 @@ index 6c9c358..fe5df86 100644
WebContentsViewDelegate* delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -1591,6 +1597,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -1702,6 +1708,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
view_.reset(CreateWebContentsView(this, delegate,
&render_view_host_delegate_view_));
}
@@ -23,7 +23,7 @@ index 6c9c358..fe5df86 100644
if (browser_plugin_guest_ && !GuestMode::IsCrossProcessFrameGuest(this)) {
view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
@@ -2127,6 +2134,15 @@ void WebContentsImpl::CreateNewWindow(
@@ -2259,6 +2266,15 @@ void WebContentsImpl::CreateNewWindow(
create_params.renderer_initiated_creation =
main_frame_route_id != MSG_ROUTING_NONE;
@@ -31,7 +31,7 @@ index 6c9c358..fe5df86 100644
+ delegate_->GetCustomWebContentsView(this,
+ params.target_url,
+ render_process_id,
+ params.opener_render_frame_id,
+ opener->GetRoutingID(),
+ &create_params.view,
+ &create_params.delegate_view);
+ }
@@ -39,7 +39,7 @@ index 6c9c358..fe5df86 100644
WebContentsImpl* new_contents = NULL;
if (!is_guest) {
create_params.context = view_->GetNativeView();
@@ -2156,7 +2172,7 @@ void WebContentsImpl::CreateNewWindow(
@@ -2288,7 +2304,7 @@ void WebContentsImpl::CreateNewWindow(
// TODO(brettw): It seems bogus that we have to call this function on the
// newly created object and give it one of its own member variables.
new_view->CreateViewForWidget(
@@ -48,7 +48,7 @@ index 6c9c358..fe5df86 100644
}
// Save the created window associated with the route so we can show it
// later.
@@ -5029,7 +5045,7 @@ NavigationEntry*
@@ -5182,7 +5198,7 @@ NavigationEntry*
void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager(
RenderViewHost* render_view_host) {
RenderWidgetHostViewBase* rwh_view =
@@ -73,10 +73,10 @@ index fa0afb5..d677b31 100644
WebContents::CreateParams::CreateParams(const CreateParams& other) = default;
diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h
index f968ca2..ee6f060 100644
index ebd18a0..549329f 100644
--- content/public/browser/web_contents.h
+++ content/public/browser/web_contents.h
@@ -60,9 +60,11 @@ class PageState;
@@ -67,9 +67,11 @@ class PageState;
class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
@@ -88,7 +88,7 @@ index f968ca2..ee6f060 100644
struct CustomContextMenuContext;
struct DropData;
struct Manifest;
@@ -163,6 +165,10 @@ class WebContents : public PageNavigator,
@@ -170,6 +172,10 @@ class WebContents : public PageNavigator,
// Note that the pre-created renderer process may not be used if the first
// navigation requires a dedicated or privileged process, such as a WebUI.
bool initialize_renderer;
@@ -100,10 +100,10 @@ index f968ca2..ee6f060 100644
// Creates a new WebContents.
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
index 232d3a9..6622768 100644
index 9176c4b..7d73b9d 100644
--- content/public/browser/web_contents_delegate.h
+++ content/public/browser/web_contents_delegate.h
@@ -42,11 +42,13 @@ class ColorChooser;
@@ -43,10 +43,12 @@ class ColorChooser;
class JavaScriptDialogManager;
class PageState;
class RenderFrameHost;
@@ -111,7 +111,6 @@ index 232d3a9..6622768 100644
class RenderWidgetHost;
class SessionStorageNamespace;
class SiteInstance;
class WebContents;
class WebContentsImpl;
+class WebContentsView;
struct ColorSuggestion;
@@ -131,4 +130,4 @@ index 232d3a9..6622768 100644
+
// Notifies the delegate about the creation of a new WebContents. This
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
virtual void WebContentsCreated(

View File

@@ -1,8 +1,8 @@
diff --git third_party/WebKit/Source/core/dom/DOMImplementation.cpp third_party/WebKit/Source/core/dom/DOMImplementation.cpp
index 8aab9bb..e3286f6 100644
index 372b21d..78107f3 100644
--- third_party/WebKit/Source/core/dom/DOMImplementation.cpp
+++ third_party/WebKit/Source/core/dom/DOMImplementation.cpp
@@ -241,10 +241,11 @@ Document* DOMImplementation::createDocument(const String& type,
@@ -242,10 +242,11 @@ Document* DOMImplementation::createDocument(const String& type,
// For that reason, the origin must be retrieved directly from init.url().
if (init.GetFrame()->IsMainFrame()) {
RefPtr<SecurityOrigin> origin = SecurityOrigin::Create(init.Url());
@@ -15,22 +15,22 @@ index 8aab9bb..e3286f6 100644
+ init.GetFrame()->GetPage()->GetPluginData(false, init.GetFrame()
->Tree()
.Top()
->GetSecurityContext()
.GetSecurityContext()
diff --git third_party/WebKit/Source/core/frame/LocalFrame.cpp third_party/WebKit/Source/core/frame/LocalFrame.cpp
index b64d75d..869b45d 100644
index 9c6d497..6296f53 100644
--- third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -927,7 +927,7 @@ ContentSettingsClient* LocalFrame::GetContentSettingsClient() {
@@ -930,7 +930,7 @@ ContentSettingsClient* LocalFrame::GetContentSettingsClient() {
PluginData* LocalFrame::GetPluginData() const {
if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
return nullptr;
- return GetPage()->GetPluginData(
+ return GetPage()->GetPluginData(IsMainFrame(),
Tree().Top()->GetSecurityContext()->GetSecurityOrigin());
Tree().Top().GetSecurityContext()->GetSecurityOrigin());
}
diff --git third_party/WebKit/Source/core/page/Page.cpp third_party/WebKit/Source/core/page/Page.cpp
index 941a30c..2c5764c 100644
index 6dc4b21..41d56b5 100644
--- third_party/WebKit/Source/core/page/Page.cpp
+++ third_party/WebKit/Source/core/page/Page.cpp
@@ -289,16 +289,30 @@ void Page::RefreshPlugins() {
@@ -157,10 +157,10 @@ index cdf3381..671f17c 100644
};
diff --git third_party/WebKit/public/platform/Platform.h third_party/WebKit/public/platform/Platform.h
index eab1ca5..6657878 100644
index f7360bf6..f7599cc 100644
--- third_party/WebKit/public/platform/Platform.h
+++ third_party/WebKit/public/platform/Platform.h
@@ -365,6 +365,7 @@ class BLINK_PLATFORM_EXPORT Platform {
@@ -363,6 +363,7 @@ class BLINK_PLATFORM_EXPORT Platform {
// satisfy this call. mainFrameOrigin is used by the browser process to
// filter plugins from the plugin list based on content settings.
virtual void GetPluginList(bool refresh,

View File

@@ -1,18 +1,31 @@
diff --git third_party/WebKit/Source/core/exported/WebViewBase.h third_party/WebKit/Source/core/exported/WebViewBase.h
index ed45829..a43bd1e 100644
--- third_party/WebKit/Source/core/exported/WebViewBase.h
+++ third_party/WebKit/Source/core/exported/WebViewBase.h
@@ -151,7 +151,7 @@ class WebViewBase : public WebView, public RefCounted<WebViewBase> {
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
- static bool UseExternalPopupMenus();
+ virtual bool UseExternalPopupMenus() const = 0;
virtual GraphicsLayer* RootGraphicsLayer() = 0;
virtual void RegisterViewportLayersWithCompositor() = 0;
diff --git third_party/WebKit/Source/web/ChromeClientImpl.cpp third_party/WebKit/Source/web/ChromeClientImpl.cpp
index ba81ee3..648d7ce 100644
index 2a35f2c..dded520 100644
--- third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -908,7 +908,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
HTMLSelectElement& select) {
@@ -935,7 +935,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
return nullptr;
NotifyPopupOpeningObservers();
- if (WebViewImpl::UseExternalPopupMenus())
- if (WebViewBase::UseExternalPopupMenus())
+ if (web_view_->UseExternalPopupMenus())
return new ExternalPopupMenu(frame, select, *web_view_);
DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
diff --git third_party/WebKit/Source/web/WebViewImpl.cpp third_party/WebKit/Source/web/WebViewImpl.cpp
index 16ac66b..7053b54 100644
index dccdd58..a2a7ab9 100644
--- third_party/WebKit/Source/web/WebViewImpl.cpp
+++ third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -355,6 +355,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
@@ -23,36 +36,39 @@ index 16ac66b..7053b54 100644
compositor_device_scale_factor_override_(0),
suppress_next_keypress_event_(false),
ime_accept_events_(true),
@@ -3743,8 +3744,13 @@ void WebViewImpl::MainFrameScrollOffsetChanged() {
@@ -3693,12 +3694,13 @@ void WebViewImpl::MainFrameScrollOffsetChanged() {
dev_tools_emulator_->MainFrameScrollOrScaleChanged();
}
-bool WebViewBase::UseExternalPopupMenus() {
- return WebViewImpl::UseExternalPopupMenus();
+void WebViewImpl::SetUseExternalPopupMenusThisInstance(
+ bool useExternalPopupMenus) {
+ should_use_external_popup_menus_ = useExternalPopupMenus;
+}
+
bool WebViewImpl::UseExternalPopupMenus() {
}
-bool WebViewImpl::UseExternalPopupMenus() {
- return g_should_use_external_popup_menus;
+bool WebViewImpl::UseExternalPopupMenus() const {
+ return should_use_external_popup_menus_;
}
void WebViewImpl::SetBackgroundColorOverride(WebColor color) {
diff --git third_party/WebKit/Source/web/WebViewImpl.h third_party/WebKit/Source/web/WebViewImpl.h
index a22ef37..33dbab4 100644
index ba65d8f..490e451 100644
--- third_party/WebKit/Source/web/WebViewImpl.h
+++ third_party/WebKit/Source/web/WebViewImpl.h
@@ -362,7 +362,8 @@ class WEB_EXPORT WebViewImpl final
@@ -357,7 +357,8 @@ class WEB_EXPORT WebViewImpl final
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
- static bool UseExternalPopupMenus();
+ void SetUseExternalPopupMenusThisInstance(bool);
+ bool UseExternalPopupMenus();
+ bool UseExternalPopupMenus() const override;
bool ShouldAutoResize() const { return should_auto_resize_; }
bool ShouldAutoResize() const override { return should_auto_resize_; }
@@ -647,6 +648,8 @@ class WEB_EXPORT WebViewImpl final
@@ -650,6 +651,8 @@ class WEB_EXPORT WebViewImpl final
float fake_page_scale_animation_page_scale_factor_;
bool fake_page_scale_animation_use_anchor_;
@@ -62,10 +78,10 @@ index a22ef37..33dbab4 100644
TransformationMatrix device_emulation_transform_;
diff --git third_party/WebKit/public/web/WebView.h third_party/WebKit/public/web/WebView.h
index e811392..d6d5bf8 100644
index c55118b..56d8896 100644
--- third_party/WebKit/public/web/WebView.h
+++ third_party/WebKit/public/web/WebView.h
@@ -403,6 +403,7 @@ class WebView : protected WebWidget {
@@ -399,6 +399,7 @@ class WebView : protected WebWidget {
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void SetUseExternalPopupMenus(bool);

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/webui/net_internals/net_internals_ui.cc chrome/browser/ui/webui/net_internals/net_internals_ui.cc
index 3a72ef9..303258b 100644
index 2fa6e2a..f7bb035 100644
--- chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -531,8 +531,7 @@ void NetInternalsMessageHandler::OnGetSessionNetworkStats(
@@ -526,8 +526,7 @@ void NetInternalsMessageHandler::OnGetSessionNetworkStats(
const base::ListValue* list) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
SendJavascriptCommand(
@@ -12,7 +12,7 @@ index 3a72ef9..303258b 100644
}
void NetInternalsMessageHandler::OnGetExtensionInfo(
@@ -628,9 +627,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady(
@@ -623,9 +622,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady(
PrePopulateEventList();
@@ -33,7 +33,7 @@ index 3a72ef9..303258b 100644
}
void NetInternalsMessageHandler::IOThreadImpl::OnGetNetInfo(
@@ -1032,8 +1039,10 @@ void NetInternalsMessageHandler::IOThreadImpl::PrePopulateEventList() {
@@ -1027,8 +1034,10 @@ void NetInternalsMessageHandler::IOThreadImpl::PrePopulateEventList() {
std::set<net::URLRequestContext*> contexts;
for (const auto& getter : context_getters_)
contexts.insert(getter->GetURLRequestContext());
@@ -47,10 +47,10 @@ index 3a72ef9..303258b 100644
// Add entries for ongoing network objects.
CreateNetLogEntriesForActiveObjects(contexts, this);
diff --git content/browser/resource_context_impl.cc content/browser/resource_context_impl.cc
index 93e2890..67a1029 100644
index 141a083..b16b4d6 100644
--- content/browser/resource_context_impl.cc
+++ content/browser/resource_context_impl.cc
@@ -74,6 +74,10 @@ URLDataManagerBackend* GetURLDataManagerForResourceContext(
@@ -58,6 +58,10 @@ URLDataManagerBackend* GetURLDataManagerForResourceContext(
context->GetUserData(kURLDataManagerBackendKeyName));
}
@@ -75,10 +75,10 @@ index 903cc54..56ee4ea 100644
CONTENT_EXPORT void InitializeResourceContext(BrowserContext* browser_context);
diff --git content/browser/webui/url_data_manager.cc content/browser/webui/url_data_manager.cc
index 0a482ad..c707073 100644
index 5681ff5..7d96c24 100644
--- content/browser/webui/url_data_manager.cc
+++ content/browser/webui/url_data_manager.cc
@@ -151,6 +151,11 @@ void URLDataManager::UpdateWebUIDataSource(
@@ -153,6 +153,11 @@ void URLDataManager::UpdateWebUIDataSource(
}
// static

View File

@@ -1,8 +1,8 @@
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
index eabe276..63e127d 100644
index 3ff9d30..5b53c44 100644
--- chrome/app/generated_resources.grd
+++ chrome/app/generated_resources.grd
@@ -5279,7 +5279,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
@@ -5158,7 +5158,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
</if>
<message name="IDS_PLUGIN_BLOCKED_BY_POLICY" desc="The placeholder text for a plugin blocked by enterprise policy.">