diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 22:27:21 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-16 22:27:21 +0000 |
commit | 69f1be8a969af735b2173349c9bd57a174a9bf16 (patch) | |
tree | bf6bda97490b5884ca6a15f9c1b7d923bcb40886 /chrome | |
parent | 1c86467953f1e633be06ca65e3a38113dcbe63e8 (diff) | |
download | chromium_src-69f1be8a969af735b2173349c9bd57a174a9bf16.zip chromium_src-69f1be8a969af735b2173349c9bd57a174a9bf16.tar.gz chromium_src-69f1be8a969af735b2173349c9bd57a174a9bf16.tar.bz2 |
Remove ExtensionProcessManager and move its functionality onto
ExtensionsService.
Also add "chrome-extension" to the list of schemes that BrowsingInstance
groups per-site, instead of per-tab. This means that navigating to an
extension URL will use the same process as a running extension toolstrip.
Review URL: http://codereview.chromium.org/77002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser.vcproj | 8 | ||||
-rw-r--r-- | chrome/browser/browsing_instance.cc | 5 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_browser_event_router.cc | 13 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_message_service.cc | 50 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_message_service.h | 5 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_process_manager.cc | 64 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_process_manager.h | 63 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_process_manager_unittest.cc | 42 | ||||
-rwxr-xr-x | chrome/browser/extensions/extension_view_unittest.cc | 8 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 17 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.h | 26 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service_unittest.cc | 37 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_ui.h | 2 | ||||
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.cc | 1 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 3 | ||||
-rw-r--r-- | chrome/chrome.gyp | 3 | ||||
-rw-r--r-- | chrome/test/unit/unittests.vcproj | 4 |
17 files changed, 136 insertions, 215 deletions
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index d4d9057..f6c3c73 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -1934,14 +1934,6 @@ > </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/browsing_instance.cc b/chrome/browser/browsing_instance.cc index c576779..096e6d5 100644 --- a/chrome/browser/browsing_instance.cc +++ b/chrome/browser/browsing_instance.cc @@ -29,9 +29,10 @@ bool BrowsingInstance::ShouldUseProcessPerSite(const GURL& url) { // Note that --single-process may have been specified, but that affects the // process creation logic in RenderProcessHost, so we do not need to worry // about it here. - if (url.SchemeIs(chrome::kChromeUIScheme)) + if (url.SchemeIs(chrome::kChromeUIScheme) || + url.SchemeIs(chrome::kExtensionScheme)) // Always consolidate instances of the new tab page (and instances of any - // other internal resource urls). + // other internal resource urls), as well as extensions. return true; // TODO(creis): List any other special cases that we want to limit to a diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc index a80abea..b278258 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -4,9 +4,12 @@ #include "chrome/browser/extensions/extension_browser_event_router.h" +#include "base/json_writer.h" +#include "base/values.h" #include "chrome/browser/browser.h" +#include "chrome/browser/profile.h" #include "chrome/browser/extensions/extension.h" -#include "chrome/browser/extensions/extension_process_manager.h" +#include "chrome/browser/extensions/extension_message_service.h" #include "chrome/browser/extensions/extension_tabs_module.h" #include "chrome/common/notification_service.h" @@ -82,8 +85,12 @@ void ExtensionBrowserEventRouter::TabMoved(TabContents* contents, object_args->Set(L"toIndex", Value::CreateIntegerValue(to_index)); args.Append(object_args); - ExtensionProcessManager::GetInstance()->DispatchEventToRenderers(profile, - kOnTabMoved, args); + + std::string json_args; + JSONWriter::Write(&args, false, &json_args); + + ExtensionMessageService::GetInstance(profile->GetRequestContext())-> + DispatchEventToRenderers(kOnTabMoved, json_args); } void ExtensionBrowserEventRouter::TabChangedAt(TabContents* contents, diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc index 3c2c1de..a49cf47 100755 --- a/chrome/browser/extensions/extension_message_service.cc +++ b/chrome/browser/extensions/extension_message_service.cc @@ -5,6 +5,7 @@ #include "chrome/browser/extensions/extension_message_service.h" #include "base/singleton.h" +#include "base/values.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/extensions/extension.h" #include "chrome/browser/extensions/extension_view.h" @@ -36,6 +37,13 @@ struct SingletonData { }; } // namespace +// Since ExtensionMessageService is a collection of Singletons, we don't need to +// grab a reference to it when creating Tasks involving it. +template <> struct RunnableMethodTraits<ExtensionMessageService> { + static void RetainCallee(ExtensionMessageService*) {} + static void ReleaseCallee(ExtensionMessageService*) {} +}; + // static ExtensionMessageService* ExtensionMessageService::GetInstance( URLRequestContext* context) { @@ -54,17 +62,6 @@ ExtensionMessageService::ExtensionMessageService() : next_port_id_(0) { } -std::set<int> ExtensionMessageService::GetUniqueProcessIds() { - std::set<int> ids; - ProcessIDMap::iterator it; - AutoLock lock(renderers_lock_); - - for (it = process_ids_.begin(); it != process_ids_.end(); it++) { - ids.insert(it->second); - } - return ids; -} - void ExtensionMessageService::RegisterExtension( const std::string& extension_id, int render_process_id) { AutoLock lock(renderers_lock_); @@ -137,6 +134,37 @@ void ExtensionMessageService::PostMessageFromRenderer( dest->Send(new ViewMsg_ExtensionHandleMessage(message, source_port_id)); } +void ExtensionMessageService::DispatchEventToRenderers( + const std::string& event_name, const std::string& event_args) { + MessageLoop* io_thread = ChromeThread::GetMessageLoop(ChromeThread::IO); + if (MessageLoop::current() != io_thread) { + // Do the actual work on the IO thread. + io_thread->PostTask(FROM_HERE, NewRunnableMethod(this, + &ExtensionMessageService::DispatchEventToRenderers, + event_name, event_args)); + return; + } + + // TODO(mpcomplete): this set should probably just be a member var. + std::set<ResourceMessageFilter*> renderer_set; + { + ProcessIDMap::iterator it; + AutoLock lock(renderers_lock_); + + for (it = process_ids_.begin(); it != process_ids_.end(); it++) { + RendererMap::iterator renderer = renderers_.find(it->second); + if (renderer != renderers_.end()) + renderer_set.insert(renderer->second); + } + } + + std::set<ResourceMessageFilter*>::iterator renderer; + for (renderer = renderer_set.begin(); renderer != renderer_set.end(); + ++renderer) { + (*renderer)->Send(new ViewMsg_ExtensionHandleEvent(event_name, event_args)); + } +} + void ExtensionMessageService::RendererReady(ResourceMessageFilter* filter) { AutoLock lock(renderers_lock_); DCHECK(renderers_.find(filter->GetProcessId()) == renderers_.end()); diff --git a/chrome/browser/extensions/extension_message_service.h b/chrome/browser/extensions/extension_message_service.h index f938b51..d4eb856 100755 --- a/chrome/browser/extensions/extension_message_service.h +++ b/chrome/browser/extensions/extension_message_service.h @@ -13,6 +13,7 @@ #include "chrome/common/notification_observer.h" class ExtensionView; +class ListValue; class ResourceMessageFilter; class URLRequestContext; @@ -61,7 +62,9 @@ class ExtensionMessageService : public NotificationObserver { const NotificationSource& source, const NotificationDetails& details); - std::set<int> GetUniqueProcessIds(); + // Send an event to every registered extension renderer. + void DispatchEventToRenderers( + const std::string& event_name, const std::string& event_args); private: // A map of extension ID to the render_process_id that the extension lives in. diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc deleted file mode 100755 index b2fb63e..0000000 --- a/chrome/browser/extensions/extension_process_manager.cc +++ /dev/null @@ -1,64 +0,0 @@ -// 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 "base/json_writer.h" -#include "base/singleton.h" -#include "base/values.h" -#include "chrome/browser/browser.h" -#include "chrome/browser/extensions/extension_view.h" -#include "chrome/browser/extensions/extension_message_service.h" -#include "chrome/browser/tab_contents/site_instance.h" -#include "chrome/common/render_messages.h" - -// static -ExtensionProcessManager* ExtensionProcessManager::GetInstance() { - return Singleton<ExtensionProcessManager>::get(); -} - -ExtensionProcessManager::ExtensionProcessManager() { -} - -ExtensionProcessManager::~ExtensionProcessManager() { -} - -ExtensionView* ExtensionProcessManager::CreateView(Extension* extension, - const GURL& url, - Browser* browser) { - return new ExtensionView(extension, url, - GetSiteInstanceForURL(url, browser->profile()), - browser); -} - -SiteInstance* ExtensionProcessManager::GetSiteInstanceForURL( - const GURL& url, Profile* profile) { - BrowsingInstance* browsing_instance = GetBrowsingInstance(profile); - return browsing_instance->GetSiteInstanceForURL(url); -} - -void ExtensionProcessManager::DispatchEventToRenderers(Profile *profile, - const std::string& event_name, const ListValue& data) { - std::string json_data; - JSONWriter::Write(&data, false, &json_data); - - std::set<int> process_ids = ExtensionMessageService::GetInstance( - profile->GetRequestContext())->GetUniqueProcessIds(); - - std::set<int>::iterator id; - for (id = process_ids.begin(); id != process_ids.end(); ++id) { - RenderProcessHost* rph = RenderProcessHost::FromID(*id); - rph->Send(new ViewMsg_ExtensionHandleEvent(event_name, json_data)); - } -} - -BrowsingInstance* ExtensionProcessManager::GetBrowsingInstance( - Profile* profile) { - BrowsingInstance* instance = browsing_instance_map_[profile]; - if (!instance) { - instance = new BrowsingInstance(profile); - browsing_instance_map_[profile] = instance; - } - return instance; -} diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h deleted file mode 100755 index 7e56fc8..0000000 --- a/chrome/browser/extensions/extension_process_manager.h +++ /dev/null @@ -1,63 +0,0 @@ -// 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 "base/ref_counted.h" - -#include <map> -#include <string> - -class Browser; -class BrowsingInstance; -class Extension; -class ExtensionView; -class GURL; -class ListValue; -class Profile; -class SiteInstance; - -// This class controls what process new extension instances use. We use the -// BrowsingInstance site grouping rules to group extensions. Since all -// resources in a given extension have the same origin, they will be grouped -// into the same process. -// -// We separate further by Profile: each Profile has its own group of extension -// processes that never overlap with other Profiles. -class ExtensionProcessManager { - public: - static ExtensionProcessManager* GetInstance(); - - // These are public for use by Singleton. Do not instantiate or delete - // manually. - ExtensionProcessManager(); - ~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); - - // Returns the SiteInstance that the given URL belongs to in this profile. - SiteInstance* GetSiteInstanceForURL(const GURL& url, Profile* profile); - - // Sends the event to each renderer process within the current profile that - // contain at least one extension renderer. - void DispatchEventToRenderers(Profile *profile, - const std::string& event_name, - const ListValue& data); - private: - // Returns our BrowsingInstance for the given profile. Lazily created and - // cached. - BrowsingInstance* GetBrowsingInstance(Profile* profile); - - // Cache of BrowsingInstances grouped by Profile. - typedef std::map<Profile*, scoped_refptr<BrowsingInstance> > - BrowsingInstanceMap; - BrowsingInstanceMap browsing_instance_map_; -}; - -#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 deleted file mode 100755 index ae43367..0000000 --- a/chrome/browser/extensions/extension_process_manager_unittest.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 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 "testing/gtest/include/gtest/gtest.h" - -#include "chrome/test/testing_profile.h" -#include "chrome/browser/extensions/extension_process_manager.h" -#include "chrome/browser/tab_contents/site_instance.h" - -class ExtensionProcessManagerTest : public testing::Test { -}; - -// Test that extensions get grouped in the right SiteInstance (and therefore -// process) based on their URLs. -TEST(ExtensionProcessManagerTest, ProcessGrouping) { - ExtensionProcessManager* manager = ExtensionProcessManager::GetInstance(); - - // Extensions in different profiles should always be different SiteInstances. - TestingProfile profile1(1); - TestingProfile profile2(2); - - // 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 = - manager->GetSiteInstanceForURL(ext1_url1, &profile1); - scoped_refptr<SiteInstance> site12 = - manager->GetSiteInstanceForURL(ext1_url2, &profile1); - EXPECT_EQ(site11, site12); - - scoped_refptr<SiteInstance> site21 = - manager->GetSiteInstanceForURL(ext2_url1, &profile1); - EXPECT_NE(site11, site21); - - scoped_refptr<SiteInstance> other_profile_site = - manager->GetSiteInstanceForURL(ext1_url1, &profile2); - EXPECT_NE(site11, other_profile_site); -} diff --git a/chrome/browser/extensions/extension_view_unittest.cc b/chrome/browser/extensions/extension_view_unittest.cc index 360df57..e493421 100755 --- a/chrome/browser/extensions/extension_view_unittest.cc +++ b/chrome/browser/extensions/extension_view_unittest.cc @@ -6,7 +6,6 @@ #include "chrome/browser/browser.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/extensions/extension_error_reporter.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/extensions/test_extension_loader.h" @@ -95,9 +94,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionViewTest, Index) { GURL url = Extension::GetResourceURL(extension->url(), "toolstrip1.html"); // Start the extension process and wait for it to show a javascript alert. - MockExtensionView view( - extension, url, ExtensionProcessManager::GetInstance()-> - GetSiteInstanceForURL(url, browser()->profile()), - NULL); // TODO(erikkay): do we need to get a Browser here? + MockExtensionView view(extension, url, + browser()->profile()->GetExtensionsService()->GetSiteInstanceForURL(url), + browser()); EXPECT_TRUE(view.got_message()); } diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index ecc69a1..b645dfe 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -14,12 +14,15 @@ #include "base/values.h" #include "net/base/file_stream.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/user_script_master.h" #include "chrome/browser/extensions/extension_view.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" @@ -74,8 +77,8 @@ ExtensionsService::ExtensionsService(Profile* profile, : message_loop_(MessageLoop::current()), install_directory_(profile->GetPath().AppendASCII(kInstallDirectoryName)), backend_(new ExtensionsServiceBackend(install_directory_)), - profile_(profile), - user_script_master_(user_script_master) { + user_script_master_(user_script_master), + browsing_instance_(new BrowsingInstance(profile)) { } ExtensionsService::~ExtensionsService() { @@ -183,6 +186,16 @@ void ExtensionsService::OnExtensionInstalled(FilePath path, bool update) { // TODO(erikkay): Update UI if appropriate. } +ExtensionView* ExtensionsService::CreateView(Extension* extension, + const GURL& url, + Browser* browser) { + return new ExtensionView(extension, url, GetSiteInstanceForURL(url), browser); +} + +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 64d2e55..2d075bc 100644 --- a/chrome/browser/extensions/extensions_service.h +++ b/chrome/browser/extensions/extensions_service.h @@ -12,12 +12,18 @@ #include "base/message_loop.h" #include "base/ref_counted.h" #include "base/task.h" -#include "chrome/browser/extensions/extension.h" +#include "base/values.h" -typedef std::vector<Extension*> ExtensionList; +class Browser; +class BrowsingInstance; +class Extension; +class ExtensionView; class ExtensionsServiceBackend; +class GURL; class Profile; +class SiteInstance; class UserScriptMaster; +typedef std::vector<Extension*> ExtensionList; // Interface for the frontend to implement. Typically, this will be // ExtensionsService, but it can also be a test harness. @@ -70,6 +76,15 @@ class ExtensionsService : public ExtensionsServiceFrontendInterface { virtual void OnExtensionsLoaded(ExtensionList* extensions); virtual void OnExtensionInstalled(FilePath path, bool is_update); + // 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); + + // 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; @@ -90,12 +105,13 @@ class ExtensionsService : public ExtensionsServiceFrontendInterface { // The backend that will do IO on behalf of this instance. scoped_refptr<ExtensionsServiceBackend> backend_; - // The profile associated with this set of extensions. - Profile* profile_; - // 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_; + DISALLOW_COPY_AND_ASSIGN(ExtensionsService); }; diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc index abdaef8..685f914 100644 --- a/chrome/browser/extensions/extensions_service_unittest.cc +++ b/chrome/browser/extensions/extensions_service_unittest.cc @@ -14,9 +14,11 @@ #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" @@ -349,3 +351,38 @@ 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/extensions/extensions_ui.h b/chrome/browser/extensions/extensions_ui.h index 7234fea..56bd08a 100644 --- a/chrome/browser/extensions/extensions_ui.h +++ b/chrome/browser/extensions/extensions_ui.h @@ -7,11 +7,13 @@ #include <string> +#include "base/values.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/dom_ui/dom_ui.h" #include "chrome/browser/extensions/extensions_service.h" class GURL; +class UserScript; class ExtensionsUIHTMLSource : public ChromeURLDataManager::DataSource { public: diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 2a1005a..ac5c3c3 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -8,6 +8,7 @@ #include "base/string_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_thread.h" +#include "chrome/browser/extensions/extension.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/user_script_master.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index 62dd928..5acf012 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -13,7 +13,6 @@ #include "chrome/browser/browser.h" #include "chrome/browser/drag_utils.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/metrics/user_metrics.h" @@ -301,7 +300,7 @@ class ExtensionToolstrip : public views::View { static const int kPadding = 2; ExtensionToolstrip(Extension* extension, const GURL& url, Browser* browser) - : view_(ExtensionProcessManager::GetInstance()->CreateView( + : view_(browser->profile()->GetExtensionsService()->CreateView( extension, url, browser)) { AddChildView(view_); set_border(views::Border::CreateEmptyBorder( diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 5c6a186..dad059e 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -674,8 +674,6 @@ 'browser/extensions/extension_function_dispatcher.h', 'browser/extensions/extension_message_service.cc', 'browser/extensions/extension_message_service.h', - 'browser/extensions/extension_process_manager.cc', - 'browser/extensions/extension_process_manager.h', 'browser/extensions/extension_browser_event_router.cc', 'browser/extensions/extension_browser_event_router.h', 'browser/extensions/extension_protocols.cc', @@ -2137,7 +2135,6 @@ 'browser/download/download_manager_unittest.cc', 'browser/download/download_request_manager_unittest.cc', 'browser/download/save_package_unittest.cc', - 'browser/extensions/extension_process_manager_unittest.cc', 'browser/extensions/extension_ui_unittest.cc', 'browser/extensions/extension_unittest.cc', 'browser/extensions/extensions_service_unittest.cc', diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj index 18f654a..c95e558 100644 --- a/chrome/test/unit/unittests.vcproj +++ b/chrome/test/unit/unittests.vcproj @@ -500,10 +500,6 @@ > </File> <File - RelativePath="..\..\browser\extensions\extension_process_manager_unittest.cc" - > - </File> - <File RelativePath="..\..\browser\extensions\extension_ui_unittest.cc" > </File> |