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

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

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: Refactor relationship between UserScriptMaster and its subclasses Created 6 years, 5 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.cc
diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc
index 1f8ada2f17472321f94b086a34ac7e7eee9116ad..8affe2a82ff7f44d7e988d8828853779a40749f2 100644
--- a/chrome/browser/extensions/extension_system_impl.cc
+++ b/chrome/browser/extensions/extension_system_impl.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/extensions/blacklist.h"
#include "chrome/browser/extensions/component_loader.h"
+#include "chrome/browser/extensions/declarative_user_script_master.h"
#include "chrome/browser/extensions/error_console/error_console.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -28,7 +29,7 @@
#include "chrome/browser/extensions/shared_module_service.h"
#include "chrome/browser/extensions/standard_management_policy_provider.h"
#include "chrome/browser/extensions/updater/manifest_fetch_data.h"
-#include "chrome/browser/extensions/user_script_master.h"
+#include "chrome/browser/extensions/user_script_master_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_switches.h"
@@ -313,7 +314,7 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) {
bool allow_noisy_errors = !command_line->HasSwitch(switches::kNoErrorDialogs);
ExtensionErrorReporter::Init(allow_noisy_errors);
- user_script_master_.reset(new UserScriptMaster(profile_));
+ user_script_master_manager_.reset(new UserScriptMasterManager(profile_));
// ExtensionService depends on RuntimeData.
runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_)));
@@ -454,7 +455,9 @@ ManagementPolicy* ExtensionSystemImpl::Shared::management_policy() {
}
UserScriptMaster* ExtensionSystemImpl::Shared::user_script_master() {
- return user_script_master_.get();
+ return user_script_master_manager_.get()
+ ? user_script_master_manager_->shared_master()
+ : NULL;
}
InfoMap* ExtensionSystemImpl::Shared::info_map() {
@@ -496,6 +499,15 @@ ContentVerifier* ExtensionSystemImpl::Shared::content_verifier() {
return content_verifier_.get();
}
+DeclarativeUserScriptMaster*
+ExtensionSystemImpl::Shared::GetDeclarativeUserScriptMasterByExtension(
+ const ExtensionId& extension_id) {
+ return user_script_master_manager_.get()
+ ? user_script_master_manager_->GetDeclarativeMasterByExtension(
+ extension_id)
+ : NULL;
+}
+
//
// ExtensionSystemImpl
//
@@ -603,6 +615,12 @@ scoped_ptr<ExtensionSet> ExtensionSystemImpl::GetDependentExtensions(
extension);
}
+DeclarativeUserScriptMaster*
+ExtensionSystemImpl::GetDeclarativeUserScriptMasterByExtension(
+ const ExtensionId& extension_id) {
+ return shared_->GetDeclarativeUserScriptMasterByExtension(extension_id);
+}
+
void ExtensionSystemImpl::RegisterExtensionWithRequestContexts(
const Extension* extension) {
base::Time install_time;

Powered by Google App Engine
This is Rietveld 408576698