diff options
author | horo@chromium.org <horo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-16 08:33:51 +0000 |
---|---|---|
committer | horo@chromium.org <horo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-16 08:35:23 +0000 |
commit | 23935931099331549af21fdb4d3cb942d473537c (patch) | |
tree | 96f33beca9125657120538ea74e98619e355172b | |
parent | db681ab00427e68df6ac524e711e6d13f7efff6f (diff) | |
download | chromium_src-23935931099331549af21fdb4d3cb942d473537c.zip chromium_src-23935931099331549af21fdb4d3cb942d473537c.tar.gz chromium_src-23935931099331549af21fdb4d3cb942d473537c.tar.bz2 |
Remove worker process related codes from ContentBrowserClient.
BUG=327256
Review URL: https://codereview.chromium.org/468033002
Cr-Commit-Position: refs/heads/master@{#290139}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290139 0039d316-1c4b-4281-b951-d872f2087c98
12 files changed, 0 insertions, 140 deletions
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 5956111..4f44dd3 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc @@ -503,13 +503,6 @@ bool AwContentBrowserClient::CanCreateWindow( return true; } -std::string AwContentBrowserClient::GetWorkerProcessTitle(const GURL& url, - content::ResourceContext* context) { - NOTREACHED() << "Android WebView does not yet support web workers."; - return std::string(); -} - - void AwContentBrowserClient::ResourceDispatcherHostCreated() { AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); } diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h index 637b211..a292de1 100644 --- a/android_webview/browser/aw_content_browser_client.h +++ b/android_webview/browser/aw_content_browser_client.h @@ -152,9 +152,6 @@ class AwContentBrowserClient : public content::ContentBrowserClient { int render_process_id, int opener_id, bool* no_javascript_access) OVERRIDE; - virtual std::string GetWorkerProcessTitle( - const GURL& url, - content::ResourceContext* context) OVERRIDE; virtual void ResourceDispatcherHostCreated() OVERRIDE; virtual net::NetLog* GetNetLog() OVERRIDE; virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 17b99db..d81d481 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -1111,20 +1111,6 @@ void ChromeContentBrowserClient::SiteInstanceDeleting( extra_parts_[i]->SiteInstanceDeleting(site_instance); } -void ChromeContentBrowserClient::WorkerProcessCreated( - SiteInstance* site_instance, - int worker_process_id) { - for (size_t i = 0; i < extra_parts_.size(); ++i) - extra_parts_[i]->WorkerProcessCreated(site_instance, worker_process_id); -} - -void ChromeContentBrowserClient::WorkerProcessTerminated( - SiteInstance* site_instance, - int worker_process_id) { - for (size_t i = 0; i < extra_parts_.size(); ++i) - extra_parts_[i]->WorkerProcessTerminated(site_instance, worker_process_id); -} - bool ChromeContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation( SiteInstance* site_instance, const GURL& current_url, @@ -2086,17 +2072,6 @@ bool ChromeContentBrowserClient::CanCreateWindow( return true; } -std::string ChromeContentBrowserClient::GetWorkerProcessTitle( - const GURL& url, content::ResourceContext* context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); -#if defined(ENABLE_EXTENSIONS) - return ChromeContentBrowserClientExtensionsPart::GetWorkerProcessTitle( - url, context); -#else - return std::string(); -#endif -} - void ChromeContentBrowserClient::ResourceDispatcherHostCreated() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); prerender_tracker_ = g_browser_process->prerender_tracker(); diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 63249dc..1d76dc8 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -103,10 +103,6 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { content::SiteInstance* site_instance) OVERRIDE; virtual void SiteInstanceDeleting(content::SiteInstance* site_instance) OVERRIDE; - virtual void WorkerProcessCreated(content::SiteInstance* site_instance, - int worker_process_id) OVERRIDE; - virtual void WorkerProcessTerminated(content::SiteInstance* site_instance, - int worker_process_id) OVERRIDE; virtual bool ShouldSwapBrowsingInstancesForNavigation( content::SiteInstance* site_instance, const GURL& current_url, @@ -237,8 +233,6 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { int render_process_id, int opener_id, bool* no_javascript_access) OVERRIDE; - virtual std::string GetWorkerProcessTitle( - const GURL& url, content::ResourceContext* context) OVERRIDE; virtual void ResourceDispatcherHostCreated() OVERRIDE; virtual content::SpeechRecognitionManagerDelegate* GetSpeechRecognitionManagerDelegate() OVERRIDE; diff --git a/chrome/browser/chrome_content_browser_client_parts.h b/chrome/browser/chrome_content_browser_client_parts.h index 9ec65c6..def457f 100644 --- a/chrome/browser/chrome_content_browser_client_parts.h +++ b/chrome/browser/chrome_content_browser_client_parts.h @@ -42,10 +42,6 @@ class ChromeContentBrowserClientParts { virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) {} virtual void SiteInstanceGotProcess(content::SiteInstance* site_instance) {} virtual void SiteInstanceDeleting(content::SiteInstance* site_instance) {} - virtual void WorkerProcessCreated(content::SiteInstance* site_instance, - int worker_process_id) {} - virtual void WorkerProcessTerminated(content::SiteInstance* site_instance, - int worker_process_id) {} virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh, const GURL& url, content::WebPreferences* web_prefs) {} diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc index 9e6b95c..e947032 100644 --- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc +++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc @@ -335,17 +335,6 @@ bool ChromeContentBrowserClientExtensionsPart::ShouldSwapProcessesForRedirect( } // static -std::string ChromeContentBrowserClientExtensionsPart::GetWorkerProcessTitle( - const GURL& url, content::ResourceContext* context) { - // Check if it's an extension-created worker, in which case we want to use - // the name of the extension. - ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); - const Extension* extension = - io_data->GetExtensionInfoMap()->extensions().GetByID(url.host()); - return extension ? extension->name() : std::string(); -} - -// static bool ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL( content::SiteInstance* site_instance, const GURL& from_url, @@ -466,33 +455,6 @@ void ChromeContentBrowserClientExtensionsPart::SiteInstanceDeleting( site_instance->GetId())); } -void ChromeContentBrowserClientExtensionsPart::WorkerProcessCreated( - SiteInstance* site_instance, - int worker_process_id) { - ExtensionRegistry* extension_registry = - ExtensionRegistry::Get(site_instance->GetBrowserContext()); - if (!extension_registry) - return; - const Extension* extension = - extension_registry->enabled_extensions().GetExtensionOrAppByURL( - site_instance->GetSiteURL()); - if (!extension) - return; - ExtensionSystem* extension_system = - ExtensionSystem::Get(site_instance->GetBrowserContext()); - extension_system->info_map()->RegisterExtensionWorkerProcess( - extension->id(), worker_process_id, site_instance->GetId()); -} - -void ChromeContentBrowserClientExtensionsPart::WorkerProcessTerminated( - SiteInstance* site_instance, - int worker_process_id) { - ExtensionSystem* extension_system = - ExtensionSystem::Get(site_instance->GetBrowserContext()); - extension_system->info_map()->UnregisterExtensionWorkerProcess( - worker_process_id); -} - void ChromeContentBrowserClientExtensionsPart::OverrideWebkitPrefs( RenderViewHost* rvh, const GURL& url, diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h index 2c0a12f..2200a39 100644 --- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h +++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h @@ -43,8 +43,6 @@ class ChromeContentBrowserClientExtensionsPart content::ResourceContext* resource_context, const GURL& current_url, const GURL& new_url); - static std::string GetWorkerProcessTitle(const GURL& url, - content::ResourceContext* context); // Similiar to ChromeContentBrowserClient::ShouldAllowOpenURL(), but the // return value indicates whether to use |result| or not. @@ -64,10 +62,6 @@ class ChromeContentBrowserClientExtensionsPart content::SiteInstance* site_instance) OVERRIDE; virtual void SiteInstanceDeleting( content::SiteInstance* site_instance) OVERRIDE; - virtual void WorkerProcessCreated(content::SiteInstance* site_instance, - int worker_process_id) OVERRIDE; - virtual void WorkerProcessTerminated(content::SiteInstance* site_instance, - int worker_process_id) OVERRIDE; virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh, const GURL& url, content::WebPreferences* web_prefs) OVERRIDE; diff --git a/chrome/browser/extensions/url_request_util.cc b/chrome/browser/extensions/url_request_util.cc index f0c2d09..3f63e6b 100644 --- a/chrome/browser/extensions/url_request_util.cc +++ b/chrome/browser/extensions/url_request_util.cc @@ -140,12 +140,6 @@ bool AllowCrossRendererResourceLoad(net::URLRequest* request, const content::ResourceRequestInfo* info = content::ResourceRequestInfo::ForRequest(request); - // Check workers so that importScripts works from extension workers. - if (extension_info_map->worker_process_map().Contains(request->url().host(), - info->GetChildID())) { - return true; - } - bool is_guest = false; // Extensions with webview: allow loading certain resources by guest renderers diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index 7802b85..d982b69 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc @@ -259,11 +259,6 @@ bool ContentBrowserClient::CanCreateWindow( return true; } -std::string ContentBrowserClient::GetWorkerProcessTitle( - const GURL& url, ResourceContext* context) { - return std::string(); -} - SpeechRecognitionManagerDelegate* ContentBrowserClient::GetSpeechRecognitionManagerDelegate() { return NULL; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 8de36c1..c63fd00 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -226,14 +226,6 @@ class CONTENT_EXPORT ContentBrowserClient { // Called from a site instance's destructor. virtual void SiteInstanceDeleting(SiteInstance* site_instance) {} - // Called when a worker process is created. - virtual void WorkerProcessCreated(SiteInstance* site_instance, - int worker_process_id) {} - - // Called when a worker process is terminated. - virtual void WorkerProcessTerminated(SiteInstance* site_instance, - int worker_process_id) {} - // Returns true if for the navigation from |current_url| to |new_url| // in |site_instance|, a new SiteInstance and BrowsingInstance should be // created (even if we are in a process model that doesn't usually swap.) @@ -499,12 +491,6 @@ class CONTENT_EXPORT ContentBrowserClient { int opener_id, bool* no_javascript_access); - // Returns a title string to use in the task manager for a process host with - // the given URL, or the empty string to fall back to the default logic. - // This is called on the IO thread. - virtual std::string GetWorkerProcessTitle(const GURL& url, - ResourceContext* context); - // Notifies the embedder that the ResourceDispatcherHost has been created. // This is when it can optionally add a delegate. virtual void ResourceDispatcherHostCreated() {} diff --git a/extensions/browser/info_map.cc b/extensions/browser/info_map.cc index ced52c9..101f35b 100644 --- a/extensions/browser/info_map.cc +++ b/extensions/browser/info_map.cc @@ -129,19 +129,6 @@ void InfoMap::UnregisterAllExtensionsInProcess(int process_id) { process_map_.RemoveAllFromProcess(process_id); } -void InfoMap::RegisterExtensionWorkerProcess(const std::string& extension_id, - int process_id, - int site_instance_id) { - if (!worker_process_map_.Insert(extension_id, process_id, site_instance_id)) { - NOTREACHED() << "Duplicate extension worker process registration for: " - << extension_id << "," << process_id << "."; - } -} - -void InfoMap::UnregisterExtensionWorkerProcess(int process_id) { - worker_process_map_.RemoveAllFromProcess(process_id); -} - void InfoMap::GetExtensionsWithAPIPermissionForSecurityOrigin( const GURL& origin, int process_id, diff --git a/extensions/browser/info_map.h b/extensions/browser/info_map.h index 7c4267c..01597e7 100644 --- a/extensions/browser/info_map.h +++ b/extensions/browser/info_map.h @@ -38,8 +38,6 @@ class InfoMap : public base::RefCountedThreadSafe<InfoMap> { // Information about which extensions are assigned to which render processes. const ProcessMap& process_map() const { return process_map_; } - // Information about which extensions are assigned to which worker processes. - const ProcessMap& worker_process_map() const { return worker_process_map_; } // Callback for when new extensions are loaded. void AddExtension(const extensions::Extension* extension, @@ -73,14 +71,6 @@ class InfoMap : public base::RefCountedThreadSafe<InfoMap> { int site_instance_id); void UnregisterAllExtensionsInProcess(int process_id); - // Adds an entry to worker_process_map_. - void RegisterExtensionWorkerProcess(const std::string& extension_id, - int process_id, - int site_instance_id); - - // Removes an entry from worker_process_map_. - void UnregisterExtensionWorkerProcess(int process_id); - // Returns the subset of extensions which has the same |origin| in // |process_id| with the specified |permission|. void GetExtensionsWithAPIPermissionForSecurityOrigin( @@ -143,9 +133,6 @@ class InfoMap : public base::RefCountedThreadSafe<InfoMap> { // Assignment of extensions to renderer processes. extensions::ProcessMap process_map_; - // Assignment of extensions to worker processes. - extensions::ProcessMap worker_process_map_; - int signin_process_id_; scoped_refptr<ContentVerifier> content_verifier_; |