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

Unified Diff: chrome/browser/extensions/extension_system_impl.h

Issue 420543002: Declarative content scripts: Browser-side: per-extension shared memory regions (lazily loaded) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit and rebase from master Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_system_impl.h
diff --git a/chrome/browser/extensions/extension_system_impl.h b/chrome/browser/extensions/extension_system_impl.h
index df32495dae7cc1401ec9aba477cf8891ce9b1978..2f1eddc1ea14eb32e1ee0f620e7d1ee7b60a01ea 100644
--- a/chrome/browser/extensions/extension_system_impl.h
+++ b/chrome/browser/extensions/extension_system_impl.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_
+#include "base/memory/scoped_vector.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/one_shot_event.h"
@@ -13,9 +14,11 @@ class Profile;
namespace extensions {
class ContentVerifier;
+class DeclarativeUserScriptMaster;
class ExtensionSystemSharedFactory;
class ExtensionWarningBadgeService;
class NavigationObserver;
+class SharedUserScriptMaster;
class StandardManagementPolicyProvider;
class StateStoreNotificationObserver;
@@ -37,7 +40,8 @@ class ExtensionSystemImpl : public ExtensionSystem {
virtual ExtensionService* extension_service() OVERRIDE; // shared
virtual RuntimeData* runtime_data() OVERRIDE; // shared
virtual ManagementPolicy* management_policy() OVERRIDE; // shared
- virtual UserScriptMaster* user_script_master() OVERRIDE; // shared
+ // shared
+ virtual SharedUserScriptMaster* shared_user_script_master() OVERRIDE;
virtual ProcessManager* process_manager() OVERRIDE;
virtual StateStore* state_store() OVERRIDE; // shared
virtual StateStore* rules_store() OVERRIDE; // shared
@@ -63,6 +67,10 @@ class ExtensionSystemImpl : public ExtensionSystem {
virtual scoped_ptr<ExtensionSet> GetDependentExtensions(
const Extension* extension) OVERRIDE;
+ virtual DeclarativeUserScriptMaster*
+ GetDeclarativeUserScriptMasterByExtension(
+ const ExtensionId& extension_id) OVERRIDE; // shared
+
private:
friend class ExtensionSystemSharedFactory;
@@ -87,7 +95,7 @@ class ExtensionSystemImpl : public ExtensionSystem {
ExtensionService* extension_service();
RuntimeData* runtime_data();
ManagementPolicy* management_policy();
- UserScriptMaster* user_script_master();
+ SharedUserScriptMaster* shared_user_script_master();
Blacklist* blacklist();
InfoMap* info_map();
LazyBackgroundTaskQueue* lazy_background_task_queue();
@@ -99,6 +107,9 @@ class ExtensionSystemImpl : public ExtensionSystem {
const OneShotEvent& ready() const { return ready_; }
ContentVerifier* content_verifier();
+ DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension(
+ const ExtensionId& extension_id);
+
private:
Profile* profile_;
@@ -113,7 +124,13 @@ class ExtensionSystemImpl : public ExtensionSystem {
scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
scoped_ptr<EventRouter> event_router_;
scoped_ptr<NavigationObserver> navigation_observer_;
- scoped_ptr<UserScriptMaster> user_script_master_;
+ // Shared memory region manager for scripts statically declared in extension
+ // manifests. This region is shared between all extensions.
+ scoped_ptr<SharedUserScriptMaster> shared_user_script_master_;
+ // Shared memory region manager for programmatically declared scripts, one
+ // per extension. Managers are instantiated the first time the declarative
+ // API is used by an extension to request content scripts.
+ ScopedVector<DeclarativeUserScriptMaster> declarative_user_script_masters_;
scoped_ptr<Blacklist> blacklist_;
// StandardManagementPolicyProvider depends on Blacklist.
scoped_ptr<StandardManagementPolicyProvider>
« no previous file with comments | « chrome/browser/extensions/extension_startup_browsertest.cc ('k') | chrome/browser/extensions/extension_system_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698