Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: chrome/browser/extensions/extension_system.h

Issue 23618014: This defers starting background extension page RenderViews (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged logic into DeferLoadingBackgroundHosts Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Returns the instance for the given profile, or NULL if none. This is 46 // Returns the instance for the given profile, or NULL if none. This is
47 // a convenience wrapper around ExtensionSystemFactory::GetForProfile. 47 // a convenience wrapper around ExtensionSystemFactory::GetForProfile.
48 static ExtensionSystem* Get(Profile* profile); 48 static ExtensionSystem* Get(Profile* profile);
49 49
50 // BrowserContextKeyedService implementation. 50 // BrowserContextKeyedService implementation.
51 virtual void Shutdown() OVERRIDE {} 51 virtual void Shutdown() OVERRIDE {}
52 52
53 // Initializes extensions machinery. 53 // Initializes extensions machinery.
54 // Component extensions are always enabled, external and user extensions 54 // Component extensions are always enabled, external and user extensions
55 // are controlled by |extensions_enabled|. 55 // are controlled by |extensions_enabled|. If |defer_background_creation| is
56 virtual void InitForRegularProfile(bool extensions_enabled) = 0; 56 // true, then creation of background extension RenderViews will be deferred
57 // until ExtensionProcessManager::DeferBackgroundHostCreation is called with
58 // |defer| set to false.
59 virtual void InitForRegularProfile(bool extensions_enabled,
60 bool defer_background_creation) = 0;
57 61
58 // The ExtensionService is created at startup. 62 // The ExtensionService is created at startup.
59 virtual ExtensionService* extension_service() = 0; 63 virtual ExtensionService* extension_service() = 0;
60 64
61 // The class controlling whether users are permitted to perform certain 65 // The class controlling whether users are permitted to perform certain
62 // actions on extensions (install, uninstall, disable, etc.). 66 // actions on extensions (install, uninstall, disable, etc.).
63 // The ManagementPolicy is created at startup. 67 // The ManagementPolicy is created at startup.
64 virtual ManagementPolicy* management_policy() = 0; 68 virtual ManagementPolicy* management_policy() = 0;
65 69
66 // The UserScriptMaster is created at startup. 70 // The UserScriptMaster is created at startup.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // instances. A private Shared class (also a BrowserContextKeyedService, 122 // instances. A private Shared class (also a BrowserContextKeyedService,
119 // but with a shared instance for incognito) keeps the common services. 123 // but with a shared instance for incognito) keeps the common services.
120 class ExtensionSystemImpl : public ExtensionSystem { 124 class ExtensionSystemImpl : public ExtensionSystem {
121 public: 125 public:
122 explicit ExtensionSystemImpl(Profile* profile); 126 explicit ExtensionSystemImpl(Profile* profile);
123 virtual ~ExtensionSystemImpl(); 127 virtual ~ExtensionSystemImpl();
124 128
125 // BrowserContextKeyedService implementation. 129 // BrowserContextKeyedService implementation.
126 virtual void Shutdown() OVERRIDE; 130 virtual void Shutdown() OVERRIDE;
127 131
128 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; 132 virtual void InitForRegularProfile(bool extensions_enabled,
133 bool defer_background_creation) OVERRIDE;
129 134
130 virtual ExtensionService* extension_service() OVERRIDE; // shared 135 virtual ExtensionService* extension_service() OVERRIDE; // shared
131 virtual ManagementPolicy* management_policy() OVERRIDE; // shared 136 virtual ManagementPolicy* management_policy() OVERRIDE; // shared
132 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared 137 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared
133 virtual ExtensionProcessManager* process_manager() OVERRIDE; 138 virtual ExtensionProcessManager* process_manager() OVERRIDE;
134 virtual StateStore* state_store() OVERRIDE; // shared 139 virtual StateStore* state_store() OVERRIDE; // shared
135 virtual StateStore* rules_store() OVERRIDE; // shared 140 virtual StateStore* rules_store() OVERRIDE; // shared
136 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() 141 virtual LazyBackgroundTaskQueue* lazy_background_task_queue()
137 OVERRIDE; // shared 142 OVERRIDE; // shared
138 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared 143 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // incoming resource requests from extension processes and those require 225 // incoming resource requests from extension processes and those require
221 // access to the ResourceContext owned by |io_data_|. 226 // access to the ResourceContext owned by |io_data_|.
222 scoped_ptr<ExtensionProcessManager> extension_process_manager_; 227 scoped_ptr<ExtensionProcessManager> extension_process_manager_;
223 228
224 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); 229 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl);
225 }; 230 };
226 231
227 } // namespace extensions 232 } // namespace extensions
228 233
229 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ 234 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698