Update to Chromium revision a106f0ab (#464641)

- Remove CefWindowInfo.transparent_painting_enabled. Set
  CefBrowserSettings.background_color to an opaque or transparent
  value instead.
This commit is contained in:
Marshall Greenblatt
2017-04-20 15:28:17 -04:00
parent 2f6475c0d8
commit 3f71138d64
151 changed files with 2756 additions and 2295 deletions

View File

@@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
index d0ecb71..84c20b4 100644
index 1c73b7f..606f29c 100644
--- content/browser/renderer_host/browser_compositor_view_mac.h
+++ content/browser/renderer_host/browser_compositor_view_mac.h
@@ -56,9 +56,11 @@ class BrowserCompositorMac : public cc::BeginFrameObserver,
@@ -51,9 +51,11 @@ class BrowserCompositorMac : public DelegatedFrameHostClient {
// These will not return nullptr until Destroy is called.
DelegatedFrameHost* GetDelegatedFrameHost();
@@ -13,12 +13,12 @@ index d0ecb71..84c20b4 100644
+ ui::Compositor* GetCompositor();
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac();
void SwapCompositorFrame(uint32_t compositor_frame_sink_id,
void DidCreateNewRendererCompositorFrameSink(
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
index e4c25e73..e2f789e 100644
index fba983b..8cf9629 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -201,6 +201,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
@@ -202,6 +202,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
g_spare_recyclable_compositors.Get().clear();
}
@@ -31,7 +31,7 @@ index e4c25e73..e2f789e 100644
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
if (recyclable_compositor_)
return recyclable_compositor_->accelerated_widget_mac();
@@ -417,8 +423,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
@@ -421,8 +427,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
}
gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {

View File

@@ -1,5 +1,5 @@
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
index 2197f73a..ab100b6 100644
index fc720a7..1c30365 100644
--- render_widget_host_view_guest.cc
+++ render_widget_host_view_guest.cc
@@ -247,13 +247,14 @@ void RenderWidgetHostViewGuest::Destroy() {

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 7b85e54..5afa575 100644
index e6baddc7..17dff91 100644
--- content/browser/browser_plugin/browser_plugin_guest.cc
+++ content/browser/browser_plugin/browser_plugin_guest.cc
@@ -318,14 +318,20 @@ void BrowserPluginGuest::InitInternal(
@@ -316,14 +316,20 @@ void BrowserPluginGuest::InitInternal(
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
}
@@ -25,7 +25,7 @@ index 7b85e54..5afa575 100644
}
RendererPreferences* renderer_prefs =
@@ -800,7 +806,8 @@ void BrowserPluginGuest::OnWillAttachComplete(
@@ -799,7 +805,8 @@ void BrowserPluginGuest::OnWillAttachComplete(
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) {
web_contents_view->CreateViewForWidget(
@@ -36,10 +36,10 @@ index 7b85e54..5afa575 100644
}
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
index 1a04a52..4cfe9aa 100644
index d0c4ffa..6399af8 100644
--- content/browser/frame_host/interstitial_page_impl.cc
+++ content/browser/frame_host/interstitial_page_impl.cc
@@ -594,7 +594,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
@@ -598,7 +598,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
WebContentsView* wcv =
static_cast<WebContentsImpl*>(web_contents())->GetView();
RenderWidgetHostViewBase* view =
@@ -69,10 +69,10 @@ 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 1bfef2c..7555040 100644
index 68481ad..4018641 100644
--- content/browser/web_contents/web_contents_view_aura.cc
+++ content/browser/web_contents/web_contents_view_aura.cc
@@ -843,7 +843,8 @@ void WebContentsViewAura::CreateView(
@@ -846,7 +846,8 @@ void WebContentsViewAura::CreateView(
}
RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
@@ -82,7 +82,7 @@ index 1bfef2c..7555040 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
@@ -855,6 +856,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
@@ -858,6 +859,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
render_widget_host->GetView());
}
@@ -91,10 +91,10 @@ index 1bfef2c..7555040 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 ed3641c..f8816357 100644
index fc703087..2a1c368 100644
--- content/browser/web_contents/web_contents_view_aura.h
+++ content/browser/web_contents/web_contents_view_aura.h
@@ -117,7 +117,7 @@ class CONTENT_EXPORT WebContentsViewAura
@@ -118,7 +118,7 @@ class CONTENT_EXPORT WebContentsViewAura
gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@@ -104,7 +104,7 @@ index ed3641c..f8816357 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_child_frame.cc content/browser/web_contents/web_contents_view_child_frame.cc
index 74a587a..9f02836 100644
index d10fbca..18df45f 100644
--- content/browser/web_contents/web_contents_view_child_frame.cc
+++ content/browser/web_contents/web_contents_view_child_frame.cc
@@ -94,7 +94,7 @@ void WebContentsViewChildFrame::CreateView(const gfx::Size& initial_size,
@@ -130,7 +130,7 @@ index 86ce68b..fd21e5a 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_guest.cc content/browser/web_contents/web_contents_view_guest.cc
index a93bc37..18fed2e 100644
index 702a579..2acceda 100644
--- content/browser/web_contents/web_contents_view_guest.cc
+++ content/browser/web_contents/web_contents_view_guest.cc
@@ -72,6 +72,8 @@ void WebContentsViewGuest::GetScreenInfo(ScreenInfo* screen_info) const {
@@ -211,7 +211,7 @@ 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 b236639..167f973 100644
index 2b45749..21c19b3 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(
@@ -256,7 +256,7 @@ 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 6e59562..b517389 100644
index 44793e9..77603b2 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(

View File

@@ -63,7 +63,7 @@ index 4b43013..169ca47 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 6554312..701cb0f 100644
index 385f9c3..3d126bd 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -89,7 +89,7 @@ class ProfileManager : public base::NonThreadSafe,

View File

@@ -1,8 +1,8 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index 91acb7d..d4f57cd 100644
index de5a0d8..59251d3 100644
--- chrome/common/chrome_content_client.cc
+++ chrome/common/chrome_content_client.cc
@@ -81,7 +81,7 @@
@@ -82,7 +82,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 50a66bb..4daaadf 100644
index 25b59f0..5d1c80f 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -220,6 +220,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
@@ -217,6 +217,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
std::unique_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
@@ -17,7 +17,7 @@ index 50a66bb..4daaadf 100644
if (command_line->HasSwitch(switches::kHeadless))
return base::WrapUnique(new cc::SoftwareOutputDevice);
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index 92696ad..50aa222 100644
index fe85a4e..e5584d2 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -18,6 +18,7 @@
@@ -28,8 +28,8 @@ index 92696ad..50aa222 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"
@@ -190,6 +191,17 @@ class COMPOSITOR_EXPORT CompositorLock
DISALLOW_COPY_AND_ASSIGN(CompositorLock);
@@ -168,6 +169,17 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual void RemoveObserver(ContextFactoryObserver* observer) = 0;
};
+class COMPOSITOR_EXPORT CompositorDelegate {
@@ -46,7 +46,7 @@ index 92696ad..50aa222 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
@@ -219,6 +231,9 @@ class COMPOSITOR_EXPORT Compositor
@@ -200,6 +212,9 @@ class COMPOSITOR_EXPORT Compositor
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@@ -56,12 +56,12 @@ index 92696ad..50aa222 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
@@ -398,6 +413,8 @@ class COMPOSITOR_EXPORT Compositor
@@ -377,6 +392,8 @@ class COMPOSITOR_EXPORT Compositor
ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;
+ CompositorDelegate* delegate_ = nullptr;
+
// The root of the Layer tree drawn by this compositor.
Layer* root_layer_;
Layer* root_layer_ = nullptr;

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 9320803..9b5d328 100644
index 47820a5..520ca4cd 100644
--- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc
@@ -483,8 +483,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
@@ -475,8 +475,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(
@@ -38,10 +38,10 @@ 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 75a6fda..84cfc9f 100644
index 09b5753..11a5f32 100644
--- chrome/browser/plugins/plugin_info_message_filter.cc
+++ chrome/browser/plugins/plugin_info_message_filter.cc
@@ -483,8 +483,8 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
@@ -451,8 +451,8 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
for (; i < matching_plugins.size(); ++i) {
if (!filter ||
filter->IsPluginAvailable(render_process_id_, render_frame_id,
@@ -66,7 +66,7 @@ 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 b4b700b..46acc35 100644
index c147373..2e7cb5f 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(
@@ -77,6 +77,75 @@ index b4b700b..46acc35 100644
+ model_->profile()->GetResourceContext(), url, true, url::Origin(),
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
--- content/browser/frame_host/navigation_handle_impl.cc
+++ content/browser/frame_host/navigation_handle_impl.cc
@@ -265,12 +265,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
- // TODO(mkwst): Change this to check against 'READY_TO_COMMIT' once
- // ReadyToCommitNavigation is available whether or not PlzNavigate is
- // enabled. https://crbug.com/621856
- CHECK_GE(state_, WILL_PROCESS_RESPONSE)
- << "This accessor should only be called after a response has been "
- "delivered for processing.";
return render_frame_host_;
}
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
index ccd8ee7..cc52a93 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) {
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup)
IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup)
#endif
-#if defined(OS_ANDROID)
IPC_MESSAGE_HANDLER(FrameHostMsg_NavigationHandledByEmbedder,
OnNavigationHandledByEmbedder)
-#endif
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowCreatedWindow, OnShowCreatedWindow)
IPC_END_MESSAGE_MAP()
@@ -1229,6 +1227,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
if (navigation_handle_) {
navigation_handle_->set_net_error_code(
static_cast<net::Error>(params.error_code));
+ navigation_handle_->set_render_frame_host(this);
}
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
@@ -2425,14 +2424,12 @@ void RenderFrameHostImpl::OnHidePopup() {
}
#endif
-#if defined(OS_ANDROID)
void RenderFrameHostImpl::OnNavigationHandledByEmbedder() {
if (navigation_handle_)
navigation_handle_->set_net_error_code(net::ERR_ABORTED);
OnDidStopLoading();
}
-#endif
void RenderFrameHostImpl::OnShowCreatedWindow(int pending_widget_routing_id,
WindowOpenDisposition disposition,
diff --git content/browser/frame_host/render_frame_host_impl.h content/browser/frame_host/render_frame_host_impl.h
index 7d13f01..9b2d494 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
void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params);
void OnHidePopup();
#endif
-#if defined(OS_ANDROID)
void OnNavigationHandledByEmbedder();
+#if defined(OS_ANDROID)
void ForwardGetInterfaceToRenderFrame(const std::string& interface_name,
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
--- content/browser/frame_host/render_frame_message_filter.cc
@@ -161,10 +230,10 @@ index 05500b4..cd00c4c 100644
const std::string& mime_type,
bool* found,
diff --git content/browser/loader/mime_sniffing_resource_handler.cc content/browser/loader/mime_sniffing_resource_handler.cc
index e90fa81..dc3e20d 100644
index 11adad4..283f116 100644
--- content/browser/loader/mime_sniffing_resource_handler.cc
+++ content/browser/loader/mime_sniffing_resource_handler.cc
@@ -469,8 +469,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
@@ -519,8 +519,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
WebPluginInfo plugin;
bool has_plugin = plugin_service_->GetPluginInfo(
info->GetChildID(), info->GetRenderFrameID(), info->GetContext(),
@@ -198,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 3e92d37..ecd8493 100644
index 9e7a5ef..ee721d0 100644
--- content/browser/plugin_service_impl.h
+++ content/browser/plugin_service_impl.h
@@ -71,6 +71,7 @@ class CONTENT_EXPORT PluginServiceImpl
@@ -70,6 +70,7 @@ class CONTENT_EXPORT PluginServiceImpl
int render_frame_id,
ResourceContext* context,
const GURL& url,
@@ -210,10 +279,10 @@ index 3e92d37..ecd8493 100644
const std::string& mime_type,
bool allow_wildcard,
diff --git content/common/frame_messages.h content/common/frame_messages.h
index 774d9cb..c74223f 100644
index b8be34e..db85a84 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -1244,8 +1244,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
@@ -1277,8 +1277,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.
@@ -224,7 +293,7 @@ index 774d9cb..c74223f 100644
url::Origin /* main_frame_origin */,
std::vector<content::WebPluginInfo> /* plugins */)
@@ -1253,9 +1254,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
@@ -1286,9 +1287,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.
@@ -236,30 +305,41 @@ index 774d9cb..c74223f 100644
url::Origin /* main_frame_origin */,
std::string /* mime_type */,
bool /* found */,
@@ -1648,9 +1650,9 @@ IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply,
IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply,
int /* nfr_request_id */,
float /* distance */)
+#endif
IPC_MESSAGE_ROUTED0(FrameHostMsg_NavigationHandledByEmbedder)
-#endif
// 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 92f31e7..fccf0b9 100644
index 6c24359..279edb2 100644
--- content/ppapi_plugin/ppapi_blink_platform_impl.cc
+++ content/ppapi_plugin/ppapi_blink_platform_impl.cc
@@ -210,6 +210,7 @@ blink::WebURLLoader* PpapiBlinkPlatformImpl::createURLLoader() {
@@ -211,6 +211,7 @@ blink::WebURLLoader* PpapiBlinkPlatformImpl::CreateURLLoader() {
void PpapiBlinkPlatformImpl::getPluginList(
void PpapiBlinkPlatformImpl::GetPluginList(
bool refresh,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) {
NOTREACHED();
diff --git content/ppapi_plugin/ppapi_blink_platform_impl.h content/ppapi_plugin/ppapi_blink_platform_impl.h
index 9c2ba25..11a0839 100644
index afcf809..1c9af66 100644
--- content/ppapi_plugin/ppapi_blink_platform_impl.h
+++ content/ppapi_plugin/ppapi_blink_platform_impl.h
@@ -44,6 +44,7 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl {
blink::WebThemeEngine* themeEngine() override;
blink::WebURLLoader* createURLLoader() override;
void getPluginList(bool refresh,
@@ -45,6 +45,7 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl {
blink::WebThemeEngine* ThemeEngine() override;
blink::WebURLLoader* CreateURLLoader() override;
void GetPluginList(bool refresh,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder*) override;
blink::WebData loadResource(const char* name) 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
--- content/public/browser/plugin_service.h
@@ -284,23 +364,63 @@ index 3b610b1..7c439e0 100644
const url::Origin& main_frame_origin,
WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.cc content/public/renderer/content_renderer_client.cc
index d29d85f..6c32ef2 100644
--- content/public/renderer/content_renderer_client.cc
+++ content/public/renderer/content_renderer_client.cc
@@ -97,7 +97,6 @@ bool ContentRendererClient::AllowPopup() {
return false;
}
-#if defined(OS_ANDROID)
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
bool is_content_initiated,
@@ -110,6 +109,7 @@ bool ContentRendererClient::HandleNavigation(
return false;
}
+#if defined(OS_ANDROID)
bool ContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) {
return false;
}
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index d544fb7..260079c 100644
--- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h
@@ -197,7 +197,6 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed.
virtual bool AllowPopup();
-#if defined(OS_ANDROID)
// 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 {
blink::WebNavigationPolicy default_policy,
bool is_redirect);
+#if defined(OS_ANDROID)
// 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/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index 4af9b67..d73ac0b 100644
index 6922b94..473d148 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -2752,7 +2752,8 @@ blink::WebPlugin* RenderFrameImpl::createPlugin(
@@ -2795,7 +2795,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(),
params.mimeType.utf8(), &found, &info, &mime_type));
- 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;
@@ -5246,9 +5247,8 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty());
@@ -5364,9 +5365,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
(!IsBrowserSideNavigationEnabled() ||
url != pending_navigation_params_->request_params.redirects[0]));
-#ifdef OS_ANDROID
- bool render_view_was_created_by_renderer =
@@ -310,27 +430,27 @@ index 4af9b67..d73ac0b 100644
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation(
@@ -5257,7 +5257,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) {
return blink::WebNavigationPolicyIgnore;
@@ -5379,7 +5379,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
}
return blink::kWebNavigationPolicyIgnore;
}
-#endif
Referrer referrer(
RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest));
RenderViewImpl::GetReferrerFromRequest(frame_, info.url_request));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index ed2baee..19f294b 100644
index 4ba0c48..46f2afde 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -712,6 +712,7 @@ blink::WebMIDIAccessor* RendererBlinkPlatformImpl::createMIDIAccessor(
@@ -737,6 +737,7 @@ blink::WebMIDIAccessor* RendererBlinkPlatformImpl::CreateMIDIAccessor(
void RendererBlinkPlatformImpl::getPluginList(
void RendererBlinkPlatformImpl::GetPluginList(
bool refresh,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) {
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -719,7 +720,8 @@ void RendererBlinkPlatformImpl::getPluginList(
@@ -744,7 +745,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
if (!plugin_refresh_allowed_)
refresh = false;
RenderThread::Get()->Send(
@@ -338,17 +458,17 @@ index ed2baee..19f294b 100644
+ new FrameHostMsg_GetPlugins(refresh, isMainFrame, mainFrameOrigin,
+ &plugins));
for (const WebPluginInfo& plugin : plugins) {
builder->addPlugin(WebString::fromUTF16(plugin.name),
WebString::fromUTF16(plugin.desc),
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 df62a99..992fa6e 100644
index 19306df..a731786 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -117,6 +117,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
cc::FrameSinkId generateFrameSinkId() override;
@@ -121,6 +121,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
cc::FrameSinkId GenerateFrameSinkId() override;
void getPluginList(bool refresh,
void GetPluginList(bool refresh,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) override;
blink::WebPublicSuffixList* publicSuffixList() override;
blink::WebPublicSuffixList* PublicSuffixList() override;

View File

@@ -1,40 +0,0 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
index 3cab7f9..98a151f 100644
--- public/renderer/content_renderer_client.cc
+++ public/renderer/content_renderer_client.cc
@@ -97,7 +97,6 @@ bool ContentRendererClient::AllowPopup() {
return false;
}
-#if defined(OS_ANDROID)
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
bool is_content_initiated,
@@ -110,6 +109,7 @@ bool ContentRendererClient::HandleNavigation(
return false;
}
+#if defined(OS_ANDROID)
bool ContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) {
return false;
}
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index 0764782..6a12636 100644
--- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h
@@ -197,7 +197,6 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed.
virtual bool AllowPopup();
-#if defined(OS_ANDROID)
// 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 {
blink::WebNavigationPolicy default_policy,
bool is_redirect);
+#if defined(OS_ANDROID)
// 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);

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 d2ce8b9..e4fc7c6 100644
index c4ca09c..40b981e 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 d2ce8b9..e4fc7c6 100644
static_library("handler_lib") {
sources = [
"crash_report_upload_thread.cc",
@@ -26,8 +28,18 @@ static_library("handler_lib") {
@@ -28,8 +30,18 @@ static_library("handler_lib") {
"../snapshot",
"../tools:tool_support",
"//base",
@@ -31,7 +31,7 @@ index d2ce8b9..e4fc7c6 100644
cflags = [ "/wd4201" ]
}
diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
index 4750471..a341ac0 100644
index 78b04f4..abf9c98 100644
--- chrome/common/crash_keys.cc
+++ chrome/common/crash_keys.cc
@@ -4,6 +4,8 @@
@@ -43,7 +43,7 @@ index 4750471..a341ac0 100644
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/format_macros.h"
@@ -96,7 +98,7 @@ const char kViewCount[] = "view-count";
@@ -88,7 +90,7 @@ const char kViewCount[] = "view-count";
const char kZeroEncodeDetails[] = "zero-encode-details";
@@ -52,7 +52,7 @@ index 4750471..a341ac0 100644
// The following keys may be chunked by the underlying crash logging system,
// but ultimately constitute a single key-value pair.
//
@@ -252,10 +254,16 @@ size_t RegisterChromeCrashKeys() {
@@ -254,10 +256,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 4750471..a341ac0 100644
// Register the extension IDs.
{
@@ -289,7 +297,7 @@ size_t RegisterChromeCrashKeys() {
@@ -291,7 +299,7 @@ size_t RegisterChromeCrashKeys() {
return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength);
}
@@ -80,7 +80,7 @@ index 4750471..a341ac0 100644
static const char* const kIgnoreSwitches[] = {
switches::kEnableLogging,
switches::kFlagSwitchesBegin,
@@ -345,7 +353,7 @@ static bool IsBoringSwitch(const std::string& flag) {
@@ -347,7 +355,7 @@ static bool IsBoringSwitch(const std::string& flag) {
}
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
@@ -90,7 +90,7 @@ index 4750471..a341ac0 100644
void SetActiveExtensions(const std::set<std::string>& extensions) {
diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h
index e7c9bc3..c97f667 100644
index 7abe208..424a2a4 100644
--- chrome/common/crash_keys.h
+++ chrome/common/crash_keys.h
@@ -22,10 +22,18 @@ class CommandLine;
@@ -113,7 +113,7 @@ index e7c9bc3..c97f667 100644
// on the given |command_line|.
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
index 53a29c8..9d0ee4c 100644
index 40f611f..b5e7d64 100644
--- chrome_elf/BUILD.gn
+++ chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@
@@ -124,7 +124,7 @@ index 53a29c8..9d0ee4c 100644
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")
@@ -136,16 +137,40 @@ static_library("blacklist") {
@@ -137,16 +138,40 @@ static_library("blacklist") {
static_library("crash") {
sources = [
@@ -147,7 +147,7 @@ index 53a29c8..9d0ee4c 100644
+ "//chrome/common/chrome_switches.cc",
+ "//components/flags_ui/flags_ui_switches.cc",
+ "//content/public/common/content_switches.cc",
+
+ "//gpu/config/gpu_crash_keys.cc",
+ ]
+ include_dirs = [
+ "//cef",
@@ -203,7 +203,7 @@ index c658fa9..8c4a145 100644
g_crash_helper_enabled = true;
return true;
diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc
index 3c31d76..26a2602 100644
index 0d3de65..a1b8b09 100644
--- components/crash/content/app/breakpad_linux.cc
+++ components/crash/content/app/breakpad_linux.cc
@@ -29,6 +29,7 @@
@@ -222,7 +222,7 @@ index 3c31d76..26a2602 100644
#endif
bool g_is_crash_reporter_enabled = false;
@@ -685,7 +687,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
@@ -688,7 +690,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
info.process_type_length = 7;
info.distro = base::g_linux_distro;
info.distro_length = my_strlen(base::g_linux_distro);
@@ -231,7 +231,7 @@ index 3c31d76..26a2602 100644
info.process_start_time = g_process_start_time;
info.oom_size = base::g_oom_size;
info.pid = g_pid;
@@ -1341,7 +1343,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
@@ -1357,7 +1359,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
header_content_encoding,
header_content_type,
post_file,
@@ -240,7 +240,7 @@ index 3c31d76..26a2602 100644
"--timeout=10", // Set a timeout so we don't hang forever.
"--tries=1", // Don't retry if the upload fails.
"-O", // Output reply to the file descriptor path.
@@ -1680,10 +1682,19 @@ void HandleCrashDump(const BreakpadInfo& info) {
@@ -1696,10 +1698,19 @@ void HandleCrashDump(const BreakpadInfo& info) {
GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version);
writer.AddBoundary();
@@ -262,7 +262,7 @@ index 3c31d76..26a2602 100644
if (info.pid > 0) {
char pid_value_buf[kUint64StringSize];
uint64_t pid_value_len = my_uint64_len(info.pid);
@@ -1977,6 +1988,17 @@ void InitCrashReporter(const std::string& process_type) {
@@ -2004,6 +2015,17 @@ void InitCrashReporter(const std::string& process_type) {
PostEnableBreakpadInitialization();
}
@@ -281,7 +281,7 @@ index 3c31d76..26a2602 100644
void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) {
SanitizationInfo sanitization_info;
diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h
index 3ef4e8a..d0a4b12 100644
index 0160f62..b732498 100644
--- components/crash/content/app/breakpad_linux.h
+++ components/crash/content/app/breakpad_linux.h
@@ -16,6 +16,9 @@ namespace breakpad {
@@ -292,10 +292,10 @@ index 3ef4e8a..d0a4b12 100644
+void SetCrashServerURL(const std::string& url);
+
#if defined(OS_ANDROID)
struct SanitizationInfo {
bool should_sanitize_dumps = false;
extern void InitCrashKeysForTesting();
diff --git components/crash/content/app/crash_reporter_client.cc components/crash/content/app/crash_reporter_client.cc
index fd88348..cbb9533 100644
index 2e9ee28..de53f59 100644
--- components/crash/content/app/crash_reporter_client.cc
+++ components/crash/content/app/crash_reporter_client.cc
@@ -88,11 +88,12 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
@@ -320,7 +320,7 @@ index fd88348..cbb9533 100644
#if defined(OS_WIN)
bool CrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) {
@@ -141,6 +143,32 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
@@ -149,6 +151,32 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
}
#endif
@@ -353,7 +353,7 @@ index fd88348..cbb9533 100644
#if defined(OS_ANDROID)
int CrashReporterClient::GetAndroidMinidumpDescriptor() {
return 0;
@@ -165,9 +193,4 @@ bool CrashReporterClient::ShouldEnableBreakpadMicrodumps() {
@@ -179,9 +207,4 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
}
#endif
@@ -364,7 +364,7 @@ index fd88348..cbb9533 100644
-
} // namespace crash_reporter
diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h
index 513727c..aef4590 100644
index 9f69c19..2abaee00 100644
--- components/crash/content/app/crash_reporter_client.h
+++ components/crash/content/app/crash_reporter_client.h
@@ -8,6 +8,7 @@
@@ -398,7 +398,7 @@ index 513727c..aef4590 100644
// The location where minidump files should be written. Returns true if
// |crash_dir| was set. Windows has to use base::string16 because this code
@@ -176,6 +179,23 @@ class CrashReporterClient {
@@ -197,6 +200,23 @@ class CrashReporterClient {
// Returns true if breakpad should run in the given process type.
virtual bool EnableBreakpadForProcess(const std::string& process_type);
@@ -423,7 +423,7 @@ index 513727c..aef4590 100644
} // namespace crash_reporter
diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc
index a0eabba..94039c4 100644
index dcec346..6272df6 100644
--- components/crash/content/app/crashpad.cc
+++ components/crash/content/app/crashpad.cc
@@ -142,7 +142,8 @@ void InitializeCrashpadImpl(bool initial_client,
@@ -437,7 +437,7 @@ index a0eabba..94039c4 100644
crashpad::TriState::kDisabled);
}
diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm
index 7df66ea..4ee709a 100644
index 3bae07e..12b0a16 100644
--- components/crash/content/app/crashpad_mac.mm
+++ components/crash/content/app/crashpad_mac.mm
@@ -16,11 +16,14 @@
@@ -501,10 +501,10 @@ index 7df66ea..4ee709a 100644
+ }
#if defined(GOOGLE_CHROME_BUILD)
NSString* channel = base::mac::ObjCCast<NSString>(
@@ -73,12 +88,16 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
// Empty means stable.
@@ -79,12 +94,16 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
process_annotations["channel"] = "";
}
#endif
- NSString* version =
- base::mac::ObjCCast<NSString>([base::mac::FrameworkBundle()
@@ -523,25 +523,25 @@ index 7df66ea..4ee709a 100644
+ process_annotations["platform"] = std::string("macos");
std::vector<std::string> arguments;
if (!browser_process) {
@@ -90,6 +109,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -105,6 +124,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
arguments.push_back(
"--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);
+
crashpad::CrashpadClient crashpad_client;
bool result = crashpad_client.StartHandler(handler_path,
database_path,
bool result = GetCrashpadClient().StartHandler(
handler_path, database_path, metrics_path, url, process_annotations,
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
index 3ad5f8d..77a0fe6 100644
index 94a350f..61667a8 100644
--- components/crash/content/app/crashpad_win.cc
+++ components/crash/content/app/crashpad_win.cc
@@ -41,15 +41,15 @@ void GetPlatformCrashpadAnnotations(
@@ -33,8 +33,8 @@ void GetPlatformCrashpadAnnotations(
base::string16 product_name, version, special_build, channel_name;
crash_reporter_client->GetProductNameAndVersion(
exe_file, &product_name, &version, &special_build, &channel_name);
@@ -549,19 +549,22 @@ index 3ad5f8d..77a0fe6 100644
- (*annotations)["ver"] = base::UTF16ToUTF8(version);
+ (*annotations)["product"] = base::UTF16ToUTF8(product_name);
+ (*annotations)["version"] = base::UTF16ToUTF8(version);
(*annotations)["channel"] = base::UTF16ToUTF8(channel_name);
#if defined(GOOGLE_CHROME_BUILD)
// Empty means stable.
const bool allow_empty_channel = true;
@@ -46,9 +46,9 @@ void GetPlatformCrashpadAnnotations(
if (!special_build.empty())
(*annotations)["special"] = base::UTF16ToUTF8(special_build);
#if defined(ARCH_CPU_X86)
- (*annotations)["plat"] = std::string("Win32");
+ (*annotations)["platform"] = std::string("win32");
+ (*annotations)["platform"] = std::string("Win32");
#elif defined(ARCH_CPU_X86_64)
- (*annotations)["plat"] = std::string("Win64");
+ (*annotations)["platform"] = std::string("win64");
+ (*annotations)["platform"] = std::string("Win64");
#endif
}
@@ -81,7 +81,7 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -80,7 +80,7 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
#if defined(GOOGLE_CHROME_BUILD)
std::string url = "https://clients2.google.com/cr/report";
#else
@@ -570,25 +573,27 @@ index 3ad5f8d..77a0fe6 100644
#endif
// Allow the crash server to be overridden for testing. If the variable
@@ -101,21 +101,25 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
@@ -100,22 +100,26 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client,
crashpad::TriState::kEnabled, kIndirectMemoryLimit);
}
- // If the handler is embedded in the binary (e.g. chrome, setup), we
- // reinvoke it with --type=crashpad-handler. Otherwise, we use the
- // standalone crashpad_handler.exe (for tests, etc.).
std::vector<std::string> arguments;
+
std::vector<std::string> start_arguments;
+
+ // Always add --type=crashpad-handler because the value is expected by
+ // CefExecuteProcess.
+ arguments.push_back(std::string("--type=") + switches::kCrashpadHandler);
+ start_arguments.push_back(
+ std::string("--type=") + switches::kCrashpadHandler);
+
if (embedded_handler) {
- arguments.push_back(std::string("--type=") + switches::kCrashpadHandler);
- 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.
arguments.push_back("/prefetch:7");
start_arguments.push_back("/prefetch:7");
} else {
base::FilePath exe_dir = exe_file.DirName();
- exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe"));
@@ -596,13 +601,13 @@ index 3ad5f8d..77a0fe6 100644
+ crash_reporter_client->GetCrashExternalHandler(exe_dir.value()));
}
+ crash_reporter_client->GetCrashOptionalArguments(&arguments);
+ crash_reporter_client->GetCrashOptionalArguments(&start_arguments);
+
if (!g_crashpad_client.Get().StartHandler(
exe_file, database_path, metrics_path, url, process_annotations,
arguments, false, true)) {
std::vector<std::string> arguments(start_arguments);
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc
index c693078..e58465b 100644
index bcf53d5..d4f070b 100644
--- content/browser/frame_host/debug_urls.cc
+++ content/browser/frame_host/debug_urls.cc
@@ -139,7 +139,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {

View File

@@ -40,7 +40,7 @@ index 6dac5f3..34f5ee1 100644
virtual ~PruneCondition() {}
diff --git crashpad/client/settings.cc crashpad/client/settings.cc
index 7757ecb..d458337 100644
index 15d16f2..5e8eadf 100644
--- crashpad/client/settings.cc
+++ crashpad/client/settings.cc
@@ -38,7 +38,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) {
@@ -177,21 +177,21 @@ index 14debac..c25c653 100644
//! \brief Attempts to upload a crash report.
//!
diff --git crashpad/handler/handler_main.cc crashpad/handler/handler_main.cc
index 5006cf6..26b3b6a 100644
index 641bf0f..3a86eb3 100644
--- crashpad/handler/handler_main.cc
+++ crashpad/handler/handler_main.cc
@@ -33,8 +33,10 @@
#include "base/logging.h"
@@ -35,8 +35,10 @@
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/scoped_generic.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "client/crash_report_database.h"
#include "client/crashpad_client.h"
#include "client/prune_crash_reports.h"
@@ -69,6 +71,10 @@
#include "client/crashpad_info.h"
@@ -75,6 +77,10 @@
#include "util/win/session_end_watcher.h"
#endif // OS_MACOSX
@@ -202,8 +202,18 @@ index 5006cf6..26b3b6a 100644
namespace crashpad {
namespace {
@@ -403,6 +409,9 @@ int HandlerMain(int argc, char* argv[]) {
kOptionPipeName,
@@ -144,6 +150,9 @@ struct Options {
bool monitor_self;
bool rate_limit;
bool upload_gzip;
+ int max_uploads;
+ int max_database_size;
+ int max_database_age;
};
// Splits |key_value| on '=' and inserts the resulting key and value into |map|.
@@ -425,6 +434,9 @@ int HandlerMain(int argc,
kOptionResetOwnCrashExceptionPortToSystemDefault,
#endif // OS_MACOSX
kOptionURL,
+ kOptionMaxUploads,
@@ -212,26 +222,7 @@ index 5006cf6..26b3b6a 100644
// Standard options.
kOptionHelp = -2,
@@ -424,12 +433,18 @@ int HandlerMain(int argc, char* argv[]) {
#endif // OS_MACOSX
bool rate_limit;
bool upload_gzip;
+ int max_uploads;
+ int max_database_size;
+ int max_database_age;
} options = {};
#if defined(OS_MACOSX)
options.handshake_fd = -1;
#endif
options.rate_limit = true;
options.upload_gzip = true;
+ options.max_uploads = 0;
+ options.max_database_size = 0;
+ options.max_database_age = 0;
const option long_options[] = {
{"annotation", required_argument, nullptr, kOptionAnnotation},
@@ -460,6 +475,9 @@ int HandlerMain(int argc, char* argv[]) {
@@ -470,6 +482,9 @@ int HandlerMain(int argc,
{"url", required_argument, nullptr, kOptionURL},
{"help", no_argument, nullptr, kOptionHelp},
{"version", no_argument, nullptr, kOptionVersion},
@@ -241,7 +232,7 @@ index 5006cf6..26b3b6a 100644
{nullptr, 0, nullptr, 0},
};
@@ -535,6 +553,27 @@ int HandlerMain(int argc, char* argv[]) {
@@ -564,6 +579,27 @@ int HandlerMain(int argc,
options.url = optarg;
break;
}
@@ -269,7 +260,7 @@ index 5006cf6..26b3b6a 100644
case kOptionHelp: {
Usage(me);
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly);
@@ -672,12 +711,19 @@ int HandlerMain(int argc, char* argv[]) {
@@ -721,12 +757,19 @@ 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.
@@ -289,17 +280,4 @@ index 5006cf6..26b3b6a 100644
+ options.max_database_age));
prune_thread.Start();
CrashReportExceptionHandler exception_handler(
diff --git crashpad/util/net/http_transport_win.cc crashpad/util/net/http_transport_win.cc
index 294048a..e87e47e 100644
--- crashpad/util/net/http_transport_win.cc
+++ crashpad/util/net/http_transport_win.cc
@@ -146,7 +146,7 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) {
ScopedHINTERNET request(WinHttpOpenRequest(
connect.get(),
base::UTF8ToUTF16(method()).c_str(),
- url_path.c_str(),
+ (url_path + extra_info).c_str(),
nullptr,
WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
CrashReportExceptionHandler exception_handler(database.get(),

View File

@@ -1,20 +1,21 @@
diff --git .gn .gn
index b0565e5..4fd1771 100644
index cd7ed79..0c318f9 100644
--- .gn
+++ .gn
@@ -259,6 +259,7 @@ exec_script_whitelist =
@@ -257,6 +257,8 @@ exec_script_whitelist =
# in the Chromium repo outside of //build.
"//android_webview/BUILD.gn",
"//build_overrides/build.gni",
+ "//cef/BUILD.gn",
"//chromeos/BUILD.gn",
+ "//cef/BUILD.gn",
+
# TODO(dgn): Layer violation but breaks the build otherwise, see
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index d783ebe..ae5e8d1 100644
index d24c2da..7f0d451 100644
--- BUILD.gn
+++ BUILD.gn
@@ -282,6 +282,7 @@ group("both_gn_and_gyp") {
@@ -158,6 +158,7 @@ group("gn_all") {
# and whether there should be other targets that are iOS-only and missing.
deps += [
"//cc:cc_unittests",
@@ -55,13 +56,13 @@ index 982fbe8..e757be46 100644
+ "studio path")
}
diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py
index 43a7e09..2af18e9 100644
index e8b0849..0bfc676 100644
--- build/toolchain/win/setup_toolchain.py
+++ build/toolchain/win/setup_toolchain.py
@@ -127,15 +127,17 @@ def _LoadToolchainEnv(cpu, sdk_dir):
os.environ['GYP_MSVS_OVERRIDE_PATH'],
'VC/vcvarsall.bat'))
if not os.path.exists(script_path):
@@ -132,18 +132,20 @@ def _LoadToolchainEnv(cpu, sdk_dir):
# variable.
if 'VSINSTALLDIR' in os.environ:
del os.environ['VSINSTALLDIR']
- other_path = os.path.normpath(os.path.join(
+ script_path = os.path.normpath(os.path.join(
os.environ['GYP_MSVS_OVERRIDE_PATH'],
@@ -70,10 +71,16 @@ index 43a7e09..2af18e9 100644
- raise Exception('%s is missing - make sure VC++ tools are installed.' %
- script_path)
- script_path = other_path
- args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64']
- # Chromium requires the 10.0.14393.0 SDK. Previous versions don't have all
- # of the required declarations, and 10.0.15063.0 is buggy.
- args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64',
- '10.0.14393.0']
- variables = _LoadEnvFromBat(args)
+ if os.path.exists(script_path):
+ args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64']
+ # Chromium requires the 10.0.14393.0 SDK. Previous versions don't have all
+ # of the required declarations, and 10.0.15063.0 is buggy.
+ args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64',
+ '10.0.14393.0']
+ variables = _LoadEnvFromBat(args)
+ else:
+ variables = []
@@ -84,10 +91,10 @@ index 43a7e09..2af18e9 100644
diff --git build/vs_toolchain.py build/vs_toolchain.py
index c5db1b24..e4f5839 100755
index 90a562d..8c63b12 100755
--- build/vs_toolchain.py
+++ build/vs_toolchain.py
@@ -74,11 +74,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
@@ -78,11 +78,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:
@@ -107,7 +114,7 @@ index c5db1b24..e4f5839 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 811afda..8d21b5f 100644
index 4e303dc..a0398f1 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -249,7 +249,7 @@ template("chrome_paks") {

View File

@@ -0,0 +1,13 @@
diff --git gpu/command_buffer/service/feature_info.cc gpu/command_buffer/service/feature_info.cc
index 32e72c6..495ccdd 100644
--- gpu/command_buffer/service/feature_info.cc
+++ gpu/command_buffer/service/feature_info.cc
@@ -1524,8 +1524,6 @@ void FeatureInfo::InitializeFloatAndHalfFloatFeatures(
glBindFramebufferEXT(GL_FRAMEBUFFER, static_cast<GLuint>(fb_binding));
glBindTexture(GL_TEXTURE_2D, static_cast<GLuint>(tex_binding));
- DCHECK_EQ(glGetError(), static_cast<GLuint>(GL_NO_ERROR));
-
if (status_rgba == GL_FRAMEBUFFER_COMPLETE) {
feature_flags_.chromium_color_buffer_float_rgba = true;
if (!disallowed_features_.chromium_color_buffer_float_rgba)

View File

@@ -0,0 +1,57 @@
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

@@ -26,7 +26,7 @@ index 3d55920..721aca1 100644
run_loop_(nullptr),
current_pending_task_(nullptr),
diff --git message_loop.h message_loop.h
index 8417ce4..ee253a9 100644
index 2ef4537..9c657f8 100644
--- message_loop.h
+++ message_loop.h
@@ -303,6 +303,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
@@ -46,7 +46,7 @@ index 8417ce4..ee253a9 100644
// Can only be called from the thread that owns the MessageLoop.
bool is_running() const;
@@ -442,6 +452,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
@@ -444,6 +454,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// insider a (accidentally induced?) nested message pump.
bool nestable_tasks_allowed_;

View File

@@ -1,29 +0,0 @@
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
index 2e525bb..646b81b 100644
--- content/browser/frame_host/navigation_handle_impl.cc
+++ content/browser/frame_host/navigation_handle_impl.cc
@@ -256,12 +256,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
- // TODO(mkwst): Change this to check against 'READY_TO_COMMIT' once
- // ReadyToCommitNavigation is available whether or not PlzNavigate is
- // enabled. https://crbug.com/621856
- CHECK_GE(state_, WILL_PROCESS_RESPONSE)
- << "This accessor should only be called after a response has been "
- "delivered for processing.";
return render_frame_host_;
}
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
index ff676db..63f862d 100644
--- content/browser/frame_host/render_frame_host_impl.cc
+++ content/browser/frame_host/render_frame_host_impl.cc
@@ -1133,6 +1133,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
if (navigation_handle_) {
navigation_handle_->set_net_error_code(
static_cast<net::Error>(params.error_code));
+ navigation_handle_->set_render_frame_host(this);
}
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);

View File

@@ -55,10 +55,10 @@ index 7111970..f751d6c 100644
} // namespace net
diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc
index 5f82c28..0ebee04 100644
index 2e829ad..5272c10 100644
--- net/http/transport_security_state.cc
+++ net/http/transport_security_state.cc
@@ -1371,8 +1371,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) {
@@ -1382,8 +1382,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) {
g_ct_required_for_testing = *required ? 1 : -1;
}
@@ -72,10 +72,10 @@ index 5f82c28..0ebee04 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 a55cf62..b984474 100644
index 5d3c126..2c970e8 100644
--- net/http/transport_security_state.h
+++ net/http/transport_security_state.h
@@ -475,6 +475,10 @@ class NET_EXPORT TransportSecurityState
@@ -479,6 +479,10 @@ class NET_EXPORT TransportSecurityState
// nullptr to reset.
static void SetShouldRequireCTForTesting(bool* required);
@@ -86,7 +86,7 @@ index a55cf62..b984474 100644
private:
friend class TransportSecurityStateTest;
friend class TransportSecurityStateStaticFuzzer;
@@ -499,7 +503,7 @@ class NET_EXPORT TransportSecurityState
@@ -503,7 +507,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 a55cf62..b984474 100644
// Helper method for actually checking pins.
PKPStatus CheckPublicKeyPinsImpl(
@@ -590,6 +594,8 @@ class NET_EXPORT TransportSecurityState
@@ -594,6 +598,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,10 +1,10 @@
diff --git BUILD.gn BUILD.gn
index de7f21b..cb3dcb1 100644
index 1d8f353..419c18d 100644
--- BUILD.gn
+++ BUILD.gn
@@ -208,6 +208,10 @@ static_library("pdfium") {
} else {
libs += [ "freetype" ]
@@ -220,6 +220,10 @@ static_library("pdfium") {
if (pdf_is_complete_lib) {
complete_static_lib = true
}
+
+ include_dirs = [
@@ -14,7 +14,7 @@ index de7f21b..cb3dcb1 100644
static_library("test_support") {
diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
index 1e7a651..9523c7e 100644
index 5010c17..ffc81fd 100644
--- fpdfsdk/fpdfview.cpp
+++ fpdfsdk/fpdfview.cpp
@@ -31,6 +31,7 @@
@@ -24,8 +24,8 @@ index 1e7a651..9523c7e 100644
+#include "fxjs/fxjs_v8.h"
#include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h"
#include "third_party/base/numerics/safe_conversions_impl.h"
@@ -419,6 +420,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
#include "third_party/base/allocator/partition_allocator/partition_alloc.h"
@@ -421,6 +422,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy();

View File

@@ -1,163 +0,0 @@
diff --git Source/core/dom/DOMImplementation.cpp Source/core/dom/DOMImplementation.cpp
index 2b04a24..85653cf 100644
--- Source/core/dom/DOMImplementation.cpp
+++ Source/core/dom/DOMImplementation.cpp
@@ -240,9 +240,9 @@ Document* DOMImplementation::createDocument(const String& type,
// For that reason, the origin must be retrieved directly from init.url().
if (init.frame()->isMainFrame()) {
RefPtr<SecurityOrigin> origin = SecurityOrigin::create(init.url());
- pluginData = init.frame()->page()->pluginData(origin.get());
+ pluginData = init.frame()->page()->pluginData(true, origin.get());
} else {
- pluginData = init.frame()->page()->pluginData(
+ pluginData = init.frame()->page()->pluginData(false,
init.frame()->tree().top()->securityContext()->getSecurityOrigin());
}
}
diff --git Source/core/frame/LocalFrame.cpp Source/core/frame/LocalFrame.cpp
index 6fa75cf..20cba50 100644
--- Source/core/frame/LocalFrame.cpp
+++ Source/core/frame/LocalFrame.cpp
@@ -898,6 +898,7 @@ PluginData* LocalFrame::pluginData() const {
if (!loader().allowPlugins(NotAboutToInstantiatePlugin))
return nullptr;
return page()->pluginData(
+ isMainFrame(),
tree().top()->securityContext()->getSecurityOrigin());
}
diff --git Source/core/page/Page.cpp Source/core/page/Page.cpp
index cb46ff7..7c63196 100644
--- Source/core/page/Page.cpp
+++ Source/core/page/Page.cpp
@@ -226,16 +226,26 @@ void Page::refreshPlugins() {
for (const Page* page : allPages()) {
// Clear out the page's plugin data.
- if (page->m_pluginData)
- page->m_pluginData = nullptr;
+ if (page->m_pluginDataMainFrame)
+ page->m_pluginDataMainFrame = nullptr;
+ if (page->m_pluginDataSubFrame)
+ page->m_pluginDataSubFrame = nullptr;
}
}
-PluginData* Page::pluginData(SecurityOrigin* mainFrameOrigin) const {
- if (!m_pluginData ||
- !mainFrameOrigin->isSameSchemeHostPort(m_pluginData->origin()))
- m_pluginData = PluginData::create(mainFrameOrigin);
- return m_pluginData.get();
+PluginData* Page::pluginData(bool isMainFrame,
+ SecurityOrigin* mainFrameOrigin) const {
+ if (isMainFrame) {
+ if (!m_pluginDataMainFrame ||
+ !mainFrameOrigin->isSameSchemeHostPort(m_pluginDataMainFrame->origin()))
+ m_pluginDataMainFrame = PluginData::create(true, mainFrameOrigin);
+ } else {
+ if (!m_pluginDataSubFrame ||
+ !mainFrameOrigin->isSameSchemeHostPort(m_pluginDataSubFrame->origin()))
+ m_pluginDataSubFrame = PluginData::create(false, mainFrameOrigin);
+ }
+
+ return isMainFrame ? m_pluginDataMainFrame.get() : m_pluginDataSubFrame.get();
}
void Page::setValidationMessageClient(ValidationMessageClient* client) {
diff --git Source/core/page/Page.h Source/core/page/Page.h
index 9c429bd..667207e 100644
--- Source/core/page/Page.h
+++ Source/core/page/Page.h
@@ -130,7 +130,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
ViewportDescription viewportDescription() const;
static void refreshPlugins();
- PluginData* pluginData(SecurityOrigin* mainFrameOrigin) const;
+ PluginData* pluginData(bool isMainFrame,
+ SecurityOrigin* mainFrameOrigin) const;
EditorClient& editorClient() const { return *m_editorClient; }
SpellCheckerClient& spellCheckerClient() const {
@@ -285,7 +286,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
// longer needed.
Member<Frame> m_mainFrame;
- mutable RefPtr<PluginData> m_pluginData;
+ mutable RefPtr<PluginData> m_pluginDataMainFrame;
+ mutable RefPtr<PluginData> m_pluginDataSubFrame;
EditorClient* const m_editorClient;
SpellCheckerClient* const m_spellCheckerClient;
diff --git Source/platform/plugins/PluginData.cpp Source/platform/plugins/PluginData.cpp
index a6da275..c879e64 100644
--- Source/platform/plugins/PluginData.cpp
+++ Source/platform/plugins/PluginData.cpp
@@ -30,11 +30,12 @@
namespace blink {
-PluginData::PluginData(SecurityOrigin* mainFrameOrigin)
- : m_mainFrameOrigin(mainFrameOrigin) {
+PluginData::PluginData(bool isMainFrame, SecurityOrigin* mainFrameOrigin)
+ : m_isMainFrame(isMainFrame),
+ m_mainFrameOrigin(mainFrameOrigin) {
PluginListBuilder builder(&m_plugins);
Platform::current()->getPluginList(
- false, WebSecurityOrigin(m_mainFrameOrigin), &builder);
+ false, m_isMainFrame, WebSecurityOrigin(m_mainFrameOrigin), &builder);
for (unsigned i = 0; i < m_plugins.size(); ++i) {
const PluginInfo& plugin = m_plugins[i];
@@ -73,7 +74,8 @@ String PluginData::pluginNameForMimeType(const String& mimeType) const {
void PluginData::refreshBrowserSidePluginCache() {
Vector<PluginInfo> plugins;
PluginListBuilder builder(&plugins);
- Platform::current()->getPluginList(true, WebSecurityOrigin::createUnique(),
+ Platform::current()->getPluginList(true, true,
+ WebSecurityOrigin::createUnique(),
&builder);
}
diff --git Source/platform/plugins/PluginData.h Source/platform/plugins/PluginData.h
index 0edfd70..a81c128 100644
--- Source/platform/plugins/PluginData.h
+++ Source/platform/plugins/PluginData.h
@@ -52,8 +52,9 @@ class PLATFORM_EXPORT PluginData : public RefCounted<PluginData> {
WTF_MAKE_NONCOPYABLE(PluginData);
public:
- static PassRefPtr<PluginData> create(SecurityOrigin* mainFrameOrigin) {
- return adoptRef(new PluginData(mainFrameOrigin));
+ static PassRefPtr<PluginData> create(bool isMainFrame,
+ SecurityOrigin* mainFrameOrigin) {
+ return adoptRef(new PluginData(isMainFrame, mainFrameOrigin));
}
const Vector<PluginInfo>& plugins() const { return m_plugins; }
@@ -71,12 +72,13 @@ class PLATFORM_EXPORT PluginData : public RefCounted<PluginData> {
static void refreshBrowserSidePluginCache();
private:
- explicit PluginData(SecurityOrigin* mainFrameOrigin);
+ explicit PluginData(bool isMainFrame, SecurityOrigin* mainFrameOrigin);
const PluginInfo* pluginInfoForMimeType(const String& mimeType) const;
Vector<PluginInfo> m_plugins;
Vector<MimeClassInfo> m_mimes;
Vector<size_t> m_mimePluginIndices;
+ bool m_isMainFrame;
RefPtr<SecurityOrigin> m_mainFrameOrigin;
};
diff --git public/platform/Platform.h public/platform/Platform.h
index 2cd7334..7541a5e 100644
--- public/platform/Platform.h
+++ public/platform/Platform.h
@@ -357,6 +357,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,
+ bool isMainFrame,
const WebSecurityOrigin& mainFrameOrigin,
WebPluginListBuilder*) {}

View File

@@ -1,8 +1,8 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index a7d48d0..15df86a 100644
index 3dd2e75..9f61aad 100644
--- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h
@@ -203,6 +203,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
@@ -201,6 +201,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 a7d48d0..15df86a 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index d44ff10..eba4758 100644
index 72f7bd8..850e591 100644
--- public/common/web_preferences.cc
+++ public/common/web_preferences.cc
@@ -173,6 +173,7 @@ WebPreferences::WebPreferences()
@@ -172,6 +172,7 @@ WebPreferences::WebPreferences()
spatial_navigation_enabled(false),
use_solid_color_scrollbars(false),
navigate_on_drag_drop(true),
@@ -23,10 +23,10 @@ index d44ff10..eba4758 100644
inert_visual_viewport(false),
record_whole_document(false),
diff --git public/common/web_preferences.h public/common/web_preferences.h
index ba18988..42a0296 100644
index ae9756c..d0f2f1b 100644
--- public/common/web_preferences.h
+++ public/common/web_preferences.h
@@ -187,6 +187,7 @@ struct CONTENT_EXPORT WebPreferences {
@@ -184,6 +184,7 @@ struct CONTENT_EXPORT WebPreferences {
bool spatial_navigation_enabled;
bool use_solid_color_scrollbars;
bool navigate_on_drag_drop;
@@ -35,15 +35,15 @@ index ba18988..42a0296 100644
bool inert_visual_viewport;
bool record_whole_document;
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index 85a9fa9..3df9583 100644
index 7d6113c..d600026 100644
--- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc
@@ -1401,6 +1401,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
@@ -1383,6 +1383,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
blink::WebView* web_view,
CompositorDependencies* compositor_deps) {
ApplyWebPreferences(prefs, web_view);
+ if (GetWebFrameWidget())
+ GetWebFrameWidget()->setBaseBackgroundColor(prefs.base_background_color);
+ GetWebFrameWidget()->SetBaseBackgroundColor(prefs.base_background_color);
}
void RenderViewImpl::OnForceRedraw(const ui::LatencyInfo& latency_info) {

View File

@@ -1,48 +0,0 @@
diff --git prefs_tab_helper.cc prefs_tab_helper.cc
index 72267d2..5146b39 100644
--- prefs_tab_helper.cc
+++ prefs_tab_helper.cc
@@ -11,8 +11,8 @@
#include <string>
#include "base/command_line.h"
+#include "base/lazy_instance.h"
#include "base/macros.h"
-#include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -431,12 +431,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
GetInstance()->GetServiceForBrowserContext(profile, true));
}
- static PrefWatcherFactory* GetInstance() {
- return base::Singleton<PrefWatcherFactory>::get();
- }
+ static PrefWatcherFactory* GetInstance();
private:
- friend struct base::DefaultSingletonTraits<PrefWatcherFactory>;
+ friend struct base::DefaultLazyInstanceTraits<PrefWatcherFactory>;
PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
"PrefWatcher",
@@ -457,6 +455,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
}
};
+namespace {
+
+base::LazyInstance<PrefWatcherFactory>::Leaky g_pref_watcher_factory =
+ LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
+
+// static
+PrefWatcherFactory* PrefWatcherFactory::GetInstance() {
+ return g_pref_watcher_factory.Pointer();
+}
+
// static
PrefWatcher* PrefWatcher::Get(Profile* profile) {
return PrefWatcherFactory::GetForProfile(profile);

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/ui/cocoa/applescript/tab_applescript.mm chrome/browser/ui/cocoa/applescript/tab_applescript.mm
index 7ec0135..9f68626 100644
index 0cd84f3..2f872dd 100644
--- chrome/browser/ui/cocoa/applescript/tab_applescript.mm
+++ chrome/browser/ui/cocoa/applescript/tab_applescript.mm
@@ -9,7 +9,6 @@
@@ -61,10 +61,10 @@ index f5712a7..11c0366 100644
IPC_STRUCT_TRAITS_MEMBER(printer_capabilities)
IPC_STRUCT_TRAITS_MEMBER(caps_mime_type)
diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc
index a9291a2..1a50724 100644
index de03634..76ee3a7 100644
--- components/printing/common/print_messages.cc
+++ components/printing/common/print_messages.cc
@@ -107,7 +107,6 @@ void PrintMsg_PrintPages_Params::Reset() {
@@ -105,7 +105,6 @@ void PrintMsg_PrintPages_Params::Reset() {
pages = std::vector<int>();
}
@@ -72,16 +72,16 @@ index a9291a2..1a50724 100644
PrintHostMsg_RequestPrintPreview_Params::
PrintHostMsg_RequestPrintPreview_Params()
: is_modifiable(false),
@@ -129,4 +128,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
@@ -127,4 +126,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
PrintHostMsg_SetOptionsFromDocument_Params::
~PrintHostMsg_SetOptionsFromDocument_Params() {
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h
index 9a90bc1..046262f 100644
index d11d28d..e075be3 100644
--- components/printing/common/print_messages.h
+++ components/printing/common/print_messages.h
@@ -75,7 +75,6 @@ struct PrintMsg_PrintPages_Params {
@@ -74,7 +74,6 @@ struct PrintMsg_PrintPages_Params {
std::vector<int> pages;
};
@@ -89,7 +89,7 @@ index 9a90bc1..046262f 100644
struct PrintHostMsg_RequestPrintPreview_Params {
PrintHostMsg_RequestPrintPreview_Params();
~PrintHostMsg_RequestPrintPreview_Params();
@@ -94,7 +93,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
@@ -93,7 +92,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
printing::DuplexMode duplex;
printing::PageRanges page_ranges;
};
@@ -97,7 +97,7 @@ index 9a90bc1..046262f 100644
#endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
@@ -187,7 +185,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
@@ -173,7 +171,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
IPC_STRUCT_TRAITS_MEMBER(to)
IPC_STRUCT_TRAITS_END()
@@ -105,7 +105,7 @@ index 9a90bc1..046262f 100644
IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
IPC_STRUCT_TRAITS_MEMBER(webnode_only)
@@ -208,7 +205,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
@@ -194,7 +191,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
// Specifies page range to be printed.
IPC_STRUCT_TRAITS_MEMBER(page_ranges)
IPC_STRUCT_TRAITS_END()
@@ -113,7 +113,7 @@ index 9a90bc1..046262f 100644
IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
IPC_STRUCT_TRAITS_MEMBER(content_width)
@@ -228,7 +224,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
@@ -214,7 +210,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
IPC_STRUCT_TRAITS_MEMBER(pages)
IPC_STRUCT_TRAITS_END()
@@ -121,7 +121,7 @@ index 9a90bc1..046262f 100644
// Parameters to describe a rendered document.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
// A shared memory handle to metafile data.
@@ -285,7 +280,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
@@ -271,7 +266,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 9a90bc1..046262f 100644
// Parameters to describe a rendered page.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params)
@@ -328,22 +322,20 @@ IPC_STRUCT_END()
@@ -314,22 +308,20 @@ IPC_STRUCT_END()
// Messages sent from the browser to the renderer.
@@ -154,7 +154,7 @@ index 9a90bc1..046262f 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Tells the RenderFrame to switch the CSS to print media type, renders every
@@ -361,13 +353,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
@@ -347,13 +339,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 9a90bc1..046262f 100644
// Messages sent from the renderer to the browser.
@@ -423,7 +413,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
@@ -409,7 +399,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
int /* fd in browser */)
#endif // defined(OS_ANDROID)
@@ -176,7 +176,7 @@ index 9a90bc1..046262f 100644
// Asks the browser to do print preview.
IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
PrintHostMsg_RequestPrintPreview_Params /* params */)
@@ -457,7 +446,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
@@ -443,7 +432,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 9a90bc1..046262f 100644
// This is sent when there are invalid printer settings.
IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
@@ -466,7 +454,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
@@ -452,7 +440,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
int /* document cookie */)
@@ -192,13 +192,13 @@ index 9a90bc1..046262f 100644
// Tell the browser print preview failed.
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
int /* document cookie */)
@@ -493,4 +480,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
@@ -479,4 +466,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 eaa294d..6dd6482 100644
index 7f22427..bf43260 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;
@@ -213,7 +213,7 @@ index eaa294d..6dd6482 100644
"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));
frame->ExecuteScript(blink::WebString::FromUTF8(script));
}
-#else
-bool g_is_preview_enabled = false;
@@ -221,15 +221,15 @@ index eaa294d..6dd6482 100644
int GetDPI(const PrintMsg_Print_Params* print_params) {
#if defined(OS_MACOSX)
@@ -323,7 +323,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
return plugin && plugin->supportsPaginatedPrint();
@@ -319,7 +319,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
return plugin && plugin->SupportsPaginatedPrint();
}
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Returns true if the current destination printer is PRINT_TO_PDF.
bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
bool print_to_pdf = false;
@@ -345,7 +344,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
@@ -341,7 +340,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
}
return frame_has_custom_page_size_style;
}
@@ -237,7 +237,7 @@ index eaa294d..6dd6482 100644
#if BUILDFLAG(ENABLE_PRINTING)
// Disable scaling when either:
@@ -401,7 +399,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
@@ -397,7 +395,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
}
#endif
@@ -245,15 +245,15 @@ index eaa294d..6dd6482 100644
bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
bool fit_to_paper_size = false;
if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) {
@@ -444,7 +441,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
@@ -440,7 +437,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
}
return blink::WebPrintScalingOptionFitToPrintableArea;
return blink::kWebPrintScalingOptionFitToPrintableArea;
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Helper function to scale and round an integer value with a double valued
// scaling.
@@ -563,7 +559,6 @@ blink::WebView* FrameReference::view() {
@@ -559,7 +555,6 @@ blink::WebView* FrameReference::view() {
return view_;
}
@@ -261,15 +261,15 @@ index eaa294d..6dd6482 100644
// static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebCanvas* canvas,
@@ -621,7 +616,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
@@ -617,7 +612,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
web_view->close();
web_view->Close();
}
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
// static - Not anonymous so that platform implementations can use it.
float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
@@ -907,6 +901,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame,
@@ -909,6 +903,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame,
print_for_preview_(false),
delegate_(std::move(delegate)),
print_node_in_progress_(false),
@@ -277,7 +277,7 @@ index eaa294d..6dd6482 100644
is_loading_(false),
is_scripted_preview_delayed_(false),
ipc_nesting_level_(0),
@@ -968,10 +963,8 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) {
@@ -970,10 +965,8 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) {
return;
if (g_is_preview_enabled) {
@@ -288,7 +288,7 @@ index eaa294d..6dd6482 100644
} else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
Print(web_frame, blink::WebNode(), true /* is_scripted? */);
@@ -999,14 +992,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
@@ -1001,14 +994,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 +303,7 @@ index eaa294d..6dd6482 100644
IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -1050,7 +1039,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
@@ -1052,7 +1041,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
}
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@@ -311,7 +311,7 @@ index eaa294d..6dd6482 100644
void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1);
@@ -1110,7 +1098,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
@@ -1112,7 +1100,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT);
}
}
@@ -319,7 +319,7 @@ index eaa294d..6dd6482 100644
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points,
@@ -1135,7 +1122,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
@@ -1137,7 +1124,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
}
@@ -327,7 +327,7 @@ index eaa294d..6dd6482 100644
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1)
return;
@@ -1331,7 +1317,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
@@ -1333,7 +1319,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
return true;
}
@@ -364,7 +364,7 @@ index eaa294d..6dd6482 100644
@@ -1417,7 +1401,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
// that instead.
auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.isNull()) {
if (!plugin.IsNull()) {
+ force_print_preview_ = true;
PrintNode(plugin);
+ force_print_preview_ = false;
@@ -408,7 +408,7 @@ index eaa294d..6dd6482 100644
}
prep_frame_view_.reset();
print_pages_params_.reset();
@@ -1684,7 +1665,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
@@ -1685,7 +1666,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true;
}
@@ -416,7 +416,7 @@ index eaa294d..6dd6482 100644
bool PrintWebViewHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -1791,7 +1771,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
@@ -1792,7 +1772,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS);
return false;
}
@@ -424,23 +424,34 @@ index eaa294d..6dd6482 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
void PrintWebViewHelper::GetPrintSettingsFromUser(
@@ -1904,7 +1883,6 @@ void PrintWebViewHelper::PrintPageInternal(
@@ -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.params.display_header_footer) {
if (params.display_header_footer) {
// TODO(thestig): Figure out why Linux needs this. It is almost certainly
// |printingMinimumShrinkFactor| from Blink.
@@ -1919,7 +1897,6 @@ void PrintWebViewHelper::PrintPageInternal(
scale_factor / fudge_factor, page_layout_in_points,
params.params);
@@ -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, params.page_number, canvas_area, content_area,
@@ -1955,7 +1932,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
float webkit_scale_factor = RenderPageContent(
frame, page_number, canvas_area, content_area, scale_factor, canvas);
@@ -1953,7 +1928,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
return true;
}
@@ -448,7 +459,7 @@ index eaa294d..6dd6482 100644
void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false;
@@ -2086,7 +2062,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
@@ -2084,7 +2058,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true;
}
@@ -457,10 +468,10 @@ index eaa294d..6dd6482 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 d979333..8786274 100644
index 652fbf0..0050918 100644
--- components/printing/renderer/print_web_view_helper.h
+++ components/printing/renderer/print_web_view_helper.h
@@ -145,9 +145,7 @@ class PrintWebViewHelper
@@ -153,9 +153,7 @@ class PrintWebViewHelper
OK,
FAIL_PRINT_INIT,
FAIL_PRINT,
@@ -470,7 +481,7 @@ index d979333..8786274 100644
};
enum PrintPreviewErrorBuckets {
@@ -183,10 +181,8 @@ class PrintWebViewHelper
@@ -191,10 +189,8 @@ class PrintWebViewHelper
void OnPrintForSystemDialog();
void OnPrintForPrintPreview(const base::DictionaryValue& job_settings);
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
@@ -481,7 +492,7 @@ index d979333..8786274 100644
void OnPrintingDone(bool success);
// Get |page_size| and |content_area| information from
@@ -199,7 +195,6 @@ class PrintWebViewHelper
@@ -207,7 +203,6 @@ class PrintWebViewHelper
// Update |ignore_css_margins_| based on settings.
void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
@@ -489,7 +500,7 @@ index d979333..8786274 100644
// Prepare frame for creating preview document.
void PrepareFrameForPreviewDocument();
@@ -216,7 +211,6 @@ class PrintWebViewHelper
@@ -224,7 +219,6 @@ class PrintWebViewHelper
// Finalize the print ready preview document.
bool FinalizePrintReadyDocument();
@@ -497,7 +508,7 @@ index d979333..8786274 100644
// Enable/Disable printing.
void OnSetPrintingEnabled(bool enabled);
@@ -246,7 +240,6 @@ class PrintWebViewHelper
@@ -254,7 +248,6 @@ class PrintWebViewHelper
const blink::WebNode& node,
int* number_of_pages);
@@ -505,7 +516,7 @@ index d979333..8786274 100644
// Set options for print preset from source PDF document.
bool SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options);
@@ -257,7 +250,6 @@ class PrintWebViewHelper
@@ -265,7 +258,6 @@ class PrintWebViewHelper
bool UpdatePrintSettings(blink::WebLocalFrame* frame,
const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings);
@@ -513,7 +524,7 @@ index d979333..8786274 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Get final print settings from the user.
@@ -336,7 +328,6 @@ class PrintWebViewHelper
@@ -346,7 +338,6 @@ class PrintWebViewHelper
const PrintMsg_PrintPages_Params& params,
int page_count);
@@ -521,7 +532,7 @@ index d979333..8786274 100644
// 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,
@@ -346,7 +337,6 @@ class PrintWebViewHelper
@@ -356,7 +347,6 @@ class PrintWebViewHelper
float webkit_scale_factor,
const PageSizeMargins& page_layout_in_points,
const PrintMsg_Print_Params& params);
@@ -529,7 +540,7 @@ index d979333..8786274 100644
// Script Initiated Printing ------------------------------------------------
@@ -356,7 +346,6 @@ class PrintWebViewHelper
@@ -366,7 +356,6 @@ class PrintWebViewHelper
bool IsScriptInitiatedPrintAllowed(blink::WebLocalFrame* frame,
bool user_initiated);
@@ -537,7 +548,7 @@ index d979333..8786274 100644
// Shows scripted print preview when options from plugin are available.
void ShowScriptedPrintPreview();
@@ -374,7 +363,6 @@ class PrintWebViewHelper
@@ -384,7 +373,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);
@@ -545,7 +556,7 @@ index d979333..8786274 100644
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
@@ -527,6 +515,7 @@ class PrintWebViewHelper
@@ -537,6 +525,7 @@ class PrintWebViewHelper
ScriptingThrottler scripting_throttler_;
bool print_node_in_progress_;
@@ -554,18 +565,18 @@ index d979333..8786274 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 6de15ad..95190ae 100644
index 4c1c5b9..538845c 100644
--- components/printing/renderer/print_web_view_helper_mac.mm
+++ components/printing/renderer/print_web_view_helper_mac.mm
@@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal(
Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params));
@@ -74,7 +74,6 @@ void PrintWebViewHelper::PrintPagesInternal(
}
}
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
bool PrintWebViewHelper::RenderPreviewPage(
int page_number,
const PrintMsg_Print_Params& print_params) {
@@ -105,7 +104,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
@@ -111,7 +110,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
}
return PreviewPageRendered(page_number, draft_metafile.get());
}
@@ -573,7 +584,7 @@ index 6de15ad..95190ae 100644
void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
int page_number,
@@ -141,14 +139,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
@@ -147,14 +145,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
MetafileSkiaWrapper::SetMetafileOnCanvas(canvas, metafile);
cc::SetIsPreviewMetafile(canvas, is_preview);

View File

@@ -1,13 +0,0 @@
diff --git set_process_title.cc set_process_title.cc
index 2118598..8f85c70 100644
--- set_process_title.cc
+++ set_process_title.cc
@@ -44,7 +44,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) {
bool have_argv0 = false;
#if defined(OS_LINUX)
- DCHECK_EQ(base::PlatformThread::CurrentId(), getpid());
+ //DCHECK_EQ(base::PlatformThread::CurrentId(), getpid());
if (main_argv)
setproctitle_init(main_argv);

View File

@@ -1,8 +1,8 @@
diff --git render_view_host_impl.h render_view_host_impl.h
index fece1e0..9c54a78 100644
index bcc702b..3753c50 100644
--- render_view_host_impl.h
+++ render_view_host_impl.h
@@ -153,6 +153,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
@@ -154,6 +154,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
void set_is_swapped_out(bool is_swapped_out) {
is_swapped_out_ = is_swapped_out;
}

View File

@@ -1,8 +1,8 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
index b67a5f3..edf32a4 100644
index 896170a..4beadf9 100644
--- render_widget_host_view_mac.mm
+++ render_widget_host_view_mac.mm
@@ -463,9 +463,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
@@ -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]);

View File

@@ -1,12 +1,14 @@
diff --git content/browser/renderer_host/input/render_widget_host_latency_tracker.cc content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
index f809926..3635113 100644
--- content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
+++ content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
@@ -80,7 +80,6 @@ void UpdateLatencyCoordinates(const WebInputEvent& event,
diff --git ui/latency/latency_histogram_macros.h ui/latency/latency_histogram_macros.h
index 77e3eee..f8dd635 100644
--- ui/latency/latency_histogram_macros.h
+++ ui/latency/latency_histogram_macros.h
@@ -10,8 +10,7 @@
// Check valid timing for start and end latency components.
#define CONFIRM_VALID_TIMING(start, end) \
DCHECK(!start.first_event_time.is_null()); \
DCHECK(!end.last_event_time.is_null()); \
- DCHECK(!end.last_event_time.is_null()); \
- DCHECK_GE(end.last_event_time, start.first_event_time);
+ DCHECK(!end.last_event_time.is_null());
// Long scroll latency component that is mostly under 200ms.
#define UMA_HISTOGRAM_SCROLL_LATENCY_LONG(name, start, end) \
// Event latency that is mostly under 1 second. We should only use 100 buckets
// when needed.

View File

@@ -1,11 +1,11 @@
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index 204d1ae..0768d71 100644
index 3e49165..ba55f02 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -757,8 +757,10 @@ void RenderWidgetHostViewAura::SetBackgroundColor(SkColor color) {
RenderWidgetHostViewBase::SetBackgroundColor(color);
bool opaque = GetBackgroundOpaque();
host_->SetBackgroundOpaque(opaque);
@@ -740,8 +740,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer(
background_color_ = color;
bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
- window_->layer()->SetFillsBoundsOpaquely(opaque);
- window_->layer()->SetColor(color);
+ if (window_) {

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/spellchecker/spellcheck_factory.cc chrome/browser/spellchecker/spellcheck_factory.cc
index 3857256..3d1562c 100644
index 9d94c21..990046f 100644
--- chrome/browser/spellchecker/spellcheck_factory.cc
+++ chrome/browser/spellchecker/spellcheck_factory.cc
@@ -16,6 +16,13 @@
@@ -17,6 +17,13 @@
#include "content/public/browser/render_process_host.h"
#include "ui/base/l10n/l10n_util.h"
@@ -16,7 +16,7 @@ index 3857256..3d1562c 100644
// static
SpellcheckService* SpellcheckServiceFactory::GetForContext(
content::BrowserContext* context) {
@@ -38,7 +45,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderProcessId(
@@ -39,7 +46,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderProcessId(
// static
SpellcheckServiceFactory* SpellcheckServiceFactory::GetInstance() {
@@ -26,7 +26,7 @@ index 3857256..3d1562c 100644
SpellcheckServiceFactory::SpellcheckServiceFactory()
diff --git chrome/browser/spellchecker/spellcheck_factory.h chrome/browser/spellchecker/spellcheck_factory.h
index e8eb9f7..48126000 100644
index e8eb9f7..2e1b7cf 100644
--- chrome/browser/spellchecker/spellcheck_factory.h
+++ chrome/browser/spellchecker/spellcheck_factory.h
@@ -7,7 +7,7 @@
@@ -43,7 +43,7 @@ index e8eb9f7..48126000 100644
private:
- friend struct base::DefaultSingletonTraits<SpellcheckServiceFactory>;
+ friend struct base::DefaultLazyInstanceTraits<SpellcheckServiceFactory>;
+ friend struct base::LazyInstanceTraitsBase<SpellcheckServiceFactory>;
SpellcheckServiceFactory();
~SpellcheckServiceFactory() override;
@@ -75,7 +75,7 @@ index 173ac31..473e561 100644
SupervisedUserSettingsServiceFactory::SupervisedUserSettingsServiceFactory()
diff --git chrome/browser/supervised_user/supervised_user_settings_service_factory.h chrome/browser/supervised_user/supervised_user_settings_service_factory.h
index 2907619..c7a36ea 100644
index 2907619..f941fba 100644
--- chrome/browser/supervised_user/supervised_user_settings_service_factory.h
+++ chrome/browser/supervised_user/supervised_user_settings_service_factory.h
@@ -5,7 +5,7 @@
@@ -92,12 +92,12 @@ index 2907619..c7a36ea 100644
private:
- friend struct base::DefaultSingletonTraits<
+ friend struct base::DefaultLazyInstanceTraits<
+ friend struct base::LazyInstanceTraitsBase<
SupervisedUserSettingsServiceFactory>;
SupervisedUserSettingsServiceFactory();
diff --git chrome/browser/ui/prefs/prefs_tab_helper.cc chrome/browser/ui/prefs/prefs_tab_helper.cc
index a46d449..0650084 100644
index a46d449..8c9a6b8 100644
--- chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -11,8 +11,8 @@
@@ -121,7 +121,7 @@ index a46d449..0650084 100644
private:
- friend struct base::DefaultSingletonTraits<PrefWatcherFactory>;
+ friend struct base::DefaultLazyInstanceTraits<PrefWatcherFactory>;
+ friend struct base::LazyInstanceTraitsBase<PrefWatcherFactory>;
PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
"PrefWatcher",

View File

@@ -0,0 +1,136 @@
diff --git services/service_manager/embedder/main.cc services/service_manager/embedder/main.cc
index 0debd91780b5..432d91ef9713 100644
--- services/service_manager/embedder/main.cc
+++ services/service_manager/embedder/main.cc
@@ -29,7 +29,6 @@
#endif
#if defined(OS_MACOSX)
-#include "base/mac/scoped_nsautorelease_pool.h"
#include "services/service_manager/embedder/mac_init.h"
#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
@@ -98,7 +97,7 @@ MainParams::MainParams(MainDelegate* delegate) : delegate(delegate) {}
MainParams::~MainParams() {}
-int Main(const MainParams& params) {
+int MainInitialize(MainParams& params) {
MainDelegate* delegate = params.delegate;
DCHECK(delegate);
@@ -155,9 +154,9 @@ int Main(const MainParams& params) {
// loop, but we don't want to leave them hanging around until the app quits.
// Each "main" needs to flush this pool right before it goes into its main
// event loop to get rid of the cruft.
- std::unique_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool =
+ params.autorelease_pool =
base::MakeUnique<base::mac::ScopedNSAutoreleasePool>();
- init_params.autorelease_pool = autorelease_pool.get();
+ init_params.autorelease_pool = params.autorelease_pool.get();
InitializeMac();
#endif
@@ -173,10 +172,17 @@ int Main(const MainParams& params) {
base::debug::GlobalActivityTracker::PROCESS_LAUNCH_FAILED);
tracker->process_data().SetInt("exit-code", exit_code);
}
- return exit_code;
}
+ return exit_code;
+}
+
+int MainRun(MainParams& params) {
+ MainDelegate* delegate = params.delegate;
+ DCHECK(delegate);
- 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 +193,26 @@ int Main(const MainParams& params) {
tracker->process_data().SetInt("exit-code", exit_code);
}
}
+ 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();
+}
+int Main(MainParams& params) {
+ int exit_code = MainInitialize(params);
+ if (exit_code >= 0)
+ return exit_code;
+ exit_code = MainRun(params);
+ MainShutdown(params);
return exit_code;
}
diff --git services/service_manager/embedder/main.h services/service_manager/embedder/main.h
index e86697a26d0f..771acd80a3e1 100644
--- services/service_manager/embedder/main.h
+++ services/service_manager/embedder/main.h
@@ -5,9 +5,15 @@
#ifndef SERVICES_SERVICE_MANAGER_EMBEDDER_MAIN_H_
#define SERVICES_SERVICE_MANAGER_EMBEDDER_MAIN_H_
+#include <memory>
+
#include "build/build_config.h"
#include "services/service_manager/embedder/service_manager_embedder_export.h"
+#if defined(OS_MACOSX)
+#include "base/mac/scoped_nsautorelease_pool.h"
+#endif // defined(OS_MACOSX)
+
namespace service_manager {
class MainDelegate;
@@ -22,11 +28,20 @@ struct SERVICE_MANAGER_EMBEDDER_EXPORT MainParams {
int argc = 0;
const char** argv = nullptr;
#endif
+
+#if defined(OS_MACOSX)
+ std::unique_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool;
+#endif
};
+// Split Main() into separate stages.
+int SERVICE_MANAGER_EMBEDDER_EXPORT MainInitialize(MainParams& params);
+int SERVICE_MANAGER_EMBEDDER_EXPORT MainRun(MainParams& params);
+void SERVICE_MANAGER_EMBEDDER_EXPORT MainShutdown(MainParams& params);
+
// Main function which should be called as early as possible by any executable
// embedding the service manager.
-int SERVICE_MANAGER_EMBEDDER_EXPORT Main(const MainParams& params);
+int SERVICE_MANAGER_EMBEDDER_EXPORT Main(MainParams& params);
} // 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
--- 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) {
bool have_argv0 = false;
#if defined(OS_LINUX)
- DCHECK_EQ(base::PlatformThread::CurrentId(), getpid());
+ //DCHECK_EQ(base::PlatformThread::CurrentId(), getpid());
if (main_argv)
setproctitle_init(main_argv);

View File

@@ -1,5 +1,5 @@
diff --git content/browser/appcache/appcache_internals_ui.cc content/browser/appcache/appcache_internals_ui.cc
index 28f33e7..9b0d352 100644
index e9ad038..2a10c80 100644
--- content/browser/appcache/appcache_internals_ui.cc
+++ content/browser/appcache/appcache_internals_ui.cc
@@ -369,8 +369,8 @@ void AppCacheInternalsUI::CreateProxyForPartition(
@@ -42,10 +42,10 @@ index 4c7cfac..4d5c09c 100644
BrowserContext* browser_context);
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
index 2f14933..6894773 100644
index b7a99d5..b9f70ea 100644
--- content/browser/browser_context.cc
+++ content/browser/browser_context.cc
@@ -115,7 +115,14 @@ StoragePartition* GetStoragePartitionFromConfig(
@@ -114,7 +114,14 @@ StoragePartition* GetStoragePartitionFromConfig(
if (browser_context->IsOffTheRecord())
in_memory = true;
@@ -61,7 +61,7 @@ index 2f14933..6894773 100644
}
void SaveSessionStateOnIOThread(
@@ -503,6 +510,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
@@ -505,6 +512,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
: nullptr;
}
@@ -91,10 +91,10 @@ index 242d33e..4dfb463 100644
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 7346efe..20560c7 100644
index 9986ff6..0d2abbd 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -669,7 +669,7 @@ void RenderProcessHostImpl::EarlyZygoteLaunch() {
@@ -661,7 +661,7 @@ void RenderProcessHostImpl::EarlyZygoteLaunch() {
RenderProcessHostImpl::RenderProcessHostImpl(
BrowserContext* browser_context,
@@ -103,7 +103,7 @@ index 7346efe..20560c7 100644
bool is_for_guests_only)
: fast_shutdown_started_(false),
deleting_soon_(false),
@@ -699,7 +699,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -691,7 +691,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
indexed_db_factory_(new IndexedDBDispatcherHost(
id_,
storage_partition_impl_->GetURLRequestContext(),
@@ -113,7 +113,7 @@ index 7346efe..20560c7 100644
ChromeBlobStorageContext::GetFor(browser_context_))),
channel_connected_(false),
sent_render_process_ready_(false),
@@ -729,7 +730,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -722,7 +723,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
}
push_messaging_manager_.reset(new PushMessagingManager(
@@ -121,9 +121,9 @@ index 7346efe..20560c7 100644
+ GetID(), static_cast<ServiceWorkerContextWrapper*>(
+ storage_partition_impl_->GetServiceWorkerContext())));
AddObserver(indexed_db_factory_.get());
#if defined(OS_MACOSX)
if (BootstrapSandboxManager::ShouldEnable())
@@ -932,7 +934,7 @@ bool RenderProcessHostImpl::Init() {
@@ -926,7 +928,7 @@ bool RenderProcessHostImpl::Init() {
}
void RenderProcessHostImpl::EnableSendQueue() {
@@ -132,7 +132,7 @@ index 7346efe..20560c7 100644
InitializeChannelProxy();
}
@@ -1026,6 +1028,22 @@ void RenderProcessHostImpl::ResetChannelProxy() {
@@ -1020,6 +1022,22 @@ void RenderProcessHostImpl::ResetChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -155,7 +155,7 @@ index 7346efe..20560c7 100644
AddFilter(new ResourceSchedulerFilter(GetID()));
MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
@@ -1040,8 +1058,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1034,8 +1052,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
new RenderMessageFilter(
GetID(), GetBrowserContext(), request_context.get(),
widget_helper_.get(), media_internals,
@@ -166,7 +166,7 @@ index 7346efe..20560c7 100644
AddFilter(render_message_filter.get());
render_frame_message_filter_ = new RenderFrameMessageFilter(
@@ -1071,10 +1089,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1065,10 +1083,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
ChromeBlobStorageContext::GetFor(browser_context);
resource_message_filter_ = new ResourceMessageFilter(
@@ -174,12 +174,12 @@ index 7346efe..20560c7 100644
+ GetID(), app_cache_service,
blob_storage_context.get(),
storage_partition_impl_->GetFileSystemContext(),
- storage_partition_impl_->GetServiceWorkerContext(),
+ service_worker_context,
get_contexts_callback);
- storage_partition_impl_->GetServiceWorkerContext(), get_contexts_callback,
+ service_worker_context, get_contexts_callback,
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
AddFilter(resource_message_filter_.get());
@@ -1098,10 +1116,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1092,10 +1110,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service()));
AddFilter(new AppCacheDispatcherHost(
@@ -192,7 +192,7 @@ index 7346efe..20560c7 100644
#if BUILDFLAG(ENABLE_WEBRTC)
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(
@@ -1141,13 +1159,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1135,13 +1153,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
new CacheStorageDispatcherHost();
@@ -208,7 +208,7 @@ index 7346efe..20560c7 100644
AddFilter(service_worker_filter.get());
AddFilter(new SharedWorkerMessageFilter(
@@ -1155,12 +1172,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1149,12 +1166,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
WorkerStoragePartition(
storage_partition_impl_->GetURLRequestContext(),
storage_partition_impl_->GetMediaURLRequestContext(),
@@ -224,7 +224,7 @@ index 7346efe..20560c7 100644
base::Bind(&RenderWidgetHelper::GetNextRoutingID,
base::Unretained(widget_helper_.get()))));
@@ -1176,11 +1193,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1170,11 +1187,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
GetID(), storage_partition_impl_->GetQuotaManager(),
GetContentClient()->browser()->CreateQuotaPermissionContext()));
@@ -237,9 +237,9 @@ index 7346efe..20560c7 100644
resource_context, service_worker_context, browser_context);
AddFilter(notification_message_filter_.get());
@@ -1199,6 +1213,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
auto registry = base::MakeUnique<service_manager::InterfaceRegistry>(
service_manager::mojom::kServiceManager_ConnectorSpec);
@@ -1191,6 +1205,11 @@ void RenderProcessHostImpl::CreateMessageFilters() {
void RenderProcessHostImpl::RegisterMojoInterfaces() {
auto registry = base::MakeUnique<service_manager::BinderRegistry>();
+ // Cast to the derived type from StoragePartitionImpl.
+ auto platform_notification_context =
@@ -247,9 +247,9 @@ index 7346efe..20560c7 100644
+ storage_partition_impl_->GetPlatformNotificationContext());
+
channel_->AddAssociatedInterfaceForIOThread(
base::Bind(&IndexedDBDispatcherHost::AddBinding, indexed_db_factory_));
@@ -1259,8 +1278,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
base::Bind(&IndexedDBDispatcherHost::AddBinding,
base::Unretained(indexed_db_factory_.get())));
@@ -1252,8 +1271,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
AddUIThreadInterface(
registry.get(),
base::Bind(&PlatformNotificationContextImpl::CreateService,
@@ -259,7 +259,7 @@ index 7346efe..20560c7 100644
GetID()));
AddUIThreadInterface(
registry.get(),
@@ -1460,6 +1478,7 @@ void RenderProcessHostImpl::ForceReleaseWorkerRefCounts() {
@@ -1451,6 +1469,7 @@ void RenderProcessHostImpl::ForceReleaseWorkerRefCounts() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!is_worker_ref_count_disabled_);
is_worker_ref_count_disabled_ = true;
@@ -268,18 +268,18 @@ index 7346efe..20560c7 100644
return;
service_worker_ref_count_ = 0;
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
index 1eac862..84c87a5 100644
index aa6898d..f19264e 100644
--- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h
@@ -72,7 +72,6 @@ class RenderWidgetHelper;
class RenderWidgetHost;
@@ -75,7 +75,6 @@ class RenderWidgetHost;
class RenderWidgetHostImpl;
class ResourceMessageFilter;
class StoragePartition;
-class StoragePartitionImpl;
namespace mojom {
class StoragePartitionService;
@@ -108,7 +107,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -111,7 +110,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider) {
public:
RenderProcessHostImpl(BrowserContext* browser_context,
@@ -288,8 +288,12 @@ index 1eac862..84c87a5 100644
bool is_for_guests_only);
~RenderProcessHostImpl() override;
@@ -508,7 +507,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
BrowserContext* browser_context_;
@@ -516,10 +515,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// called.
int instance_id_ = 1;
- BrowserContext* const browser_context_;
+ BrowserContext* browser_context_;
// Owned by |browser_context_|.
- StoragePartitionImpl* storage_partition_impl_;
@@ -314,18 +318,20 @@ index a4c8862..2312f35 100644
is_for_guests_only);
}
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
index 92b46dd..45f372c 100644
index 5b706ff..6d7f7cd 100644
--- content/browser/storage_partition_impl.h
+++ content/browser/storage_partition_impl.h
@@ -77,11 +77,10 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -78,12 +78,11 @@ class CONTENT_EXPORT StoragePartitionImpl
ZoomLevelDelegate* GetZoomLevelDelegate() override;
PlatformNotificationContextImpl* GetPlatformNotificationContext() override;
void ClearBluetoothAllowedDevicesMapForTesting() override;
-
- BackgroundFetchContext* GetBackgroundFetchContext();
- BackgroundSyncContext* GetBackgroundSyncContext();
- PaymentAppContextImpl* GetPaymentAppContext();
- BroadcastChannelProvider* GetBroadcastChannelProvider();
- BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap();
+ BackgroundFetchContext* GetBackgroundFetchContext() override;
+ BackgroundSyncContext* GetBackgroundSyncContext() override;
+ PaymentAppContextImpl* GetPaymentAppContext() override;
+ BroadcastChannelProvider* GetBroadcastChannelProvider() override;
@@ -333,7 +339,7 @@ index 92b46dd..45f372c 100644
// mojom::StoragePartitionService interface.
void OpenLocalStorage(
@@ -115,7 +114,8 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -123,7 +122,8 @@ class CONTENT_EXPORT StoragePartitionImpl
BrowserContext* browser_context() const;
// Called by each renderer process once.
@@ -372,10 +378,10 @@ index 075ae3e..57fb5fd 100644
void InitializeOnIOThread();
diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h
index f5cc21f..0a6cd2b 100644
index 89461da..619996f 100644
--- content/public/browser/browser_context.h
+++ content/public/browser/browser_context.h
@@ -170,6 +170,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
@@ -171,6 +171,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
static ServiceManagerConnection* GetServiceManagerConnectionFor(
BrowserContext* browser_context);
@@ -384,11 +390,10 @@ index f5cc21f..0a6cd2b 100644
~BrowserContext() override;
// Shuts down the storage partitions associated to this browser context.
@@ -244,6 +246,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
CreateMediaRequestContextForStoragePartition(
@@ -246,6 +248,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
const base::FilePath& partition_path,
bool in_memory) = 0;
+
+ // CEF returns a proxy object that forwards method calls to |partition_impl|.
+ virtual content::StoragePartition* GetStoragePartitionProxy(
+ BrowserContext* browser_context,
@@ -396,11 +401,12 @@ index f5cc21f..0a6cd2b 100644
+ NOTREACHED();
+ return nullptr;
+ }
};
+
using StaticServiceMap = std::map<std::string, ServiceInfo>;
} // namespace content
// 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 ae4ba1e..f595bcf 100644
index 4d4021d..00f0c6a 100644
--- content/public/browser/storage_partition.h
+++ content/public/browser/storage_partition.h
@@ -13,6 +13,7 @@
@@ -411,10 +417,11 @@ index ae4ba1e..f595bcf 100644
#include "net/cookies/cookie_store.h"
class GURL;
@@ -41,16 +42,24 @@ class DatabaseTracker;
@@ -41,16 +42,25 @@ class DatabaseTracker;
namespace content {
class AppCacheService;
+class BackgroundFetchContext;
+class BackgroundSyncContext;
+class BluetoothAllowedDevicesMap;
+class BroadcastChannelProvider;
@@ -436,10 +443,11 @@ index ae4ba1e..f595bcf 100644
// Defines what persistent state a child process can access.
//
// The StoragePartition defines the view each child process has of the
@@ -74,6 +83,10 @@ class CONTENT_EXPORT StoragePartition {
@@ -74,6 +84,11 @@ class CONTENT_EXPORT StoragePartition {
virtual HostZoomLevelContext* GetHostZoomLevelContext() = 0;
virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0;
virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0;
+ virtual BackgroundFetchContext* GetBackgroundFetchContext() = 0;
+ virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
+ virtual PaymentAppContextImpl* GetPaymentAppContext() = 0;
+ virtual BroadcastChannelProvider* GetBroadcastChannelProvider() = 0;
@@ -447,7 +455,7 @@ index ae4ba1e..f595bcf 100644
enum : uint32_t {
REMOVE_DATA_MASK_APPCACHE = 1 << 0,
@@ -169,6 +182,10 @@ class CONTENT_EXPORT StoragePartition {
@@ -179,6 +194,10 @@ class CONTENT_EXPORT StoragePartition {
// Clear the bluetooth allowed devices map. For test use only.
virtual void ClearBluetoothAllowedDevicesMapForTesting() = 0;

View File

@@ -1,15 +0,0 @@
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()

View File

@@ -1,7 +1,36 @@
diff --git controls/button/menu_button.cc controls/button/menu_button.cc
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
--- controls/button/menu_button.cc
+++ controls/button/menu_button.cc
--- 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();
@@ -31,10 +60,10 @@ index 173194b..8bb4f6e 100644
+}
+
} // namespace views
diff --git controls/button/menu_button.h controls/button/menu_button.h
diff --git ui/views/controls/button/menu_button.h ui/views/controls/button/menu_button.h
index b0ddf331..4d573ed 100644
--- controls/button/menu_button.h
+++ controls/button/menu_button.h
--- 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;
@@ -55,10 +84,25 @@ index b0ddf331..4d573ed 100644
// 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 view.h view.h
index fcbee85..8ba4fd0 100644
--- view.h
+++ view.h
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"
@@ -67,7 +111,7 @@ index fcbee85..8ba4fd0 100644
#include "build/build_config.h"
#include "ui/accessibility/ax_enums.h"
#include "ui/base/accelerators/accelerator.h"
@@ -114,7 +115,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
@@ -115,7 +116,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
public ui::LayerOwner,
public ui::AcceleratorTarget,
public ui::EventTarget,

View File

@@ -39,10 +39,10 @@ index 0755f27..0322b8c 100644
virtual void MenuWillShow() {}
diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc
index e3a15e6..5fae563 100644
index 97b6c8f..84b9387 100644
--- ui/gfx/render_text.cc
+++ ui/gfx/render_text.cc
@@ -595,6 +595,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) {
@@ -567,6 +567,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) {
}
}
@@ -57,7 +57,7 @@ index e3a15e6..5fae563 100644
void RenderText::SetDisplayRect(const Rect& r) {
if (r != display_rect_) {
display_rect_ = r;
@@ -1472,6 +1480,19 @@ void RenderText::OnTextAttributeChanged() {
@@ -1466,6 +1474,19 @@ void RenderText::OnTextAttributeChanged() {
if (!multiline_ && replace_newline_chars_with_symbols_)
base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_);
@@ -78,10 +78,10 @@ index e3a15e6..5fae563 100644
}
diff --git ui/gfx/render_text.h ui/gfx/render_text.h
index bcb7314..4063073 100644
index 00fe00c..bc4fd59 100644
--- ui/gfx/render_text.h
+++ ui/gfx/render_text.h
@@ -313,6 +313,10 @@ class GFX_EXPORT RenderText {
@@ -312,6 +312,10 @@ class GFX_EXPORT RenderText {
void SetElideBehavior(ElideBehavior elide_behavior);
ElideBehavior elide_behavior() const { return elide_behavior_; }
@@ -92,7 +92,7 @@ index bcb7314..4063073 100644
const Rect& display_rect() const { return display_rect_; }
void SetDisplayRect(const Rect& r);
@@ -861,6 +865,8 @@ class GFX_EXPORT RenderText {
@@ -858,6 +862,8 @@ class GFX_EXPORT RenderText {
// OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls.
std::vector<internal::Line> lines_;
@@ -102,22 +102,22 @@ index bcb7314..4063073 100644
};
diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc
index 4a7cfd9..750a6ca 100644
index d114946..30f4283 100644
--- ui/views/controls/button/label_button.cc
+++ ui/views/controls/button/label_button.cc
@@ -239,6 +239,7 @@ gfx::Size LabelButton::GetPreferredSize() const {
// Use a temporary label copy for sizing to avoid calculation side-effects.
Label label(GetText(), label_->font_list());
@@ -236,6 +236,7 @@ gfx::Size LabelButton::GetPreferredSize() const {
Label label(GetText(), {label_->font_list()});
label.SetLineHeight(label_->line_height());
label.SetShadows(label_->shadows());
+ label.SetDrawStringsFlags(label_->draw_strings_flags());
if (style_ == STYLE_BUTTON && PlatformStyle::kDefaultLabelButtonHasBoldFont) {
// Some text appears wider when rendered normally than when rendered bold.
diff --git ui/views/controls/label.cc ui/views/controls/label.cc
index 2d16942..dc60700 100644
index 762227f..18a7293 100644
--- ui/views/controls/label.cc
+++ ui/views/controls/label.cc
@@ -28,6 +28,7 @@
@@ -27,6 +27,7 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/text_elider.h"
@@ -125,7 +125,7 @@ index 2d16942..dc60700 100644
#include "ui/native_theme/native_theme.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/background.h"
@@ -37,6 +38,25 @@
@@ -36,6 +37,25 @@
#include "ui/views/selection_controller.h"
namespace views {
@@ -151,7 +151,7 @@ index 2d16942..dc60700 100644
// static
const char Label::kViewClassName[] = "Label";
const int Label::kFocusBorderPadding = 1;
@@ -211,6 +231,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
@@ -215,6 +235,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
ResetLayout();
}
@@ -167,7 +167,7 @@ index 2d16942..dc60700 100644
void Label::SetTooltipText(const base::string16& tooltip_text) {
DCHECK(handles_tooltips_);
tooltip_text_ = tooltip_text;
@@ -445,7 +474,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText(
@@ -449,7 +478,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText(
render_text->SetFontList(font_list());
render_text->set_shadows(shadows());
render_text->SetCursorEnabled(false);
@@ -189,10 +189,10 @@ index 2d16942..dc60700 100644
}
diff --git ui/views/controls/label.h ui/views/controls/label.h
index 516368e..22c597a 100644
index f9c49d0..b1fa1fa 100644
--- ui/views/controls/label.h
+++ ui/views/controls/label.h
@@ -120,6 +120,10 @@ class VIEWS_EXPORT Label : public View,
@@ -147,6 +147,10 @@ class VIEWS_EXPORT Label : public View,
void SetElideBehavior(gfx::ElideBehavior elide_behavior);
gfx::ElideBehavior elide_behavior() const { return elide_behavior_; }
@@ -203,7 +203,7 @@ index 516368e..22c597a 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
@@ -340,6 +344,7 @@ class VIEWS_EXPORT Label : public View,
@@ -367,6 +371,7 @@ class VIEWS_EXPORT Label : public View,
bool collapse_when_hidden_;
int fixed_width_;
int max_width_;
@@ -212,10 +212,10 @@ index 516368e..22c597a 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 335945f..99ad0d9 100644
index 3f9436d..0bf813a1 100644
--- ui/views/controls/menu/menu_controller.cc
+++ ui/views/controls/menu/menu_controller.cc
@@ -2270,8 +2270,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem(
@@ -2261,8 +2261,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem(
void MenuController::OpenSubmenuChangeSelectionIfCan() {
MenuItemView* item = pending_state_.item;
@@ -230,7 +230,7 @@ index 335945f..99ad0d9 100644
MenuItemView* to_select = NULL;
if (item->GetSubmenu()->GetMenuItemCount() > 0)
to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN);
@@ -2286,8 +2291,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
@@ -2277,8 +2282,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
void MenuController::CloseSubmenu() {
MenuItemView* item = state_.item;
DCHECK(item);

View File

@@ -1,16 +1,24 @@
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
index 029e72d..07d574d 100644
index 4dd0e59..d9394c7 100644
--- content/browser/renderer_host/render_widget_host_view_base.cc
+++ content/browser/renderer_host/render_widget_host_view_base.cc
@@ -41,6 +41,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
@@ -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) {
weak_factory_(this) {}
@@ -138,7 +139,6 @@ void RenderWidgetHostViewBase::SetIsInVR(bool is_in_vr) {
}
@@ -325,6 +326,14 @@ void RenderWidgetHostViewBase::FocusedNodeTouched(
bool RenderWidgetHostViewBase::IsInVR() const {
- NOTIMPLEMENTED();
return false;
}
@@ -310,6 +310,14 @@ void RenderWidgetHostViewBase::FocusedNodeTouched(
DVLOG(1) << "FocusedNodeTouched: " << editable;
}
@@ -26,10 +34,10 @@ index 029e72d..07d574d 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 657ad20..fcd514a 100644
index 3f0cdab..581b984 100644
--- content/browser/renderer_host/render_widget_host_view_base.h
+++ content/browser/renderer_host/render_widget_host_view_base.h
@@ -66,6 +66,7 @@ class BrowserAccessibilityDelegate;
@@ -73,6 +73,7 @@ class BrowserAccessibilityDelegate;
class BrowserAccessibilityManager;
class RenderWidgetHostImpl;
class RenderWidgetHostViewBaseObserver;
@@ -37,7 +45,7 @@ index 657ad20..fcd514a 100644
class SyntheticGestureTarget;
class TextInputManager;
class WebCursor;
@@ -115,6 +116,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
@@ -119,6 +120,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
void EndFrameSubscription() override;
void FocusedNodeTouched(const gfx::Point& location_dips_screen,
bool editable) override;
@@ -46,7 +54,7 @@ index 657ad20..fcd514a 100644
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
// that handle content embedded within other RenderWidgetHostViews.
@@ -338,6 +341,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
@@ -353,6 +356,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;
@@ -59,7 +67,7 @@ index 657ad20..fcd514a 100644
// Sets the cursor to the one associated with the specified cursor_type
virtual void UpdateCursor(const WebCursor& cursor) = 0;
@@ -442,6 +451,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
@@ -454,6 +463,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// destroyed before the RWHV is destroyed.
TextInputManager* text_input_manager_;
@@ -71,7 +79,7 @@ index 657ad20..fcd514a 100644
void FlushInput();
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 628aa29..f2098f9 100644
index 980a6780..cfcc1e2 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 @@
@@ -85,7 +93,7 @@ index 628aa29..f2098f9 100644
#if defined(OS_WIN)
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/public/common/context_menu_params.h"
@@ -817,6 +821,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
@@ -822,6 +826,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
}
}
#endif
@@ -101,10 +109,10 @@ index 628aa29..f2098f9 100644
if (host_ && set_focus_on_mouse_down_or_key_event_) {
set_focus_on_mouse_down_or_key_event_ = false;
diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h
index 8d52b0f..eda7104 100644
index e295ef2..dcce231 100644
--- content/public/browser/render_widget_host_view.h
+++ content/public/browser/render_widget_host_view.h
@@ -233,6 +233,14 @@ class CONTENT_EXPORT RenderWidgetHostView {
@@ -234,6 +234,14 @@ class CONTENT_EXPORT RenderWidgetHostView {
// when the value has changed. Views must initially default to false.
virtual void SetNeedsBeginFrames(bool needs_begin_frames) = 0;
@@ -133,7 +141,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 2756595..6385de1 100644
index fd25fc6..80b8093 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(
@@ -192,10 +200,10 @@ 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 448baf89..0bebfd8 100644
index 4215122..846f45e 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -194,6 +194,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
@@ -198,6 +198,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
use_native_frame_(false),
should_maximize_after_map_(false),
use_argb_visual_(false),
@@ -203,7 +211,7 @@ index 448baf89..0bebfd8 100644
drag_drop_client_(NULL),
native_widget_delegate_(native_widget_delegate),
desktop_native_widget_aura_(desktop_native_widget_aura),
@@ -207,6 +208,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
@@ -211,6 +212,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
has_window_focus_(false),
has_pointer_focus_(false),
modal_dialog_counter_(0),
@@ -211,7 +219,7 @@ index 448baf89..0bebfd8 100644
close_widget_factory_(this),
weak_factory_(this) {}
@@ -242,6 +244,8 @@ std::vector<aura::Window*> DesktopWindowTreeHostX11::GetAllOpenWindows() {
@@ -246,6 +248,8 @@ std::vector<aura::Window*> DesktopWindowTreeHostX11::GetAllOpenWindows() {
}
gfx::Rect DesktopWindowTreeHostX11::GetX11RootWindowBounds() const {
@@ -220,7 +228,7 @@ index 448baf89..0bebfd8 100644
return bounds_in_pixels_;
}
@@ -550,7 +554,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
@@ -554,7 +558,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
// Actually free our native resources.
if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
@@ -230,7 +238,7 @@ index 448baf89..0bebfd8 100644
xwindow_ = None;
desktop_native_widget_aura_->OnHostClosed();
@@ -691,6 +696,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
@@ -695,6 +700,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
}
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
@@ -239,7 +247,7 @@ index 448baf89..0bebfd8 100644
return ToDIPRect(bounds_in_pixels_);
}
@@ -1289,6 +1296,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels(
@@ -1293,6 +1300,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels(
}
gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const {
@@ -248,7 +256,7 @@ index 448baf89..0bebfd8 100644
return bounds_in_pixels_.origin();
}
@@ -1415,9 +1424,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
@@ -1419,9 +1428,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
attribute_mask |= CWBorderPixel;
swa.border_pixel = 0;
@@ -265,7 +273,7 @@ index 448baf89..0bebfd8 100644
bounds_in_pixels_.y(), bounds_in_pixels_.width(),
bounds_in_pixels_.height(),
0, // border width
@@ -2048,6 +2063,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
@@ -2040,6 +2055,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
}
break;
}
@@ -277,7 +285,7 @@ index 448baf89..0bebfd8 100644
case FocusOut:
OnFocusEvent(xev->type == FocusIn, event->xfocus.mode,
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
index 544f086..0e81c59 100644
index 757b780..45d57ae 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -87,6 +87,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@@ -293,7 +301,7 @@ index 544f086..0e81c59 100644
protected:
// Overridden from DesktopWindowTreeHost:
void Init(aura::Window* content_window,
@@ -302,6 +308,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@@ -300,6 +306,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// The bounds of |xwindow_|.
gfx::Rect bounds_in_pixels_;
@@ -303,7 +311,7 @@ index 544f086..0e81c59 100644
// Whenever the bounds are set, we keep the previous set of bounds around so
// we can have a better chance of getting the real
// |restored_bounds_in_pixels_|. Window managers tend to send a Configure
@@ -341,6 +350,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@@ -339,6 +348,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Whether we used an ARGB visual for our window.
bool use_argb_visual_;
@@ -314,7 +322,7 @@ index 544f086..0e81c59 100644
DesktopDragDropClientAuraX11* drag_drop_client_;
std::unique_ptr<ui::EventHandler> x11_non_client_event_filter_;
@@ -428,6 +441,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@@ -426,6 +439,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
uint32_t modal_dialog_counter_;
@@ -325,7 +333,7 @@ index 544f086..0e81c59 100644
base::WeakPtrFactory<DesktopWindowTreeHostX11> weak_factory_;
diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc
index 38ade37..e66b0cd 100644
index de3ac38..b417146 100644
--- ui/views/widget/widget.cc
+++ ui/views/widget/widget.cc
@@ -131,6 +131,7 @@ Widget::InitParams::InitParams(Type type)
@@ -336,7 +344,7 @@ index 38ade37..e66b0cd 100644
native_widget(nullptr),
desktop_window_tree_host(nullptr),
layer_type(ui::LAYER_TEXTURED),
@@ -306,7 +307,7 @@ void Widget::Init(const InitParams& in_params) {
@@ -305,7 +306,7 @@ void Widget::Init(const InitParams& in_params) {
params.name = params.delegate->GetContentsView()->GetClassName();
params.child |= (params.type == InitParams::TYPE_CONTROL);
@@ -345,7 +353,7 @@ index 38ade37..e66b0cd 100644
if (params.opacity == views::Widget::InitParams::INFER_OPACITY &&
params.type != views::Widget::InitParams::TYPE_WINDOW &&
@@ -370,7 +371,12 @@ void Widget::Init(const InitParams& in_params) {
@@ -369,7 +370,12 @@ void Widget::Init(const InitParams& in_params) {
}
} else if (params.delegate) {
SetContentsView(params.delegate->GetContentsView());
@@ -360,7 +368,7 @@ index 38ade37..e66b0cd 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 2a239c4..3d02b48 100644
index 36b86ea..9a39084 100644
--- ui/views/widget/widget.h
+++ ui/views/widget/widget.h
@@ -253,6 +253,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@@ -372,10 +380,10 @@ index 2a239c4..3d02b48 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 810b9cb..fc339da 100644
index 7590741..0e06a35 100644
--- ui/views/win/hwnd_message_handler.cc
+++ ui/views/win/hwnd_message_handler.cc
@@ -2539,8 +2539,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -2664,8 +2664,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 8800f75..6b047eb 100644
index 6c9c358..fe5df86 100644
--- content/browser/web_contents/web_contents_impl.cc
+++ content/browser/web_contents/web_contents_impl.cc
@@ -1571,6 +1571,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -1581,6 +1581,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 8800f75..6b047eb 100644
WebContentsViewDelegate* delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -1581,6 +1587,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -1591,6 +1597,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
view_.reset(CreateWebContentsView(this, delegate,
&render_view_host_delegate_view_));
}
@@ -23,7 +23,7 @@ index 8800f75..6b047eb 100644
if (browser_plugin_guest_ && !GuestMode::IsCrossProcessFrameGuest(this)) {
view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
@@ -2093,6 +2100,15 @@ void WebContentsImpl::CreateNewWindow(
@@ -2127,6 +2134,15 @@ void WebContentsImpl::CreateNewWindow(
create_params.renderer_initiated_creation =
main_frame_route_id != MSG_ROUTING_NONE;
@@ -39,7 +39,7 @@ index 8800f75..6b047eb 100644
WebContentsImpl* new_contents = NULL;
if (!is_guest) {
create_params.context = view_->GetNativeView();
@@ -2122,7 +2138,7 @@ void WebContentsImpl::CreateNewWindow(
@@ -2156,7 +2172,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 8800f75..6b047eb 100644
}
// Save the created window associated with the route so we can show it
// later.
@@ -4985,7 +5001,7 @@ NavigationEntry*
@@ -5029,7 +5045,7 @@ NavigationEntry*
void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager(
RenderViewHost* render_view_host) {
RenderWidgetHostViewBase* rwh_view =
@@ -73,7 +73,7 @@ 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 5a509ef..981a0a5 100644
index f968ca2..ee6f060 100644
--- content/public/browser/web_contents.h
+++ content/public/browser/web_contents.h
@@ -60,9 +60,11 @@ class PageState;
@@ -100,7 +100,7 @@ index 5a509ef..981a0a5 100644
// Creates a new WebContents.
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
index 6f966c7..391b9a0 100644
index 232d3a9..6622768 100644
--- content/public/browser/web_contents_delegate.h
+++ content/public/browser/web_contents_delegate.h
@@ -42,11 +42,13 @@ class ColorChooser;

View File

@@ -0,0 +1,170 @@
diff --git Source/core/dom/DOMImplementation.cpp Source/core/dom/DOMImplementation.cpp
index 8aab9bb..e3286f6 100644
--- Source/core/dom/DOMImplementation.cpp
+++ Source/core/dom/DOMImplementation.cpp
@@ -241,10 +241,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());
- plugin_data = init.GetFrame()->GetPage()->GetPluginData(origin.Get());
+ plugin_data = init.GetFrame()->GetPage()->GetPluginData(true,
+ origin.Get());
} else {
plugin_data =
- init.GetFrame()->GetPage()->GetPluginData(init.GetFrame()
+ init.GetFrame()->GetPage()->GetPluginData(false, init.GetFrame()
->Tree()
.Top()
->GetSecurityContext()
diff --git Source/core/frame/LocalFrame.cpp Source/core/frame/LocalFrame.cpp
index b64d75d..869b45d 100644
--- Source/core/frame/LocalFrame.cpp
+++ Source/core/frame/LocalFrame.cpp
@@ -927,7 +927,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());
}
diff --git Source/core/page/Page.cpp Source/core/page/Page.cpp
index 941a30c..2c5764c 100644
--- Source/core/page/Page.cpp
+++ Source/core/page/Page.cpp
@@ -289,16 +289,30 @@ void Page::RefreshPlugins() {
for (const Page* page : AllPages()) {
// Clear out the page's plugin data.
- if (page->plugin_data_)
- page->plugin_data_ = nullptr;
+ if (page->plugin_data_main_frame_)
+ page->plugin_data_main_frame_ = nullptr;
+ if (page->plugin_data_sub_frame_)
+ page->plugin_data_sub_frame_ = nullptr;
}
}
-PluginData* Page::GetPluginData(SecurityOrigin* main_frame_origin) const {
- if (!plugin_data_ ||
- !main_frame_origin->IsSameSchemeHostPort(plugin_data_->Origin()))
- plugin_data_ = PluginData::Create(main_frame_origin);
- return plugin_data_.Get();
+PluginData* Page::GetPluginData(bool is_main_frame,
+ SecurityOrigin* main_frame_origin) const {
+ if (is_main_frame) {
+ if (!plugin_data_main_frame_ ||
+ !main_frame_origin->IsSameSchemeHostPort(
+ plugin_data_main_frame_->Origin())) {
+ plugin_data_main_frame_ = PluginData::Create(true, main_frame_origin);
+ }
+ return plugin_data_main_frame_.Get();
+ } else {
+ if (!plugin_data_sub_frame_ ||
+ !main_frame_origin->IsSameSchemeHostPort(
+ plugin_data_sub_frame_->Origin())) {
+ plugin_data_sub_frame_ = PluginData::Create(false, main_frame_origin);
+ }
+ return plugin_data_sub_frame_.Get();
+ }
}
void Page::SetValidationMessageClient(ValidationMessageClient* client) {
diff --git Source/core/page/Page.h Source/core/page/Page.h
index e644faa..2fe0d37 100644
--- Source/core/page/Page.h
+++ Source/core/page/Page.h
@@ -132,7 +132,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
ViewportDescription GetViewportDescription() const;
static void RefreshPlugins();
- PluginData* GetPluginData(SecurityOrigin* main_frame_origin) const;
+ PluginData* GetPluginData(bool is_main_frame,
+ SecurityOrigin* main_frame_origin) const;
EditorClient& GetEditorClient() const { return *editor_client_; }
SpellCheckerClient& GetSpellCheckerClient() const {
@@ -324,7 +325,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
// longer needed.
Member<Frame> main_frame_;
- mutable RefPtr<PluginData> plugin_data_;
+ mutable RefPtr<PluginData> plugin_data_main_frame_;
+ mutable RefPtr<PluginData> plugin_data_sub_frame_;
EditorClient* const editor_client_;
SpellCheckerClient* const spell_checker_client_;
diff --git Source/platform/plugins/PluginData.cpp Source/platform/plugins/PluginData.cpp
index 03618f6..5ac59e8 100644
--- Source/platform/plugins/PluginData.cpp
+++ Source/platform/plugins/PluginData.cpp
@@ -30,11 +30,12 @@
namespace blink {
-PluginData::PluginData(SecurityOrigin* main_frame_origin)
- : main_frame_origin_(main_frame_origin) {
+PluginData::PluginData(bool is_main_frame, SecurityOrigin* main_frame_origin)
+ : is_main_frame_(is_main_frame),
+ main_frame_origin_(main_frame_origin) {
PluginListBuilder builder(&plugins_);
Platform::Current()->GetPluginList(
- false, WebSecurityOrigin(main_frame_origin_), &builder);
+ false, is_main_frame_, WebSecurityOrigin(main_frame_origin_), &builder);
for (unsigned i = 0; i < plugins_.size(); ++i) {
const PluginInfo& plugin = plugins_[i];
@@ -73,7 +74,8 @@ String PluginData::PluginNameForMimeType(const String& mime_type) const {
void PluginData::RefreshBrowserSidePluginCache() {
Vector<PluginInfo> plugins;
PluginListBuilder builder(&plugins);
- Platform::Current()->GetPluginList(true, WebSecurityOrigin::CreateUnique(),
+ Platform::Current()->GetPluginList(true, true,
+ WebSecurityOrigin::CreateUnique(),
&builder);
}
diff --git Source/platform/plugins/PluginData.h Source/platform/plugins/PluginData.h
index cdf3381..671f17c 100644
--- Source/platform/plugins/PluginData.h
+++ Source/platform/plugins/PluginData.h
@@ -52,8 +52,9 @@ class PLATFORM_EXPORT PluginData : public RefCounted<PluginData> {
WTF_MAKE_NONCOPYABLE(PluginData);
public:
- static PassRefPtr<PluginData> Create(SecurityOrigin* main_frame_origin) {
- return AdoptRef(new PluginData(main_frame_origin));
+ static PassRefPtr<PluginData> Create(bool is_main_frame,
+ SecurityOrigin* main_frame_origin) {
+ return AdoptRef(new PluginData(is_main_frame, main_frame_origin));
}
const Vector<PluginInfo>& Plugins() const { return plugins_; }
@@ -71,12 +72,13 @@ class PLATFORM_EXPORT PluginData : public RefCounted<PluginData> {
static void RefreshBrowserSidePluginCache();
private:
- explicit PluginData(SecurityOrigin* main_frame_origin);
+ explicit PluginData(bool is_main_frame, SecurityOrigin* main_frame_origin);
const PluginInfo* PluginInfoForMimeType(const String& mime_type) const;
Vector<PluginInfo> plugins_;
Vector<MimeClassInfo> mimes_;
Vector<size_t> mime_plugin_indices_;
+ bool is_main_frame_;
RefPtr<SecurityOrigin> main_frame_origin_;
};
diff --git public/platform/Platform.h public/platform/Platform.h
index eab1ca5..6657878 100644
--- public/platform/Platform.h
+++ public/platform/Platform.h
@@ -365,6 +365,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,
+ bool is_main_frame,
const WebSecurityOrigin& main_frame_origin,
WebPluginListBuilder*) {}

View File

@@ -1,75 +1,75 @@
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index a5721cf..d89dcff 100644
index ba81ee3..648d7ce 100644
--- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp
@@ -898,7 +898,7 @@ bool ChromeClientImpl::hasOpenedPopup() const {
PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame,
@@ -908,7 +908,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
HTMLSelectElement& select) {
notifyPopupOpeningObservers();
- if (WebViewImpl::useExternalPopupMenus())
+ if (m_webView->useExternalPopupMenus())
return new ExternalPopupMenu(frame, select, *m_webView);
NotifyPopupOpeningObservers();
- if (WebViewImpl::UseExternalPopupMenus())
+ if (web_view_->UseExternalPopupMenus())
return new ExternalPopupMenu(frame, select, *web_view_);
DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
index 8a38208..90784a8 100644
index 16ac66b..7053b54 100644
--- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp
@@ -357,6 +357,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
m_enableFakePageScaleAnimationForTesting(false),
m_fakePageScaleAnimationPageScaleFactor(0),
m_fakePageScaleAnimationUseAnchor(false),
+ m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus),
m_compositorDeviceScaleFactorOverride(0),
m_suppressNextKeypressEvent(false),
m_imeAcceptEvents(true),
@@ -3704,8 +3705,13 @@ void WebViewImpl::mainFrameScrollOffsetChanged() {
m_devToolsEmulator->mainFrameScrollOrScaleChanged();
@@ -355,6 +355,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
enable_fake_page_scale_animation_for_testing_(false),
fake_page_scale_animation_page_scale_factor_(0),
fake_page_scale_animation_use_anchor_(false),
+ should_use_external_popup_menus_(g_should_use_external_popup_menus),
compositor_device_scale_factor_override_(0),
suppress_next_keypress_event_(false),
ime_accept_events_(true),
@@ -3743,8 +3744,13 @@ void WebViewImpl::MainFrameScrollOffsetChanged() {
dev_tools_emulator_->MainFrameScrollOrScaleChanged();
}
+void WebViewImpl::setUseExternalPopupMenusThisInstance(
+void WebViewImpl::SetUseExternalPopupMenusThisInstance(
+ bool useExternalPopupMenus) {
+ m_shouldUseExternalPopupMenus = useExternalPopupMenus;
+ should_use_external_popup_menus_ = useExternalPopupMenus;
+}
+
bool WebViewImpl::useExternalPopupMenus() {
- return shouldUseExternalPopupMenus;
+ return m_shouldUseExternalPopupMenus;
bool WebViewImpl::UseExternalPopupMenus() {
- return g_should_use_external_popup_menus;
+ return should_use_external_popup_menus_;
}
void WebViewImpl::setBackgroundColorOverride(WebColor color) {
void WebViewImpl::SetBackgroundColorOverride(WebColor color) {
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
index f94b695..4828185 100644
index a22ef37..33dbab4 100644
--- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h
@@ -369,7 +369,8 @@ class WEB_EXPORT WebViewImpl final
@@ -362,7 +362,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();
- static bool UseExternalPopupMenus();
+ void SetUseExternalPopupMenusThisInstance(bool);
+ bool UseExternalPopupMenus();
bool shouldAutoResize() const { return m_shouldAutoResize; }
bool ShouldAutoResize() const { return should_auto_resize_; }
@@ -652,6 +653,8 @@ class WEB_EXPORT WebViewImpl final
float m_fakePageScaleAnimationPageScaleFactor;
bool m_fakePageScaleAnimationUseAnchor;
@@ -647,6 +648,8 @@ class WEB_EXPORT WebViewImpl final
float fake_page_scale_animation_page_scale_factor_;
bool fake_page_scale_animation_use_anchor_;
+ bool m_shouldUseExternalPopupMenus;
+ bool should_use_external_popup_menus_;
+
float m_compositorDeviceScaleFactorOverride;
TransformationMatrix m_deviceEmulationTransform;
float compositor_device_scale_factor_override_;
TransformationMatrix device_emulation_transform_;
diff --git public/web/WebView.h public/web/WebView.h
index 92bdf07..1a813a9 100644
index e811392..d6d5bf8 100644
--- public/web/WebView.h
+++ public/web/WebView.h
@@ -402,6 +402,7 @@ class WebView : protected WebWidget {
@@ -403,6 +403,7 @@ class WebView : protected WebWidget {
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool);
+ virtual void setUseExternalPopupMenusThisInstance(bool) = 0;
BLINK_EXPORT static void SetUseExternalPopupMenus(bool);
+ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0;
// Hides any popup (suggestions, selects...) that might be showing.
virtual void hidePopups() = 0;
virtual void HidePopups() = 0;

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 268d526..607f7e3 100644
index 3a72ef9..303258b 100644
--- chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -530,8 +530,7 @@ void NetInternalsMessageHandler::OnGetSessionNetworkStats(
@@ -531,8 +531,7 @@ void NetInternalsMessageHandler::OnGetSessionNetworkStats(
const base::ListValue* list) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
SendJavascriptCommand(
@@ -12,7 +12,7 @@ index 268d526..607f7e3 100644
}
void NetInternalsMessageHandler::OnGetExtensionInfo(
@@ -627,9 +626,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady(
@@ -628,9 +627,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady(
PrePopulateEventList();

View File

@@ -1,8 +1,8 @@
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
index c10c883..a03df69 100644
index eabe276..63e127d 100644
--- chrome/app/generated_resources.grd
+++ chrome/app/generated_resources.grd
@@ -6771,7 +6771,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
@@ -5279,7 +5279,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.">