diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 20:56:05 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 20:56:05 +0000 |
commit | 481e1a439c0cb4272746873c3244f8a42c72c94e (patch) | |
tree | 062e63aab572711337d89817901585dfb176f8ed | |
parent | da942ea95144401b73956ae64f59157a7fcb23e9 (diff) | |
download | chromium_src-481e1a439c0cb4272746873c3244f8a42c72c94e.zip chromium_src-481e1a439c0cb4272746873c3244f8a42c72c94e.tar.gz chromium_src-481e1a439c0cb4272746873c3244f8a42c72c94e.tar.bz2 |
Resurrect ExtensionProcessManager. Move the code for starting extension
instances from ExtensionsService to the manager.
Unlike ExtensionsService, EPM is not shared between an incognito Profile and
its parent.
Review URL: http://codereview.chromium.org/109044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15454 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.vcproj | 8 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_process_manager.cc | 71 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_process_manager.h | 59 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_process_manager_unittest.cc | 61 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_shelf.cc | 6 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_view_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 37 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.h | 25 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service_unittest.cc | 37 | ||||
-rw-r--r-- | chrome/browser/profile.cc | 18 | ||||
-rw-r--r-- | chrome/browser/profile.h | 8 | ||||
-rw-r--r-- | chrome/chrome.gyp | 3 | ||||
-rw-r--r-- | chrome/test/testing_profile.h | 3 | ||||
-rw-r--r-- | chrome/test/unit/unittests.vcproj | 4 |
14 files changed, 242 insertions, 102 deletions
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index ad51e70..997fdc0 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -1982,6 +1982,14 @@ > </File> <File + RelativePath=".\extensions\extension_process_manager.cc" + > + </File> + <File + RelativePath=".\extensions\extension_process_manager.h" + > + </File> + <File RelativePath=".\extensions\extension_protocols.cc" > </File> diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc new file mode 100644 index 0000000..79b2e0f --- /dev/null +++ b/chrome/browser/extensions/extension_process_manager.cc @@ -0,0 +1,71 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/extension_process_manager.h" + +#include "chrome/browser/browsing_instance.h" +#include "chrome/browser/extensions/extension.h" +#include "chrome/browser/extensions/extension_host.h" +#include "chrome/browser/extensions/extension_view.h" +#include "chrome/browser/extensions/extensions_service.h" +#include "chrome/browser/profile.h" +#include "chrome/browser/tab_contents/site_instance.h" +#include "chrome/common/notification_service.h" + +static void CreateBackgroundHosts( + ExtensionProcessManager* manager, const ExtensionList* extensions) { + for (ExtensionList::const_iterator extension = extensions->begin(); + extension != extensions->end(); ++extension) { + // Start the process for the master page, if it exists. + if ((*extension)->background_url().is_valid()) { + manager->CreateBackgroundHost(*extension, (*extension)->background_url()); + } + } +} + +ExtensionProcessManager::ExtensionProcessManager(Profile* profile) + : browsing_instance_(new BrowsingInstance(profile)) { + // TODO: register notification, and load any hosts for existing exts. + NotificationService::current()->AddObserver(this, + NotificationType::EXTENSIONS_LOADED, + NotificationService::AllSources()); + + if (profile->GetExtensionsService()) { + CreateBackgroundHosts(this, profile->GetExtensionsService()->extensions()); + } +} + +ExtensionProcessManager::~ExtensionProcessManager() { + for (ExtensionHostList::iterator iter = background_hosts_.begin(); + iter != background_hosts_.end(); ++iter) { + delete *iter; + } +} + +ExtensionView* ExtensionProcessManager::CreateView(Extension* extension, + const GURL& url, + Browser* browser) { + return new ExtensionView( + new ExtensionHost(extension, GetSiteInstanceForURL(url)), browser, url); +} + +void ExtensionProcessManager::CreateBackgroundHost(Extension* extension, + const GURL& url) { + ExtensionHost* host = + new ExtensionHost(extension, GetSiteInstanceForURL(url)); + host->CreateRenderView(url, NULL); // create a RenderViewHost with no view + background_hosts_.push_back(host); +} + +SiteInstance* ExtensionProcessManager::GetSiteInstanceForURL(const GURL& url) { + return browsing_instance_->GetSiteInstanceForURL(url); +} + +void ExtensionProcessManager::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { + DCHECK(type == NotificationType::EXTENSIONS_LOADED); + const ExtensionList* extensions = Details<ExtensionList>(details).ptr(); + CreateBackgroundHosts(this, extensions); +} diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h new file mode 100644 index 0000000..73be45d --- /dev/null +++ b/chrome/browser/extensions/extension_process_manager.h @@ -0,0 +1,59 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ + +#include <list> + +#include "base/ref_counted.h" +#include "chrome/common/notification_observer.h" + +class Browser; +class BrowsingInstance; +class Extension; +class ExtensionHost; +class ExtensionView; +class GURL; +class Profile; +class SiteInstance; + +// Manages dynamic state of running Chromium extensions. There is one instance +// of this class per Profile (including OTR). +class ExtensionProcessManager : public NotificationObserver { + public: + ExtensionProcessManager(Profile* profile); + ~ExtensionProcessManager(); + + // Creates a new ExtensionView, grouping it in the appropriate SiteInstance + // (and therefore process) based on the URL and profile. + ExtensionView* CreateView(Extension* extension, + const GURL& url, + Browser* browser); + + // Creates a new UI-less extension instance. Like CreateView, but not + // displayed anywhere. + void CreateBackgroundHost(Extension* extension, const GURL& url); + + // Returns the SiteInstance that the given URL belongs to. + SiteInstance* GetSiteInstanceForURL(const GURL& url); + + // NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + private: + // The list of running viewless background extensions. + typedef std::list<ExtensionHost*> ExtensionHostList; + ExtensionHostList background_hosts_; + + // The BrowsingInstance shared by all extensions in this profile. This + // controls process grouping. + scoped_refptr<BrowsingInstance> browsing_instance_; + + DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); +}; + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ diff --git a/chrome/browser/extensions/extension_process_manager_unittest.cc b/chrome/browser/extensions/extension_process_manager_unittest.cc new file mode 100644 index 0000000..a72ac26 --- /dev/null +++ b/chrome/browser/extensions/extension_process_manager_unittest.cc @@ -0,0 +1,61 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/extension_error_reporter.h" +#include "chrome/browser/extensions/extension_process_manager.h" +#include "chrome/browser/tab_contents/site_instance.h" +#include "chrome/test/testing_profile.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "testing/platform_test.h" + +namespace { + +// make the test a PlatformTest to setup autorelease pools properly on mac +class ExtensionProcessManagerTest : public testing::Test { + public: + static void SetUpTestCase() { + ExtensionErrorReporter::Init(false); // no noisy errors + } + + virtual void SetUp() { + ExtensionErrorReporter::GetInstance()->ClearErrors(); + } +}; + +} + +// Test that extensions get grouped in the right SiteInstance (and therefore +// process) based on their URLs. +TEST_F(ExtensionProcessManagerTest, ProcessGrouping) { + // Extensions in different profiles should always be different SiteInstances. + // Note: we don't initialize these, since we're not testing that + // functionality. This means we can get away with a NULL UserScriptMaster. + TestingProfile profile1(1); + scoped_ptr<ExtensionProcessManager> manager1( + new ExtensionProcessManager(&profile1)); + + TestingProfile profile2(2); + scoped_ptr<ExtensionProcessManager> manager2( + new ExtensionProcessManager(&profile2)); + + // Extensions with common origins ("scheme://id/") should be grouped in the + // same SiteInstance. + GURL ext1_url1("chrome-extensions://ext1_id/index.html"); + GURL ext1_url2("chrome-extensions://ext1_id/toolstrips/toolstrip.html"); + GURL ext2_url1("chrome-extensions://ext2_id/index.html"); + + scoped_refptr<SiteInstance> site11 = + manager1->GetSiteInstanceForURL(ext1_url1); + scoped_refptr<SiteInstance> site12 = + manager1->GetSiteInstanceForURL(ext1_url2); + EXPECT_EQ(site11, site12); + + scoped_refptr<SiteInstance> site21 = + manager1->GetSiteInstanceForURL(ext2_url1); + EXPECT_NE(site11, site21); + + scoped_refptr<SiteInstance> other_profile_site = + manager2->GetSiteInstanceForURL(ext1_url1); + EXPECT_NE(site11, other_profile_site); +} diff --git a/chrome/browser/extensions/extension_shelf.cc b/chrome/browser/extensions/extension_shelf.cc index 1668252..f32d9a7 100644 --- a/chrome/browser/extensions/extension_shelf.cc +++ b/chrome/browser/extensions/extension_shelf.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "chrome/browser/browser.h" #include "chrome/browser/extensions/extension.h" +#include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extension_view.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/profile.h" @@ -150,14 +151,15 @@ void ExtensionShelf::Observe(NotificationType type, bool ExtensionShelf::AddExtensionViews(const ExtensionList* extensions) { bool added_toolstrip = false; - ExtensionsService* service = browser_->profile()->GetExtensionsService(); + ExtensionProcessManager* manager = + browser_->profile()->GetExtensionProcessManager(); for (ExtensionList::const_iterator extension = extensions->begin(); extension != extensions->end(); ++extension) { for (std::vector<std::string>::const_iterator toolstrip_path = (*extension)->toolstrips().begin(); toolstrip_path != (*extension)->toolstrips().end(); ++toolstrip_path) { ExtensionView* toolstrip = - service->CreateView(*extension, + manager->CreateView(*extension, (*extension)->GetResourceURL(*toolstrip_path), browser_); if (!background_.empty()) diff --git a/chrome/browser/extensions/extension_view_unittest.cc b/chrome/browser/extensions/extension_view_unittest.cc index ca1643a..0efffa5 100755 --- a/chrome/browser/extensions/extension_view_unittest.cc +++ b/chrome/browser/extensions/extension_view_unittest.cc @@ -8,6 +8,7 @@ #include "chrome/browser/extensions/extension_shelf.h" #include "chrome/browser/extensions/extension_error_reporter.h" #include "chrome/browser/extensions/extension_host.h" +#include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/test_extension_loader.h" #include "chrome/browser/tab_contents/site_instance.h" @@ -103,7 +104,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionViewTest, Index) { // Start the extension process and wait for it to show a javascript alert. MockExtensionHost host(extension, url, - browser()->profile()->GetExtensionsService()->GetSiteInstanceForURL(url)); + browser()->profile()->GetExtensionProcessManager()-> + GetSiteInstanceForURL(url)); EXPECT_TRUE(host.got_message()); } diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 0af48343..da5db0f1 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -16,16 +16,13 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/browsing_instance.h" #include "chrome/browser/extensions/extension.h" #include "chrome/browser/extensions/extension_browser_event_router.h" #include "chrome/browser/extensions/extension_error_reporter.h" -#include "chrome/browser/extensions/extension_host.h" -#include "chrome/browser/extensions/extension_view.h" +#include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/user_script_master.h" #include "chrome/browser/plugin_service.h" #include "chrome/browser/profile.h" -#include "chrome/browser/tab_contents/site_instance.h" #include "chrome/common/json_value_serializer.h" #include "chrome/common/notification_service.h" #include "chrome/common/unzip.h" @@ -81,16 +78,10 @@ ExtensionsService::ExtensionsService(Profile* profile, : message_loop_(MessageLoop::current()), install_directory_(profile->GetPath().AppendASCII(kInstallDirectoryName)), backend_(new ExtensionsServiceBackend(install_directory_)), - user_script_master_(user_script_master), - browsing_instance_(new BrowsingInstance(profile)) { + user_script_master_(user_script_master) { } ExtensionsService::~ExtensionsService() { - for (ExtensionHostList::iterator iter = background_hosts_.begin(); - iter != background_hosts_.end(); ++iter) { - delete *iter; - } - for (ExtensionList::iterator iter = extensions_.begin(); iter != extensions_.end(); ++iter) { delete *iter; @@ -172,11 +163,6 @@ void ExtensionsService::OnExtensionsLoaded(ExtensionList* new_extensions) { script != scripts.end(); ++script) { user_script_master_->AddLoneScript(*script); } - - // Start the process for the master page, if it exists. - if ((*extension)->background_url().is_valid()) { - CreateBackgroundHost(*extension, (*extension)->background_url()); - } } // Since user scripts may have changed, tell UserScriptMaster to kick off @@ -208,25 +194,6 @@ Extension* ExtensionsService::GetExtensionByID(std::string id) { return NULL; } -ExtensionView* ExtensionsService::CreateView(Extension* extension, - const GURL& url, - Browser* browser) { - return new ExtensionView( - new ExtensionHost(extension, GetSiteInstanceForURL(url)), browser, url); -} - -void ExtensionsService::CreateBackgroundHost(Extension* extension, - const GURL& url) { - ExtensionHost* host = - new ExtensionHost(extension, GetSiteInstanceForURL(url)); - host->CreateRenderView(url, NULL); // create a RenderViewHost with no view - background_hosts_.push_back(host); -} - -SiteInstance* ExtensionsService::GetSiteInstanceForURL(const GURL& url) { - return browsing_instance_->GetSiteInstanceForURL(url); -} - // ExtensionsServicesBackend diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h index 67c8c4e..9a83c99 100644 --- a/chrome/browser/extensions/extensions_service.h +++ b/chrome/browser/extensions/extensions_service.h @@ -7,7 +7,6 @@ #include <string> #include <vector> -#include <list> #include "base/file_path.h" #include "base/message_loop.h" @@ -16,10 +15,7 @@ #include "base/values.h" class Browser; -class BrowsingInstance; class Extension; -class ExtensionHost; -class ExtensionView; class ExtensionsServiceBackend; class GURL; class Profile; @@ -82,19 +78,6 @@ class ExtensionsService : public ExtensionsServiceFrontendInterface { virtual void OnExtensionInstalled(Extension* extension, bool is_update); virtual Extension* GetExtensionByID(std::string id); - // Creates a new ExtensionView, grouping it in the appropriate SiteInstance - // (and therefore process) based on the URL and profile. - ExtensionView* CreateView(Extension* extension, - const GURL& url, - Browser* browser); - - // Creates a new UI-less extension instance. Like CreateView, but not - // displayed anywhere. - void CreateBackgroundHost(Extension* extension, const GURL& url); - - // Returns the SiteInstance that the given URL belongs to. - SiteInstance* GetSiteInstanceForURL(const GURL& url); - // The name of the file that the current active version number is stored in. static const char* kCurrentVersionFileName; @@ -118,14 +101,6 @@ class ExtensionsService : public ExtensionsServiceFrontendInterface { // The user script master for this profile. scoped_refptr<UserScriptMaster> user_script_master_; - // The BrowsingInstance shared by all extensions in this profile. This - // controls process grouping. - scoped_refptr<BrowsingInstance> browsing_instance_; - - // The list of running viewless background extensions. - typedef std::list<ExtensionHost*> ExtensionHostList; - ExtensionHostList background_hosts_; - DISALLOW_COPY_AND_ASSIGN(ExtensionsService); }; diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc index 6e1e614..e6c27df 100644 --- a/chrome/browser/extensions/extensions_service_unittest.cc +++ b/chrome/browser/extensions/extensions_service_unittest.cc @@ -14,11 +14,9 @@ #include "chrome/browser/extensions/extension.h" #include "chrome/browser/extensions/extension_error_reporter.h" #include "chrome/browser/extensions/extensions_service.h" -#include "chrome/browser/tab_contents/site_instance.h" #include "chrome/common/extensions/url_pattern.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/json_value_serializer.h" -#include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -358,38 +356,3 @@ TEST_F(ExtensionsServiceTest, GenerateID) { ASSERT_EQ("chrome-extension://0000000000000000000000000000000000000001/", frontend->extensions()->at(1)->url().spec()); } - -// Test that extensions get grouped in the right SiteInstance (and therefore -// process) based on their URLs. -TEST_F(ExtensionsServiceTest, ProcessGrouping) { - // Extensions in different profiles should always be different SiteInstances. - // Note: we don't initialize these, since we're not testing that - // functionality. This means we can get away with a NULL UserScriptMaster. - TestingProfile profile1(1); - scoped_refptr<ExtensionsService> frontend1( - new ExtensionsService(&profile1, NULL)); - - TestingProfile profile2(2); - scoped_refptr<ExtensionsService> frontend2( - new ExtensionsService(&profile2, NULL)); - - // Extensions with common origins ("scheme://id/") should be grouped in the - // same SiteInstance. - GURL ext1_url1("chrome-extensions://ext1_id/index.html"); - GURL ext1_url2("chrome-extensions://ext1_id/toolstrips/toolstrip.html"); - GURL ext2_url1("chrome-extensions://ext2_id/index.html"); - - scoped_refptr<SiteInstance> site11 = - frontend1->GetSiteInstanceForURL(ext1_url1); - scoped_refptr<SiteInstance> site12 = - frontend1->GetSiteInstanceForURL(ext1_url2); - EXPECT_EQ(site11, site12); - - scoped_refptr<SiteInstance> site21 = - frontend1->GetSiteInstanceForURL(ext2_url1); - EXPECT_NE(site11, site21); - - scoped_refptr<SiteInstance> other_profile_site = - frontend2->GetSiteInstanceForURL(ext1_url1); - EXPECT_NE(site11, other_profile_site); -} diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 2a95f9e..86f32b6 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -15,6 +15,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/extensions/extension_error_reporter.h" +#include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/user_script_master.h" #include "chrome/browser/history/history.h" @@ -87,6 +88,9 @@ class OffTheRecordProfileImpl : public Profile, start_time_(Time::Now()) { request_context_ = ChromeURLRequestContext::CreateOffTheRecord(this); request_context_->AddRef(); + + extension_process_manager_.reset(new ExtensionProcessManager(this)); + // Register for browser close notifications so we can detect when the last // off-the-record window is closed, in which case we can clean our states // (cookies, downloads...). @@ -145,6 +149,10 @@ class OffTheRecordProfileImpl : public Profile, return profile_->GetUserScriptMaster(); } + virtual ExtensionProcessManager* GetExtensionProcessManager() { + return extension_process_manager_.get(); + } + virtual SSLHostState* GetSSLHostState() { if (!ssl_host_state_.get()) ssl_host_state_.reset(new SSLHostState()); @@ -338,6 +346,9 @@ class OffTheRecordProfileImpl : public Profile, // the user visited while OTR. scoped_ptr<SSLHostState> ssl_host_state_; + // Extensions run in a different context in incognito mode. + scoped_ptr<ExtensionProcessManager> extension_process_manager_; + // Time we were started. Time start_time_; @@ -346,7 +357,6 @@ class OffTheRecordProfileImpl : public Profile, ProfileImpl::ProfileImpl(const FilePath& path) : path_(path), - off_the_record_(false), request_context_(NULL), media_request_context_(NULL), history_service_created_(false), @@ -361,6 +371,8 @@ ProfileImpl::ProfileImpl(const FilePath& path) TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, &ProfileImpl::EnsureSessionServiceCreated); + extension_process_manager_.reset(new ExtensionProcessManager(this)); + PrefService* prefs = GetPrefs(); prefs->AddPrefObserver(prefs::kSpellCheckDictionary, this); prefs->AddPrefObserver(prefs::kEnableSpellCheck, this); @@ -563,6 +575,10 @@ UserScriptMaster* ProfileImpl::GetUserScriptMaster() { return user_script_master_.get(); } +ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { + return extension_process_manager_.get(); +} + SSLHostState* ProfileImpl::GetSSLHostState() { if (!ssl_host_state_.get()) ssl_host_state_.reset(new SSLHostState()); diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 236d5cf..2a96277 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -22,6 +22,7 @@ class BookmarkModel; class ChromeURLRequestContext; class DownloadManager; +class ExtensionProcessManager; class ExtensionsService; class HistoryService; class NavigationController; @@ -114,6 +115,10 @@ class Profile { // that this method is called. virtual UserScriptMaster* GetUserScriptMaster() = 0; + // Retrieves a pointer to the ExtensionProcessManager associated with this + // profile. The instance is created at startup. + virtual ExtensionProcessManager* GetExtensionProcessManager() = 0; + // Retrieves a pointer to the SSLHostState associated with this profile. // The SSLHostState is lazily created the first time that this method is // called. @@ -277,6 +282,7 @@ class ProfileImpl : public Profile, virtual UserScriptMaster* GetUserScriptMaster(); virtual SSLHostState* GetSSLHostState(); virtual ExtensionsService* GetExtensionsService(); + virtual ExtensionProcessManager* GetExtensionProcessManager(); virtual HistoryService* GetHistoryService(ServiceAccessType sat); virtual WebDataService* GetWebDataService(ServiceAccessType sat); virtual PrefService* GetPrefs(); @@ -335,10 +341,10 @@ class ProfileImpl : public Profile, void InitializeSpellChecker(bool need_to_broadcast); FilePath path_; - bool off_the_record_; scoped_ptr<VisitedLinkMaster> visited_link_master_; scoped_refptr<ExtensionsService> extensions_service_; scoped_refptr<UserScriptMaster> user_script_master_; + scoped_ptr<ExtensionProcessManager> extension_process_manager_; scoped_ptr<SSLHostState> ssl_host_state_; scoped_ptr<PrefService> prefs_; scoped_ptr<TemplateURLFetcher> template_url_fetcher_; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index ea3765a..aa7e215 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -804,6 +804,8 @@ 'browser/extensions/extension_browser_event_router.h', 'browser/extensions/extension_page_actions_module.h', 'browser/extensions/extension_page_actions_module.cc', + 'browser/extensions/extension_process_manager.cc', + 'browser/extensions/extension_process_manager.h', 'browser/extensions/extension_protocols.cc', 'browser/extensions/extension_protocols.h', 'browser/extensions/extension_tabs_module.cc', @@ -2423,6 +2425,7 @@ 'browser/download/download_request_manager_unittest.cc', 'browser/download/save_package_unittest.cc', 'browser/extensions/extension_messages_unittest.cc', + 'browser/extensions/extension_process_manager_unittest.h', 'browser/extensions/extension_ui_unittest.cc', 'browser/extensions/extension_unittest.cc', 'browser/extensions/extensions_service_unittest.cc', diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index 9f4d3ca..e0bbc0b 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -80,6 +80,9 @@ class TestingProfile : public Profile { virtual UserScriptMaster* GetUserScriptMaster() { return NULL; } + virtual ExtensionProcessManager* GetExtensionProcessManager() { + return NULL; + } virtual SSLHostState* GetSSLHostState() { return NULL; } diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj index 7488c28..acaa8dd 100644 --- a/chrome/test/unit/unittests.vcproj +++ b/chrome/test/unit/unittests.vcproj @@ -512,6 +512,10 @@ > </File> <File + RelativePath="..\..\browser\extensions\extension_process_manager_unittest.cc" + > + </File> + <File RelativePath="..\..\browser\extensions\extension_ui_unittest.cc" > </File> |