2017-01-19 00:37:56 +01:00
|
|
|
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
|
2019-02-21 01:42:36 +01:00
|
|
|
index 25de1508db60..5fcfffa96b89 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/download/download_target_determiner.cc
|
|
|
|
+++ chrome/browser/download/download_target_determiner.cc
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -597,8 +597,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-10-24 22:37:39 +02:00
|
|
|
index e16e00dc888b..5d102629a0d4 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-09-04 11:43:21 +02:00
|
|
|
@@ -168,6 +168,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-09-04 11:43:21 +02:00
|
|
|
index c707c8773a74..20bdf74abf01 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-09-04 11:43:21 +02:00
|
|
|
@@ -65,6 +65,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
|
2019-02-21 01:42:36 +01:00
|
|
|
index 2eb7f21919fd..4218d3352d70 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
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -71,8 +71,8 @@ bool IsPDFPluginEnabled(content::NavigationHandle* navigation_handle,
|
|
|
|
content::WebPluginInfo plugin_info;
|
|
|
|
return content::PluginService::GetInstance()->GetPluginInfo(
|
|
|
|
process_id, routing_id, resource_context, navigation_handle->GetURL(),
|
|
|
|
- web_contents->GetMainFrame()->GetLastCommittedOrigin(), kPDFMimeType,
|
|
|
|
- false /* allow_wildcard */, is_stale, &plugin_info,
|
|
|
|
+ false, web_contents->GetMainFrame()->GetLastCommittedOrigin(),
|
|
|
|
+ kPDFMimeType, false /* allow_wildcard */, is_stale, &plugin_info,
|
|
|
|
nullptr /* actual_mime_type */);
|
|
|
|
}
|
|
|
|
#endif
|
2018-05-20 15:51:42 +02:00
|
|
|
diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
|
2019-03-13 22:27:37 +01:00
|
|
|
index be77d0e074e9..949873b9bb22 100644
|
2018-05-20 15:51:42 +02:00
|
|
|
--- chrome/browser/ui/views/frame/browser_root_view.cc
|
|
|
|
+++ chrome/browser/ui/views/frame/browser_root_view.cc
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -70,7 +70,7 @@ void OnFindURLMimeType(const GURL& url,
|
2017-01-19 00:37:56 +01:00
|
|
|
content::PluginService::GetInstance()->GetPluginInfo(
|
|
|
|
-1, // process ID
|
|
|
|
MSG_ROUTING_NONE, // routing ID
|
2018-05-20 15:51:42 +02:00
|
|
|
- profile->GetResourceContext(), url, url::Origin(), mime_type,
|
|
|
|
+ profile->GetResourceContext(), url, true, url::Origin(), mime_type,
|
|
|
|
false, nullptr, &plugin, nullptr));
|
2017-01-19 00:37:56 +01:00
|
|
|
}
|
2018-05-20 15:51:42 +02:00
|
|
|
|
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
|
2019-03-13 22:27:37 +01:00
|
|
|
index 1e912186c32c..38d03aafc8b0 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
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -308,12 +308,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
|
2017-04-20 21:28:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
|
2018-05-21 14:54:08 +02:00
|
|
|
- // Only allow the RenderFrameHost to be retrieved once it has been set for
|
|
|
|
- // this navigation. This will happens either at WillProcessResponse time for
|
|
|
|
- // regular navigations or at WillFailRequest time for error pages.
|
2019-02-01 17:42:40 +01:00
|
|
|
- CHECK_GE(state_, PROCESSING_WILL_FAIL_REQUEST)
|
2018-05-21 14:54:08 +02:00
|
|
|
- << "This accessor should only be called after a RenderFrameHost has been "
|
|
|
|
- "picked for this navigation.";
|
|
|
|
static_assert(WILL_FAIL_REQUEST < WILL_PROCESS_RESPONSE,
|
|
|
|
"WillFailRequest state should come before WillProcessResponse");
|
2019-03-13 22:27:37 +01:00
|
|
|
return navigation_request_->render_frame_host();
|
2017-04-20 21:28:17 +02:00
|
|
|
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
|
2019-03-13 22:27:37 +01:00
|
|
|
index 21f84cc3f922..020017584cd9 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
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -4777,9 +4777,9 @@ void RenderFrameHostImpl::CommitNavigation(
|
|
|
|
// factories. TODO(kinuko): Consider setting this up only when prefetch
|
|
|
|
// is used. Currently we have this here to make sure we have non-racy
|
|
|
|
// situation (https://crbug.com/849929).
|
2018-07-13 21:29:20 +02:00
|
|
|
- auto* storage_partition = static_cast<StoragePartitionImpl*>(
|
|
|
|
+ auto* storage_partition =
|
|
|
|
BrowserContext::GetStoragePartition(
|
|
|
|
- GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
|
|
|
|
+ GetSiteInstance()->GetBrowserContext(), GetSiteInstance());
|
2018-10-02 14:14:11 +02:00
|
|
|
base::PostTaskWithTraits(
|
|
|
|
FROM_HERE, {BrowserThread::IO},
|
2018-07-13 21:29:20 +02:00
|
|
|
base::BindOnce(&PrefetchURLLoaderService::GetFactory,
|
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
|
2019-03-13 22:27:37 +01:00
|
|
|
index 09095ba2dc8e..2fb0becabf88 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
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -704,6 +704,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
|
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,
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -715,8 +716,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
|
2019-02-21 01:42:36 +01:00
|
|
|
index 641c7bcbf1b8..3faf6a6452c4 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
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -146,6 +146,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter
|
2017-01-19 00:37:56 +01:00
|
|
|
#if BUILDFLAG(ENABLE_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
|
2019-03-13 22:27:37 +01:00
|
|
|
index 31aa4bc38442..0314343499d3 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
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -510,8 +510,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
|
2019-02-21 01:42:36 +01:00
|
|
|
index a599f989065f..115867edec92 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/plugin_service_impl.cc
|
|
|
|
+++ content/browser/plugin_service_impl.cc
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -302,6 +302,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,
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -318,7 +319,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-09-04 11:43:21 +02:00
|
|
|
index cb19abcd26b8..12d66dd7db6e 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/plugin_service_impl.h
|
|
|
|
+++ content/browser/plugin_service_impl.h
|
2018-09-04 11:43:21 +02:00
|
|
|
@@ -57,6 +57,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,
|
2018-07-02 19:11:49 +02:00
|
|
|
diff --git content/browser/renderer_host/plugin_registry_impl.cc content/browser/renderer_host/plugin_registry_impl.cc
|
2019-02-21 01:42:36 +01:00
|
|
|
index 0c598ddb2df7..1049a9ac2b74 100644
|
2018-07-02 19:11:49 +02:00
|
|
|
--- content/browser/renderer_host/plugin_registry_impl.cc
|
|
|
|
+++ content/browser/renderer_host/plugin_registry_impl.cc
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -25,6 +25,7 @@ void PluginRegistryImpl::Bind(blink::mojom::PluginRegistryRequest request) {
|
2018-07-02 19:11:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void PluginRegistryImpl::GetPlugins(bool refresh,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback) {
|
|
|
|
auto* plugin_service = PluginServiceImpl::GetInstance();
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -46,17 +47,18 @@ void PluginRegistryImpl::GetPlugins(bool refresh,
|
2018-07-02 19:11:49 +02:00
|
|
|
|
|
|
|
plugin_service->GetPlugins(base::BindOnce(
|
|
|
|
&PluginRegistryImpl::GetPluginsComplete, weak_factory_.GetWeakPtr(),
|
|
|
|
- main_frame_origin, std::move(callback)));
|
|
|
|
+ is_main_frame, main_frame_origin, std::move(callback)));
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginRegistryImpl::GetPluginsComplete(
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback,
|
|
|
|
const std::vector<WebPluginInfo>& all_plugins) {
|
|
|
|
PluginServiceFilter* filter = PluginServiceImpl::GetInstance()->GetFilter();
|
|
|
|
std::vector<blink::mojom::PluginInfoPtr> plugins;
|
|
|
|
|
|
|
|
- const int child_process_id = -1;
|
|
|
|
+ const int child_process_id = render_process_id_;
|
|
|
|
const int routing_id = MSG_ROUTING_NONE;
|
|
|
|
// In this loop, copy the WebPluginInfo (and do not use a reference) because
|
|
|
|
// the filter might mutate it.
|
2019-02-21 01:42:36 +01:00
|
|
|
@@ -65,7 +67,7 @@ void PluginRegistryImpl::GetPluginsComplete(
|
2018-07-02 19:11:49 +02: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)) {
|
|
|
|
auto plugin_blink = blink::mojom::PluginInfo::New();
|
|
|
|
plugin_blink->name = plugin.name;
|
|
|
|
plugin_blink->description = plugin.desc;
|
|
|
|
diff --git content/browser/renderer_host/plugin_registry_impl.h content/browser/renderer_host/plugin_registry_impl.h
|
|
|
|
index 3009401dac6b..b4c5a9e2db50 100644
|
|
|
|
--- content/browser/renderer_host/plugin_registry_impl.h
|
|
|
|
+++ content/browser/renderer_host/plugin_registry_impl.h
|
|
|
|
@@ -24,17 +24,24 @@ class PluginRegistryImpl : public blink::mojom::PluginRegistry {
|
|
|
|
|
|
|
|
// blink::mojom::PluginRegistry
|
|
|
|
void GetPlugins(bool refresh,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback) override;
|
|
|
|
|
|
|
|
+ void set_render_process_id(int render_process_id) {
|
|
|
|
+ render_process_id_ = render_process_id;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
private:
|
|
|
|
- void GetPluginsComplete(const url::Origin& main_frame_origin,
|
|
|
|
+ void GetPluginsComplete(bool is_main_frame,
|
|
|
|
+ const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback,
|
|
|
|
const std::vector<WebPluginInfo>& all_plugins);
|
|
|
|
|
|
|
|
ResourceContext* const resource_context_;
|
|
|
|
mojo::BindingSet<PluginRegistry> bindings_;
|
|
|
|
base::TimeTicks last_plugin_refresh_time_;
|
|
|
|
+ int render_process_id_ = -1;
|
|
|
|
base::WeakPtrFactory<PluginRegistryImpl> weak_factory_;
|
|
|
|
};
|
|
|
|
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/common/frame_messages.h content/common/frame_messages.h
|
2019-03-13 22:27:37 +01:00
|
|
|
index f1b940d02a3e..7ba4495c34b0 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/common/frame_messages.h
|
|
|
|
+++ content/common/frame_messages.h
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -1319,9 +1319,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
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/public/browser/plugin_service.h content/public/browser/plugin_service.h
|
2018-09-04 11:43:21 +02:00
|
|
|
index aed3085c7794..3b31542094d4 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
|
2019-03-13 22:27:37 +01:00
|
|
|
index 3b5c53a10c8d..bb56c4ed5c77 100644
|
2017-04-20 21:28:17 +02:00
|
|
|
--- content/public/renderer/content_renderer_client.h
|
|
|
|
+++ content/public/renderer/content_renderer_client.h
|
2019-01-17 10:56:52 +01:00
|
|
|
@@ -73,6 +73,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) {}
|
|
|
|
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -333,6 +336,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
|
2019-03-13 22:27:37 +01:00
|
|
|
index c9ce48e3c3ec..0a3448b194a3 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/public/renderer/render_frame_observer.h
|
|
|
|
+++ content/public/renderer/render_frame_observer.h
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -193,6 +193,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
2018-07-02 19:11:49 +02:00
|
|
|
virtual void DidReceiveTransferSizeUpdate(int resource_id,
|
|
|
|
int received_data_length) {}
|
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
|
2019-03-13 22:27:37 +01:00
|
|
|
index b82743edbc63..cae550657487 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/render_frame_impl.cc
|
|
|
|
+++ content/renderer/render_frame_impl.cc
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -3922,7 +3922,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;
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -4340,6 +4341,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
|
2019-03-13 22:27:37 +01:00
|
|
|
index 9d029d4ee65b..d5aff5825371 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/renderer/render_thread_impl.cc
|
|
|
|
+++ content/renderer/render_thread_impl.cc
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -806,6 +806,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
|
2019-03-13 22:27:37 +01:00
|
|
|
index 1277a3b2c1e4..9e62e5ce6dd6 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.cc
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.cc
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -1070,6 +1070,14 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
+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
|
2019-03-13 22:27:37 +01:00
|
|
|
index 38ff3be90843..6514d37afe00 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.h
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.h
|
2019-03-13 22:27:37 +01:00
|
|
|
@@ -235,6 +235,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
|
|
|
std::unique_ptr<blink::WebDataConsumerHandle> CreateDataConsumerHandle(
|
|
|
|
mojo::ScopedDataPipeConsumerHandle handle) override;
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
+ 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-09-04 11:43:21 +02:00
|
|
|
index 6500af1d859f..0d078a4a4281 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-09-04 11:43:21 +02:00
|
|
|
index 205dfc39dfa7..ec250828b0ba 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,
|