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

Side by Side Diff: chrome/browser/extensions/user_script_master_manager.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 UserScriptMaster into UserScriptLoader, managed by SharedUserScriptMaster and DeclarativeU… 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
Devlin 2014/08/04 18:33:26 no (c)
Mark Dittmer 2014/08/05 20:33:20 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/user_script_master_manager.h"
6
7 #include "chrome/browser/extensions/shared_user_script_master.h"
8 #include "chrome/browser/profiles/profile.h"
9
10 namespace extensions {
11
12 UserScriptMasterManager::UserScriptMasterManager(Profile* profile)
13 : profile_(profile),
14 shared_master_(new SharedUserScriptMaster(profile)),
15 extension_registry_observer_(this) {
16 extension_registry_observer_.Add(ExtensionRegistry::Get(profile));
17 }
18
19 UserScriptMasterManager::~UserScriptMasterManager() {
20 }
21
22 void UserScriptMasterManager::OnExtensionLoaded(
23 content::BrowserContext* browser_context,
Devlin 2014/08/04 18:33:26 Why?
Mark Dittmer 2014/08/05 20:33:20 Good question. I erroneously presumed that OnExten
24 const Extension* extension) {
25 }
26
27 void UserScriptMasterManager::OnExtensionUnloaded(
28 content::BrowserContext* browser_context,
29 const Extension* extension,
30 UnloadedExtensionInfo::Reason reason) {
31 const ExtensionId& id = extension->id();
32 if (declarative_masters_.find(id) != declarative_masters_.end()) {
Devlin 2014/08/04 18:33:26 We could just have the DeclUSM listen for this.
Mark Dittmer 2014/08/05 20:33:20 Done.
33 declarative_masters_.get(id)->ClearScripts();
34 }
35 }
36
37 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698