mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			482 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			482 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
 | |
| index 82eee2a72cc4..6e02d9fcce1c 100644
 | |
| --- chrome/browser/download/download_target_determiner.cc
 | |
| +++ chrome/browser/download/download_target_determiner.cc
 | |
| @@ -571,8 +571,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 9f0645f8ae20..16036f0bb26c 100644
 | |
| --- chrome/browser/plugins/chrome_plugin_service_filter.cc
 | |
| +++ chrome/browser/plugins/chrome_plugin_service_filter.cc
 | |
| @@ -178,6 +178,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 133145db74bf..021ab307ee2a 100644
 | |
| --- chrome/browser/plugins/chrome_plugin_service_filter.h
 | |
| +++ chrome/browser/plugins/chrome_plugin_service_filter.h
 | |
| @@ -66,6 +66,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/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
 | |
| index 41a8b316e884..62077f2e8a4e 100644
 | |
| --- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
 | |
| +++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
 | |
| @@ -54,7 +54,7 @@ PDFIFrameNavigationThrottle::MaybeCreateThrottleFor(
 | |
|    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;
 | |
|    }
 | |
| diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm
 | |
| index 569e6112d86b..41599944688a 100644
 | |
| --- chrome/browser/ui/cocoa/drag_util.mm
 | |
| +++ chrome/browser/ui/cocoa/drag_util.mm
 | |
| @@ -51,7 +51,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/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
 | |
| index d544c9ec13a3..b15c5b13d902 100644
 | |
| --- chrome/browser/ui/views/frame/browser_root_view.cc
 | |
| +++ chrome/browser/ui/views/frame/browser_root_view.cc
 | |
| @@ -66,7 +66,7 @@ void OnFindURLMimeType(const GURL& url,
 | |
|            content::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,
 | |
|                false, nullptr, &plugin, nullptr));
 | |
|  }
 | |
|  
 | |
| diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
 | |
| index 201f23b9b422..4664c6b32c22 100644
 | |
| --- content/browser/frame_host/navigation_handle_impl.cc
 | |
| +++ content/browser/frame_host/navigation_handle_impl.cc
 | |
| @@ -381,12 +381,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
 | |
|  }
 | |
|  
 | |
|  RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
 | |
| -  // 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.
 | |
| -  CHECK_GE(state_, WILL_FAIL_REQUEST)
 | |
| -      << "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");
 | |
|    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 9085029dce74..5db015da0c6c 100644
 | |
| --- content/browser/frame_host/render_frame_host_impl.cc
 | |
| +++ content/browser/frame_host/render_frame_host_impl.cc
 | |
| @@ -1612,6 +1612,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
 | |
|    if (GetNavigationHandle()) {
 | |
|      GetNavigationHandle()->set_net_error_code(
 | |
|          static_cast<net::Error>(params.error_code));
 | |
| +    GetNavigationHandle()->set_render_frame_host(this);
 | |
|    }
 | |
|  
 | |
|    frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
 | |
| @@ -4381,8 +4382,8 @@ void RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryAndObserve(
 | |
|    RenderFrameDevToolsAgentHost::WillCreateURLLoaderFactory(
 | |
|        this, false /* is_navigation */, false /* is_download */,
 | |
|        &default_factory_request);
 | |
| -  StoragePartitionImpl* storage_partition = static_cast<StoragePartitionImpl*>(
 | |
| -      BrowserContext::GetStoragePartition(context, GetSiteInstance()));
 | |
| +  auto* storage_partition =
 | |
| +      BrowserContext::GetStoragePartition(context, GetSiteInstance());
 | |
|    if (g_create_network_factory_callback_for_test.Get().is_null()) {
 | |
|      storage_partition->GetNetworkContext()->CreateURLLoaderFactory(
 | |
|          std::move(default_factory_request), std::move(params));
 | |
| @@ -4669,8 +4670,8 @@ void RenderFrameHostImpl::ConnectToPrefetchURLLoaderService(
 | |
|    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 | |
|    DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService));
 | |
|    auto* storage_partition =
 | |
| -      static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition(
 | |
| -          GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
 | |
| +      BrowserContext::GetStoragePartition(
 | |
| +          GetSiteInstance()->GetBrowserContext(), GetSiteInstance());
 | |
|    auto subresource_factories = CloneSubresourceFactories();
 | |
|    // Temporary for https://crbug.com/849929.
 | |
|    CHECK(subresource_factories);
 | |
| diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
 | |
| index e39784552c5a..f9f520211e48 100644
 | |
| --- content/browser/frame_host/render_frame_message_filter.cc
 | |
| +++ content/browser/frame_host/render_frame_message_filter.cc
 | |
| @@ -626,6 +626,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
 | |
|  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,
 | |
| @@ -634,8 +635,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 5bd44e2d538d..11cd8b0f9237 100644
 | |
| --- content/browser/frame_host/render_frame_message_filter.h
 | |
| +++ content/browser/frame_host/render_frame_message_filter.h
 | |
| @@ -143,6 +143,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter
 | |
|  #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
 | |
| index 89e2c5351c45..616129b0bbfb 100644
 | |
| --- content/browser/loader/mime_sniffing_resource_handler.cc
 | |
| +++ content/browser/loader/mime_sniffing_resource_handler.cc
 | |
| @@ -502,8 +502,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, nullptr);
 | |
| +      request()->url(), info->IsMainFrame(), url::Origin(),
 | |
| +      response_->head.mime_type, allow_wildcard, &stale, &plugin, nullptr);
 | |
|  
 | |
|    if (stale) {
 | |
|      // Refresh the plugins asynchronously.
 | |
| diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
 | |
| index e4e5a87af7e6..5d6f51c49829 100644
 | |
| --- content/browser/plugin_service_impl.cc
 | |
| +++ content/browser/plugin_service_impl.cc
 | |
| @@ -286,6 +286,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,
 | |
| @@ -302,7 +303,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 4e11056a3dc9..973ad50975e1 100644
 | |
| --- content/browser/plugin_service_impl.h
 | |
| +++ content/browser/plugin_service_impl.h
 | |
| @@ -65,6 +65,7 @@ class CONTENT_EXPORT PluginServiceImpl : 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/browser/renderer_host/plugin_registry_impl.cc content/browser/renderer_host/plugin_registry_impl.cc
 | |
| index ec071f3b89c1..bfd71fbbe18d 100644
 | |
| --- content/browser/renderer_host/plugin_registry_impl.cc
 | |
| +++ content/browser/renderer_host/plugin_registry_impl.cc
 | |
| @@ -24,6 +24,7 @@ void PluginRegistryImpl::Bind(blink::mojom::PluginRegistryRequest request) {
 | |
|  }
 | |
|  
 | |
|  void PluginRegistryImpl::GetPlugins(bool refresh,
 | |
| +                                    bool is_main_frame,
 | |
|                                      const url::Origin& main_frame_origin,
 | |
|                                      GetPluginsCallback callback) {
 | |
|    auto* plugin_service = PluginServiceImpl::GetInstance();
 | |
| @@ -45,17 +46,18 @@ void PluginRegistryImpl::GetPlugins(bool refresh,
 | |
|  
 | |
|    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.
 | |
| @@ -64,7 +66,7 @@ void PluginRegistryImpl::GetPluginsComplete(
 | |
|      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_;
 | |
|  };
 | |
|  
 | |
| diff --git content/common/frame_messages.h content/common/frame_messages.h
 | |
| index 0162c2dda0f8..a5e412d2ae9c 100644
 | |
| --- content/common/frame_messages.h
 | |
| +++ content/common/frame_messages.h
 | |
| @@ -1369,9 +1369,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
 | |
|  // 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
 | |
| index 27021d64244d..60f1ec1845d9 100644
 | |
| --- content/public/browser/plugin_service.h
 | |
| +++ content/public/browser/plugin_service.h
 | |
| @@ -73,6 +73,7 @@ class CONTENT_EXPORT 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 3b610b1f554e..7c439e060779 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/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
 | |
| index a2dc7a811e75..416918123564 100644
 | |
| --- content/public/renderer/content_renderer_client.h
 | |
| +++ content/public/renderer/content_renderer_client.h
 | |
| @@ -74,6 +74,9 @@ class CONTENT_EXPORT ContentRendererClient {
 | |
|    // Notifies us that the RenderThread has been created.
 | |
|    virtual void RenderThreadStarted() {}
 | |
|  
 | |
| +  // Notifies that the RenderThread can now send sync IPC messages.
 | |
| +  virtual void RenderThreadConnected() {}
 | |
| +
 | |
|    // Notifies that a new RenderFrame has been created.
 | |
|    virtual void RenderFrameCreated(RenderFrame* render_frame) {}
 | |
|  
 | |
| @@ -348,6 +351,10 @@ class CONTENT_EXPORT ContentRendererClient {
 | |
|    // This method may invalidate the frame.
 | |
|    virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
 | |
|  
 | |
| +  // Notifies that a DevTools agent has attached or detached.
 | |
| +  virtual void DevToolsAgentAttached() {}
 | |
| +  virtual void DevToolsAgentDetached() {}
 | |
| +
 | |
|    // Allows subclasses to enable some runtime features before Blink has
 | |
|    // started.
 | |
|    virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
 | |
| diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
 | |
| index d52332ffb915..465ae32696e4 100644
 | |
| --- content/public/renderer/render_frame_observer.h
 | |
| +++ content/public/renderer/render_frame_observer.h
 | |
| @@ -146,6 +146,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
 | |
|    virtual void DidReceiveTransferSizeUpdate(int resource_id,
 | |
|                                              int received_data_length) {}
 | |
|  
 | |
| +  // Called when this frame gains focus.
 | |
| +  virtual void FrameFocused() {}
 | |
| +
 | |
|    // Called when the focused node has changed to |node|.
 | |
|    virtual void FocusedNodeChanged(const blink::WebNode& node) {}
 | |
|  
 | |
| diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
 | |
| index 309f4739a93e..757c2daa169c 100644
 | |
| --- content/renderer/render_frame_impl.cc
 | |
| +++ content/renderer/render_frame_impl.cc
 | |
| @@ -3369,7 +3369,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.mime_type.Utf8(), &found, &info, &mime_type));
 | |
|    if (!found)
 | |
|      return nullptr;
 | |
| @@ -3734,6 +3735,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
 | |
|  
 | |
|  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
 | |
| index 578c20c0775b..5ccee1e18384 100644
 | |
| --- content/renderer/render_thread_impl.cc
 | |
| +++ content/renderer/render_thread_impl.cc
 | |
| @@ -865,6 +865,8 @@ void RenderThreadImpl::Init(
 | |
|  
 | |
|    StartServiceManagerConnection();
 | |
|  
 | |
| +  GetContentClient()->renderer()->RenderThreadConnected();
 | |
| +
 | |
|    GetAssociatedInterfaceRegistry()->AddInterface(
 | |
|        base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest,
 | |
|                   base::Unretained(this)));
 | |
| diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
 | |
| index e3c8199020c6..662c9b7d02e8 100644
 | |
| --- content/renderer/renderer_blink_platform_impl.cc
 | |
| +++ content/renderer/renderer_blink_platform_impl.cc
 | |
| @@ -1121,6 +1121,14 @@ void RendererBlinkPlatformImpl::RequestPurgeMemory() {
 | |
|    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(
 | |
| diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
 | |
| index 7d3a3edeb724..2b3d8cc01a63 100644
 | |
| --- content/renderer/renderer_blink_platform_impl.h
 | |
| +++ content/renderer/renderer_blink_platform_impl.h
 | |
| @@ -233,6 +233,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
 | |
|        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).
 | |
| diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc
 | |
| index 3a48c59b7e3e..d10ef64adbba 100644
 | |
| --- content/shell/browser/shell_plugin_service_filter.cc
 | |
| +++ content/shell/browser/shell_plugin_service_filter.cc
 | |
| @@ -18,6 +18,7 @@ bool ShellPluginServiceFilter::IsPluginAvailable(
 | |
|      int render_frame_id,
 | |
|      const void* context,
 | |
|      const GURL& url,
 | |
| +    bool is_main_frame,
 | |
|      const url::Origin& main_frame_origin,
 | |
|      WebPluginInfo* plugin) {
 | |
|    return plugin->name == base::ASCIIToUTF16("Blink Test Plugin") ||
 | |
| diff --git content/shell/browser/shell_plugin_service_filter.h content/shell/browser/shell_plugin_service_filter.h
 | |
| index 7767a620a9fd..8a95377f5f3b 100644
 | |
| --- content/shell/browser/shell_plugin_service_filter.h
 | |
| +++ content/shell/browser/shell_plugin_service_filter.h
 | |
| @@ -21,6 +21,7 @@ class ShellPluginServiceFilter : public PluginServiceFilter {
 | |
|                           int render_frame_id,
 | |
|                           const void* context,
 | |
|                           const GURL& url,
 | |
| +                         bool is_main_frame,
 | |
|                           const url::Origin& main_frame_origin,
 | |
|                           WebPluginInfo* plugin) override;
 | |
|  
 | |
| diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc
 | |
| index dfc1e111ac10..23106007a32e 100644
 | |
| --- content/test/fake_plugin_service.cc
 | |
| +++ content/test/fake_plugin_service.cc
 | |
| @@ -29,6 +29,7 @@ bool FakePluginService::GetPluginInfo(int render_process_id,
 | |
|                                        int render_frame_id,
 | |
|                                        ResourceContext* context,
 | |
|                                        const GURL& url,
 | |
| +                                      bool is_main_frame,
 | |
|                                        const url::Origin& main_frame_origin,
 | |
|                                        const std::string& mime_type,
 | |
|                                        bool allow_wildcard,
 | |
| diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h
 | |
| index 84bed37848d9..1a66c0757437 100644
 | |
| --- content/test/fake_plugin_service.h
 | |
| +++ content/test/fake_plugin_service.h
 | |
| @@ -30,6 +30,7 @@ class FakePluginService : public PluginService {
 | |
|                       int render_frame_id,
 | |
|                       ResourceContext* context,
 | |
|                       const GURL& url,
 | |
| +                     bool is_main_frame,
 | |
|                       const url::Origin& main_frame_origin,
 | |
|                       const std::string& mime_type,
 | |
|                       bool allow_wildcard,
 |