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

Side by Side Diff: extensions/renderer/user_script_set_manager.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: 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ 5 #ifndef EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_
6 #define EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ 6 #define EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 UserScriptSetManager(const ExtensionSet* extensions); 52 UserScriptSetManager(const ExtensionSet* extensions);
53 53
54 virtual ~UserScriptSetManager(); 54 virtual ~UserScriptSetManager();
55 55
56 void AddObserver(Observer* observer); 56 void AddObserver(Observer* observer);
57 void RemoveObserver(Observer* observer); 57 void RemoveObserver(Observer* observer);
58 58
59 const UserScriptSet* GetProgrammaticScriptsByExtension( 59 const UserScriptSet* GetProgrammaticScriptsByExtension(
60 const ExtensionId& extensionId); 60 const ExtensionId& extensionId);
61 61
62 // Put all injections from |static_scripts| and each of 62 // Put all injections from |static_scripts| and each of |programmatic_scripts|
63 // |programmatic_scripts_| into |injections|. 63 // into |injections|.
64 void GetAllInjections(ScopedVector<ScriptInjection>* injections, 64 void GetAllInjections(ScopedVector<ScriptInjection>* injections,
65 blink::WebFrame* web_frame, 65 blink::WebFrame* web_frame,
66 int tab_id, 66 int tab_id,
67 UserScript::RunLocation run_location); 67 UserScript::RunLocation run_location);
68 68
69 // Get active extension IDs from |static_scripts| and each of 69 // Get active extension IDs from |static_scripts| and each of
70 // |programmatic_scripts_|. 70 // |programmatic_scripts|.
71 void GetAllActiveExtensionIds(std::set<std::string>* ids) const; 71 void GetAllActiveExtensionIds(std::set<std::string>* ids) const;
72 72
73 const UserScriptSet* static_scripts() const { return &static_scripts_; } 73 const UserScriptSet* static_scripts() const { return &static_scripts_; }
74 74
75 private: 75 private:
76 // Map for per-extension sets that may be defined programmatically. 76 // Map for per-extension sets that may be defined programmatically.
77 typedef std::map<ExtensionId, linked_ptr<UserScriptSet> > UserScriptSetMap; 77 typedef std::map<ExtensionId, linked_ptr<UserScriptSet> > UserScriptSetMap;
78 78
79 // content::RenderProcessObserver implementation. 79 // content::RenderProcessObserver implementation.
80 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 80 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
(...skipping 15 matching lines...) Expand all
96 96
97 // The associated observers. 97 // The associated observers.
98 ObserverList<Observer> observers_; 98 ObserverList<Observer> observers_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(UserScriptSetManager); 100 DISALLOW_COPY_AND_ASSIGN(UserScriptSetManager);
101 }; 101 };
102 102
103 } // namespace extensions 103 } // namespace extensions
104 104
105 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ 105 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698