2017-01-19 00:37:56 +01:00
|
|
|
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
index cbc50ff93650..c91171abf5b0 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/download/download_target_determiner.cc
|
|
|
|
+++ chrome/browser/download/download_target_determiner.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -571,8 +571,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2018-04-19 17:44:42 +02:00
|
|
|
index e47d5ea63e5a..f2d21e4cefe4 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/plugins/chrome_plugin_service_filter.cc
|
|
|
|
+++ chrome/browser/plugins/chrome_plugin_service_filter.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -177,6 +177,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2018-02-15 01:12:09 +01:00
|
|
|
index 133145db74bf..021ab307ee2a 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/plugins/chrome_plugin_service_filter.h
|
|
|
|
+++ chrome/browser/plugins/chrome_plugin_service_filter.h
|
2018-02-15 01:12:09 +01:00
|
|
|
@@ -66,6 +66,7 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter,
|
2017-01-19 00:37:56 +01:00
|
|
|
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;
|
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
index d05027d09165..d3f57f6d96d7 100644
|
2017-09-06 23:40:58 +02:00
|
|
|
--- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
|
|
|
|
+++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
|
2017-10-20 19:45:20 +02:00
|
|
|
@@ -53,7 +53,7 @@ PDFIFrameNavigationThrottle::MaybeCreateThrottleFor(
|
2017-09-06 23:40:58 +02:00
|
|
|
content::ResourceContext* resource_context =
|
|
|
|
handle->GetWebContents()->GetBrowserContext()->GetResourceContext();
|
|
|
|
if (filter->IsPluginAvailable(process_id, routing_id, resource_context,
|
|
|
|
- handle->GetURL(), url::Origin(),
|
|
|
|
+ handle->GetURL(), false, url::Origin(),
|
|
|
|
&pdf_plugin_info)) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm
|
2018-04-19 17:44:42 +02:00
|
|
|
index 569e6112d86b..41599944688a 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/ui/cocoa/drag_util.mm
|
|
|
|
+++ chrome/browser/ui/cocoa/drag_util.mm
|
2018-03-20 21:15:08 +01:00
|
|
|
@@ -51,7 +51,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2018-04-19 17:44:42 +02:00
|
|
|
index dfbad402f1ea..7a332ea67611 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
|
|
|
|
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
|
2018-03-20 21:15:08 +01:00
|
|
|
@@ -601,6 +601,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
|
2017-01-19 00:37:56 +01:00
|
|
|
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));
|
|
|
|
}
|
2017-04-20 21:28:17 +02:00
|
|
|
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
index 0c0c4cbb9efe..4703ce943367 100644
|
2017-04-20 21:28:17 +02:00
|
|
|
--- content/browser/frame_host/navigation_handle_impl.cc
|
|
|
|
+++ content/browser/frame_host/navigation_handle_impl.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -382,12 +382,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
|
2017-04-20 21:28:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2018-05-17 10:58:21 +02:00
|
|
|
index b358a15ebb1f..e135a52c2b5f 100644
|
2017-04-20 21:28:17 +02:00
|
|
|
--- content/browser/frame_host/render_frame_host_impl.cc
|
|
|
|
+++ content/browser/frame_host/render_frame_host_impl.cc
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -1543,6 +1543,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
|
2018-03-20 21:15:08 +01:00
|
|
|
if (GetNavigationHandle()) {
|
|
|
|
GetNavigationHandle()->set_net_error_code(
|
2017-04-20 21:28:17 +02:00
|
|
|
static_cast<net::Error>(params.error_code));
|
2018-03-20 21:15:08 +01:00
|
|
|
+ GetNavigationHandle()->set_render_frame_host(this);
|
2017-04-20 21:28:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -3432,9 +3433,9 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
|
2018-03-20 21:15:08 +01:00
|
|
|
&QuotaDispatcherHost::CreateForFrame, GetProcess(), routing_id_));
|
|
|
|
|
|
|
|
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
|
|
|
|
- StoragePartitionImpl* storage_partition =
|
|
|
|
- static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition(
|
|
|
|
- GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
|
|
|
|
+ StoragePartition* storage_partition =
|
|
|
|
+ BrowserContext::GetStoragePartition(
|
|
|
|
+ GetSiteInstance()->GetBrowserContext(), GetSiteInstance());
|
|
|
|
// TODO(https://crbug.com/813479): Investigate why we need to explicitly
|
|
|
|
// specify task runner for BrowserThread::IO here.
|
|
|
|
// Bind calls to the BindRegistry should come on to the IO thread by
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -3708,9 +3709,9 @@ void RenderFrameHostImpl::CommitNavigation(
|
2017-12-07 22:44:24 +01:00
|
|
|
// however only do this for cross-document navigations, because the
|
|
|
|
// alternative would be redundant effort.
|
2018-03-20 21:15:08 +01:00
|
|
|
network::mojom::URLLoaderFactoryPtrInfo default_factory_info;
|
2017-12-07 22:44:24 +01:00
|
|
|
- StoragePartitionImpl* storage_partition =
|
|
|
|
- static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition(
|
|
|
|
- GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
|
|
|
|
+ StoragePartition* storage_partition =
|
|
|
|
+ BrowserContext::GetStoragePartition(
|
|
|
|
+ GetSiteInstance()->GetBrowserContext(), GetSiteInstance());
|
|
|
|
if (subresource_loader_params &&
|
|
|
|
subresource_loader_params->loader_factory_info.is_valid()) {
|
|
|
|
// If the caller has supplied a default URLLoaderFactory override (for
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -4331,8 +4332,8 @@ void RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryAndObserve(
|
2018-04-19 17:44:42 +02:00
|
|
|
// Keep DevTools proxy lasy, i.e. closest to the network.
|
|
|
|
RenderFrameDevToolsAgentHost::WillCreateURLLoaderFactory(
|
2018-05-16 11:28:49 +02:00
|
|
|
this, false, false, &default_factory_request);
|
2018-03-20 21:15:08 +01:00
|
|
|
- StoragePartitionImpl* storage_partition = static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetStoragePartition(context, GetSiteInstance()));
|
2018-02-15 01:12:09 +01:00
|
|
|
+ StoragePartition* storage_partition =
|
2018-03-20 21:15:08 +01:00
|
|
|
+ BrowserContext::GetStoragePartition(context, GetSiteInstance());
|
|
|
|
if (g_create_network_factory_callback_for_test.Get().is_null()) {
|
|
|
|
storage_partition->GetNetworkContext()->CreateURLLoaderFactory(
|
|
|
|
std::move(default_factory_request), GetProcess()->GetID());
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
index 80fd7cf89578..8e965cd18a47 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/frame_host/render_frame_message_filter.cc
|
|
|
|
+++ content/browser/frame_host/render_frame_message_filter.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -552,6 +552,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
|
|
|
|
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
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -573,18 +574,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
|
2017-01-19 00:37:56 +01:00
|
|
|
|
|
|
|
PluginServiceImpl::GetInstance()->GetPlugins(
|
2017-09-06 23:40:58 +02:00
|
|
|
base::BindOnce(&RenderFrameMessageFilter::GetPluginsCallback, this,
|
|
|
|
- reply_msg, main_frame_origin));
|
|
|
|
+ reply_msg, is_main_frame, main_frame_origin));
|
2017-01-19 00:37:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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.
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -593,7 +595,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
|
2017-01-19 00:37:56 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -605,6 +607,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
|
2017-01-19 00:37:56 +01:00
|
|
|
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,
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -613,8 +616,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2018-04-19 17:44:42 +02:00
|
|
|
index 871e11f61274..5b1009ab7ec6 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/frame_host/render_frame_message_filter.h
|
|
|
|
+++ content/browser/frame_host/render_frame_message_filter.h
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -139,13 +139,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter
|
2017-01-19 00:37:56 +01:00
|
|
|
|
|
|
|
#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
|
2018-04-19 17:44:42 +02:00
|
|
|
index 577f62b57ff2..3847f8ec616a 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/loader/mime_sniffing_resource_handler.cc
|
|
|
|
+++ content/browser/loader/mime_sniffing_resource_handler.cc
|
2018-03-20 21:15:08 +01:00
|
|
|
@@ -494,8 +494,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
|
2017-01-19 00:37:56 +01:00
|
|
|
WebPluginInfo plugin;
|
|
|
|
bool has_plugin = plugin_service_->GetPluginInfo(
|
|
|
|
info->GetChildID(), info->GetRenderFrameID(), info->GetContext(),
|
|
|
|
- request()->url(), url::Origin(), response_->head.mime_type,
|
2017-12-07 22:44:24 +01:00
|
|
|
- allow_wildcard, &stale, &plugin, nullptr);
|
2017-01-19 00:37:56 +01:00
|
|
|
+ request()->url(), info->IsMainFrame(), url::Origin(),
|
2017-12-07 22:44:24 +01:00
|
|
|
+ response_->head.mime_type, allow_wildcard, &stale, &plugin, nullptr);
|
2017-01-19 00:37:56 +01:00
|
|
|
|
|
|
|
if (stale) {
|
|
|
|
// Refresh the plugins asynchronously.
|
|
|
|
diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
index dcdae19642b5..f1b3c8166ce9 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/plugin_service_impl.cc
|
|
|
|
+++ content/browser/plugin_service_impl.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -286,6 +286,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
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,
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -302,7 +303,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2018-04-19 17:44:42 +02:00
|
|
|
index 4e11056a3dc9..973ad50975e1 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/plugin_service_impl.h
|
|
|
|
+++ content/browser/plugin_service_impl.h
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -65,6 +65,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService {
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2018-05-17 10:58:21 +02:00
|
|
|
index a11c302892a1..3745a11b34dd 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/common/frame_messages.h
|
|
|
|
+++ content/common/frame_messages.h
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -1390,8 +1390,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
2017-01-19 00:37:56 +01:00
|
|
|
|
|
|
|
// 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 */)
|
|
|
|
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -1399,9 +1400,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
|
2017-01-19 00:37:56 +01:00
|
|
|
// 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
|
2018-04-19 17:44:42 +02:00
|
|
|
index a6e5823a51d7..397bb78e41fb 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/ppapi_plugin/ppapi_blink_platform_impl.cc
|
|
|
|
+++ content/ppapi_plugin/ppapi_blink_platform_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -199,6 +199,7 @@ blink::WebThemeEngine* PpapiBlinkPlatformImpl::ThemeEngine() {
|
2017-01-19 00:37:56 +01:00
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
void PpapiBlinkPlatformImpl::GetPluginList(
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2017-12-07 22:44:24 +01:00
|
|
|
index 8a58a2ae1e2f..21b18ff2eba7 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/ppapi_plugin/ppapi_blink_platform_impl.h
|
|
|
|
+++ content/ppapi_plugin/ppapi_blink_platform_impl.h
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -40,6 +40,7 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl {
|
|
|
|
blink::WebString DefaultLocale() override;
|
|
|
|
blink::WebThemeEngine* ThemeEngine() override;
|
2017-04-20 21:28:17 +02:00
|
|
|
void GetPluginList(bool refresh,
|
2017-01-19 00:37:56 +01:00
|
|
|
+ bool isMainFrame,
|
|
|
|
const blink::WebSecurityOrigin& mainFrameOrigin,
|
|
|
|
blink::WebPluginListBuilder*) override;
|
2017-07-27 01:19:27 +02:00
|
|
|
blink::WebData GetDataResource(const char* name) override;
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h
|
2018-04-19 17:44:42 +02:00
|
|
|
index 27021d64244d..60f1ec1845d9 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/public/browser/plugin_service.h
|
|
|
|
+++ content/public/browser/plugin_service.h
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -73,6 +73,7 @@ class CONTENT_EXPORT PluginService {
|
2017-01-19 00:37:56 +01:00
|
|
|
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
|
2017-09-06 23:40:58 +02:00
|
|
|
index 3b610b1f554e..7c439e060779 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- 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;
|
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
|
2018-05-17 10:58:21 +02:00
|
|
|
index e62a17b09f8e..f57d547d9e1a 100644
|
2017-04-20 21:28:17 +02:00
|
|
|
--- content/public/renderer/content_renderer_client.h
|
|
|
|
+++ content/public/renderer/content_renderer_client.h
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -77,6 +77,9 @@ class CONTENT_EXPORT ContentRendererClient {
|
2017-05-31 17:33:30 +02:00
|
|
|
// Notifies us that the RenderThread has been created.
|
|
|
|
virtual void RenderThreadStarted() {}
|
|
|
|
|
|
|
|
+ // Notifies that the RenderThread can now send sync IPC messages.
|
|
|
|
+ virtual void RenderThreadConnected() {}
|
|
|
|
+
|
|
|
|
// Notifies that a new RenderFrame has been created.
|
|
|
|
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
|
|
|
|
|
2018-05-14 13:24:05 +02:00
|
|
|
@@ -363,6 +366,10 @@ class CONTENT_EXPORT ContentRendererClient {
|
2017-12-07 22:44:24 +01:00
|
|
|
// This method may invalidate the frame.
|
|
|
|
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
|
|
|
|
|
|
|
|
+ // Notifies that a DevTools agent has attached or detached.
|
2018-02-15 01:12:09 +01:00
|
|
|
+ virtual void DevToolsAgentAttached() {}
|
|
|
|
+ virtual void DevToolsAgentDetached() {}
|
2017-12-07 22:44:24 +01:00
|
|
|
+
|
|
|
|
// Allows subclasses to enable some runtime features before Blink has
|
|
|
|
// started.
|
|
|
|
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
|
2018-04-19 17:44:42 +02:00
|
|
|
index 74a031ad10c3..3b3f9e292f4b 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/public/renderer/render_frame_observer.h
|
|
|
|
+++ content/public/renderer/render_frame_observer.h
|
2018-04-19 17:44:42 +02:00
|
|
|
@@ -123,6 +123,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
|
|
|
virtual void DidObserveNewCssPropertyUsage(int css_property,
|
|
|
|
bool is_animated) {}
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
+ // Called when this frame gains focus.
|
|
|
|
+ virtual void FrameFocused() {}
|
|
|
|
+
|
|
|
|
// Called when the focused node has changed to |node|.
|
|
|
|
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
|
|
|
|
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
|
2018-05-17 10:58:21 +02:00
|
|
|
index 3c94a2dd53f6..99be46fdbfd3 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/render_frame_impl.cc
|
|
|
|
+++ content/renderer/render_frame_impl.cc
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -3278,7 +3278,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
2017-01-19 00:37:56 +01:00
|
|
|
std::string mime_type;
|
|
|
|
bool found = false;
|
|
|
|
Send(new FrameHostMsg_GetPluginInfo(
|
2017-05-31 17:33:30 +02:00
|
|
|
- routing_id_, params.url, frame_->Top()->GetSecurityOrigin(),
|
|
|
|
+ routing_id_, params.url, frame_->Parent() == nullptr,
|
|
|
|
+ frame_->Top()->GetSecurityOrigin(),
|
2017-04-20 21:28:17 +02:00
|
|
|
params.mime_type.Utf8(), &found, &info, &mime_type));
|
2017-01-19 00:37:56 +01:00
|
|
|
if (!found)
|
2017-05-31 17:33:30 +02:00
|
|
|
return nullptr;
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -3643,6 +3644,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
void RenderFrameImpl::FrameFocused() {
|
|
|
|
Send(new FrameHostMsg_FrameFocused(routing_id_));
|
|
|
|
+ for (auto& observer : observers_)
|
|
|
|
+ observer.FrameFocused();
|
|
|
|
}
|
|
|
|
|
|
|
|
void RenderFrameImpl::WillCommitProvisionalLoad() {
|
|
|
|
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
|
2018-05-17 10:58:21 +02:00
|
|
|
index 672cde1a8ac0..df37f689bed7 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/renderer/render_thread_impl.cc
|
|
|
|
+++ content/renderer/render_thread_impl.cc
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -899,6 +899,8 @@ void RenderThreadImpl::Init(
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
StartServiceManagerConnection();
|
|
|
|
|
|
|
|
+ GetContentClient()->renderer()->RenderThreadConnected();
|
|
|
|
+
|
2017-07-27 01:19:27 +02:00
|
|
|
GetAssociatedInterfaceRegistry()->AddInterface(
|
|
|
|
base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest,
|
|
|
|
base::Unretained(this)));
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
|
2018-05-17 10:58:21 +02:00
|
|
|
index 52e73b6bccea..f90f531792ab 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.cc
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.cc
|
2018-05-16 11:28:49 +02:00
|
|
|
@@ -836,6 +836,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor(
|
2017-01-19 00:37:56 +01:00
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
void RendererBlinkPlatformImpl::GetPluginList(
|
2017-01-19 00:37:56 +01:00
|
|
|
bool refresh,
|
|
|
|
+ bool isMainFrame,
|
|
|
|
const blink::WebSecurityOrigin& mainFrameOrigin,
|
|
|
|
blink::WebPluginListBuilder* builder) {
|
|
|
|
#if BUILDFLAG(ENABLE_PLUGINS)
|
2018-05-16 11:28:49 +02:00
|
|
|
@@ -843,7 +844,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
|
2017-01-19 00:37:56 +01:00
|
|
|
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) {
|
2017-04-20 21:28:17 +02:00
|
|
|
builder->AddPlugin(WebString::FromUTF16(plugin.name),
|
|
|
|
WebString::FromUTF16(plugin.desc),
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -1385,6 +1387,14 @@ void RendererBlinkPlatformImpl::RequestPurgeMemory() {
|
2018-02-15 01:12:09 +01:00
|
|
|
base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
|
|
|
|
}
|
|
|
|
|
|
|
|
+void RendererBlinkPlatformImpl::DevToolsAgentAttached() {
|
|
|
|
+ GetContentClient()->renderer()->DevToolsAgentAttached();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void RendererBlinkPlatformImpl::DevToolsAgentDetached() {
|
|
|
|
+ GetContentClient()->renderer()->DevToolsAgentDetached();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void RendererBlinkPlatformImpl::InitializeWebDatabaseHostIfNeeded() {
|
|
|
|
if (!web_database_host_) {
|
|
|
|
web_database_host_ = blink::mojom::ThreadSafeWebDatabaseHostPtr::Create(
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
|
2018-05-17 10:58:21 +02:00
|
|
|
index cd5a9622c99c..a3f79ae5804b 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.h
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.h
|
2018-05-16 11:28:49 +02:00
|
|
|
@@ -126,6 +126,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
2017-07-27 01:19:27 +02:00
|
|
|
viz::FrameSinkId GenerateFrameSinkId() override;
|
2017-01-19 00:37:56 +01:00
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
void GetPluginList(bool refresh,
|
2017-01-19 00:37:56 +01:00
|
|
|
+ bool isMainFrame,
|
|
|
|
const blink::WebSecurityOrigin& mainFrameOrigin,
|
|
|
|
blink::WebPluginListBuilder* builder) override;
|
2017-04-20 21:28:17 +02:00
|
|
|
blink::WebPublicSuffixList* PublicSuffixList() override;
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -251,6 +252,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
2018-02-15 01:12:09 +01:00
|
|
|
mojo::ScopedDataPipeConsumerHandle handle) override;
|
|
|
|
void RequestPurgeMemory() override;
|
|
|
|
|
|
|
|
+ void DevToolsAgentAttached() override;
|
|
|
|
+ void DevToolsAgentDetached() override;
|
|
|
|
+
|
|
|
|
// Returns non-null.
|
|
|
|
// It is invalid to call this in an incomplete env where
|
|
|
|
// RenderThreadImpl::current() returns nullptr (e.g. in some tests).
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc
|
2017-09-06 23:40:58 +02:00
|
|
|
index 3a48c59b7e3e..d10ef64adbba 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/shell/browser/shell_plugin_service_filter.cc
|
|
|
|
+++ content/shell/browser/shell_plugin_service_filter.cc
|
|
|
|
@@ -18,6 +18,7 @@ bool ShellPluginServiceFilter::IsPluginAvailable(
|
|
|
|
int render_frame_id,
|
|
|
|
const void* context,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
WebPluginInfo* plugin) {
|
|
|
|
return plugin->name == base::ASCIIToUTF16("Blink Test Plugin") ||
|
|
|
|
diff --git content/shell/browser/shell_plugin_service_filter.h content/shell/browser/shell_plugin_service_filter.h
|
2017-09-06 23:40:58 +02:00
|
|
|
index 7767a620a9fd..8a95377f5f3b 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/shell/browser/shell_plugin_service_filter.h
|
|
|
|
+++ content/shell/browser/shell_plugin_service_filter.h
|
|
|
|
@@ -21,6 +21,7 @@ class ShellPluginServiceFilter : public PluginServiceFilter {
|
|
|
|
int render_frame_id,
|
|
|
|
const void* context,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
WebPluginInfo* plugin) override;
|
|
|
|
|
|
|
|
diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc
|
2018-04-19 17:44:42 +02:00
|
|
|
index dfc1e111ac10..23106007a32e 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/test/fake_plugin_service.cc
|
|
|
|
+++ content/test/fake_plugin_service.cc
|
|
|
|
@@ -29,6 +29,7 @@ bool FakePluginService::GetPluginInfo(int render_process_id,
|
|
|
|
int render_frame_id,
|
|
|
|
ResourceContext* context,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool allow_wildcard,
|
|
|
|
diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h
|
2018-04-19 17:44:42 +02:00
|
|
|
index 84bed37848d9..1a66c0757437 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/test/fake_plugin_service.h
|
|
|
|
+++ content/test/fake_plugin_service.h
|
|
|
|
@@ -30,6 +30,7 @@ class FakePluginService : public PluginService {
|
|
|
|
int render_frame_id,
|
|
|
|
ResourceContext* context,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool allow_wildcard,
|
|
|
|
diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc
|
2018-05-17 10:58:21 +02:00
|
|
|
index 4c0203d05655..ba35ffb1a3b2 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/test/test_blink_web_unit_test_support.cc
|
|
|
|
+++ content/test/test_blink_web_unit_test_support.cc
|
2018-05-16 11:28:49 +02:00
|
|
|
@@ -316,6 +316,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() {
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
void TestBlinkWebUnitTestSupport::GetPluginList(
|
|
|
|
bool refresh,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const blink::WebSecurityOrigin& mainFrameOrigin,
|
|
|
|
blink::WebPluginListBuilder* builder) {
|
2018-05-17 10:58:21 +02:00
|
|
|
builder->AddPlugin("pdf", "pdf", "pdf-files", SkColorSetRGB(38, 38, 38));
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/test/test_blink_web_unit_test_support.h content/test/test_blink_web_unit_test_support.h
|
2018-05-16 11:28:49 +02:00
|
|
|
index c3dd2efd9318..9866732b1ebd 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/test/test_blink_web_unit_test_support.h
|
|
|
|
+++ content/test/test_blink_web_unit_test_support.h
|
2018-05-16 11:28:49 +02:00
|
|
|
@@ -65,6 +65,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl {
|
|
|
|
blink::WebThread* CurrentThread() override;
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
void GetPluginList(bool refresh,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const blink::WebSecurityOrigin& mainFrameOrigin,
|
|
|
|
blink::WebPluginListBuilder* builder) override;
|
|
|
|
|