cef/patch/patches/plugin_info_2015.patch

355 lines
17 KiB
Diff
Raw Normal View History

diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 8949f08..45a0640 100644
--- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc
@@ -478,8 +478,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(
- -1, -1, resource_context, url, url::Origin(), mime_type, false, &is_stale,
- &plugin_info, &actual_mime_type);
+ -1, -1, resource_context, url, true, url::Origin(), mime_type, false,
+ &is_stale, &plugin_info, &actual_mime_type);
if (is_stale && stale_plugin_action == RETRY_IF_STALE_PLUGIN_LIST) {
// The GetPlugins call causes the plugin list to be refreshed. Once that's
// done we can retry the GetPluginInfo call. We break out of this cycle
diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc
index 1783a10..b380ef8 100644
--- chrome/browser/plugins/chrome_plugin_service_filter.cc
+++ chrome/browser/plugins/chrome_plugin_service_filter.cc
@@ -179,6 +179,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
int render_frame_id,
const void* context,
const GURL& plugin_content_url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin) {
base::AutoLock auto_lock(lock_);
diff --git chrome/browser/plugins/chrome_plugin_service_filter.h chrome/browser/plugins/chrome_plugin_service_filter.h
index f8b651f..ec39f8d 100644
--- chrome/browser/plugins/chrome_plugin_service_filter.h
+++ chrome/browser/plugins/chrome_plugin_service_filter.h
@@ -71,6 +71,7 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter,
int render_frame_id,
const void* context,
const GURL& plugin_content_url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
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
--- chrome/browser/plugins/plugin_info_message_filter.cc
+++ chrome/browser/plugins/plugin_info_message_filter.cc
@@ -483,8 +483,8 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
for (; i < matching_plugins.size(); ++i) {
if (!filter ||
filter->IsPluginAvailable(render_process_id_, render_frame_id,
- resource_context_, url, main_frame_origin,
- &matching_plugins[i])) {
+ resource_context_, url, true,
+ main_frame_origin, &matching_plugins[i])) {
break;
}
}
diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm
index 4a3e00e..aca7f98 100644
--- chrome/browser/ui/cocoa/drag_util.mm
+++ chrome/browser/ui/cocoa/drag_util.mm
@@ -52,7 +52,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
return PluginService::GetInstance()->GetPluginInfo(
-1, // process ID
MSG_ROUTING_NONE, // routing ID
- profile->GetResourceContext(), url, url::Origin(), mime_type,
+ profile->GetResourceContext(), url, true, url::Origin(), mime_type,
allow_wildcard, NULL, &plugin, NULL);
}
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 59d15a7..7831a36 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -592,6 +592,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
content::PluginService::GetInstance()->GetPluginInfo(
-1, // process ID
MSG_ROUTING_NONE, // routing ID
- model_->profile()->GetResourceContext(), url, url::Origin(),
+ model_->profile()->GetResourceContext(), url, true, url::Origin(),
mime_type, false, NULL, &plugin, NULL));
}
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index 93a1da4..79ac197 100644
--- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc
@@ -459,6 +459,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
void RenderFrameMessageFilter::OnGetPlugins(
bool refresh,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
IPC::Message* reply_msg) {
// Don't refresh if the specified threshold has not been passed. Note that
@@ -480,18 +481,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
PluginServiceImpl::GetInstance()->GetPlugins(
base::Bind(&RenderFrameMessageFilter::GetPluginsCallback, this, reply_msg,
- main_frame_origin));
+ is_main_frame, main_frame_origin));
}
void RenderFrameMessageFilter::GetPluginsCallback(
IPC::Message* reply_msg,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::vector<WebPluginInfo>& all_plugins) {
// Filter the plugin list.
PluginServiceFilter* filter = PluginServiceImpl::GetInstance()->GetFilter();
std::vector<WebPluginInfo> plugins;
- int child_process_id = -1;
+ int child_process_id = render_process_id_;
int routing_id = MSG_ROUTING_NONE;
// In this loop, copy the WebPluginInfo (and do not use a reference) because
// the filter might mutate it.
@@ -500,7 +502,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
if (!filter ||
filter->IsPluginAvailable(child_process_id, routing_id,
resource_context_, main_frame_origin.GetURL(),
- main_frame_origin, &plugin)) {
+ is_main_frame, main_frame_origin, &plugin)) {
plugins.push_back(plugin);
}
}
@@ -512,6 +514,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
void RenderFrameMessageFilter::OnGetPluginInfo(
int render_frame_id,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool* found,
@@ -520,8 +523,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
bool allow_wildcard = true;
*found = plugin_service_->GetPluginInfo(
render_process_id_, render_frame_id, resource_context_, url,
- main_frame_origin, mime_type, allow_wildcard, nullptr, info,
- actual_mime_type);
+ is_main_frame, main_frame_origin, mime_type, allow_wildcard, nullptr,
+ info, actual_mime_type);
}
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h
index 05500b4..cd00c4c 100644
--- content/browser/frame_host/render_frame_message_filter.h
+++ content/browser/frame_host/render_frame_message_filter.h
@@ -125,13 +125,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter
#if BUILDFLAG(ENABLE_PLUGINS)
void OnGetPlugins(bool refresh,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
IPC::Message* reply_msg);
void GetPluginsCallback(IPC::Message* reply_msg,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::vector<WebPluginInfo>& plugins);
void OnGetPluginInfo(int render_frame_id,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
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 6c13e04..556e43d 100644
--- content/browser/loader/mime_sniffing_resource_handler.cc
+++ content/browser/loader/mime_sniffing_resource_handler.cc
@@ -426,8 +426,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
WebPluginInfo plugin;
bool has_plugin = plugin_service_->GetPluginInfo(
info->GetChildID(), info->GetRenderFrameID(), info->GetContext(),
- request()->url(), url::Origin(), response_->head.mime_type,
- allow_wildcard, &stale, &plugin, NULL);
+ request()->url(), info->IsMainFrame(), url::Origin(),
+ response_->head.mime_type, allow_wildcard, &stale, &plugin, NULL);
if (stale) {
// Refresh the plugins asynchronously.
diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
index 480c659..ec4d108 100644
--- content/browser/plugin_service_impl.cc
+++ content/browser/plugin_service_impl.cc
@@ -243,6 +243,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
int render_frame_id,
ResourceContext* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
@@ -259,7 +260,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
for (size_t i = 0; i < plugins.size(); ++i) {
if (!filter_ ||
filter_->IsPluginAvailable(render_process_id, render_frame_id, context,
- url, main_frame_origin, &plugins[i])) {
+ url, is_main_frame, main_frame_origin,
+ &plugins[i])) {
*info = plugins[i];
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
--- content/browser/plugin_service_impl.h
+++ content/browser/plugin_service_impl.h
@@ -71,6 +71,7 @@ class CONTENT_EXPORT PluginServiceImpl
int render_frame_id,
ResourceContext* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
diff --git content/common/frame_messages.h content/common/frame_messages.h
index 9092344..efcdb7f 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -1187,8 +1187,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.
-IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
+IPC_SYNC_MESSAGE_CONTROL3_1(FrameHostMsg_GetPlugins,
bool /* refresh*/,
+ bool /* is_main_frame */,
url::Origin /* main_frame_origin */,
std::vector<content::WebPluginInfo> /* plugins */)
@@ -1196,9 +1197,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.
-IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo,
+IPC_SYNC_MESSAGE_CONTROL5_3(FrameHostMsg_GetPluginInfo,
int /* render_frame_id */,
GURL /* url */,
+ bool /* is_main_frame */,
url::Origin /* main_frame_origin */,
std::string /* mime_type */,
bool /* found */,
diff --git content/ppapi_plugin/ppapi_blink_platform_impl.cc content/ppapi_plugin/ppapi_blink_platform_impl.cc
index c4dc0cf..4fe3e1b 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() {
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
--- 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,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder*) override;
blink::WebData loadResource(const char* name) override;
diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h
index c404ac8..9dd87e7 100644
--- content/public/browser/plugin_service.h
+++ content/public/browser/plugin_service.h
@@ -74,6 +74,7 @@ class PluginService {
int render_frame_id,
ResourceContext* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool allow_wildcard,
diff --git content/public/browser/plugin_service_filter.h content/public/browser/plugin_service_filter.h
index 3b610b1..7c439e0 100644
--- content/public/browser/plugin_service_filter.h
+++ content/public/browser/plugin_service_filter.h
@@ -33,6 +33,7 @@ class PluginServiceFilter {
int render_frame_id,
const void* context,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
WebPluginInfo* plugin) = 0;
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index 2d93238..d511e99 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -2749,7 +2749,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));
if (!found)
return NULL;
@@ -5259,9 +5260,8 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty());
-#ifdef OS_ANDROID
- bool render_view_was_created_by_renderer =
- render_view_->was_created_by_renderer_;
+ // CEF doesn't use this value, so just pass false.
+ bool render_view_was_created_by_renderer = false;
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation(
@@ -5270,7 +5270,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) {
return blink::WebNavigationPolicyIgnore;
}
-#endif
Referrer referrer(
RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 462b144..e44983c 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -750,6 +750,7 @@ blink::WebMIDIAccessor* RendererBlinkPlatformImpl::createMIDIAccessor(
void RendererBlinkPlatformImpl::getPluginList(
bool refresh,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) {
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -757,7 +758,8 @@ void RendererBlinkPlatformImpl::getPluginList(
if (!plugin_refresh_allowed_)
refresh = false;
RenderThread::Get()->Send(
- new FrameHostMsg_GetPlugins(refresh, mainFrameOrigin, &plugins));
+ new FrameHostMsg_GetPlugins(refresh, isMainFrame, mainFrameOrigin,
+ &plugins));
for (const WebPluginInfo& plugin : plugins) {
builder->addPlugin(
plugin.name, plugin.desc,
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index 6c9ac66..f53f26e 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;
void getPluginList(bool refresh,
+ bool isMainFrame,
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) override;
blink::WebPublicSuffixList* publicSuffixList() override;