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

Side by Side Diff: extensions/renderer/dispatcher.h

Issue 404613006: Declarative content scripts: Renderer-side: per-extension shared memory regions (lazily loaded) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-add missing Disptacher::content_watcher_ initialization 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 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_DISPATCHER_H_ 5 #ifndef EXTENSIONS_RENDERER_DISPATCHER_H_
6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ 6 #define EXTENSIONS_RENDERER_DISPATCHER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/scoped_observer.h" 13 #include "base/scoped_observer.h"
14 #include "base/timer/timer.h" 14 #include "base/timer/timer.h"
15 #include "content/public/renderer/render_process_observer.h" 15 #include "content/public/renderer/render_process_observer.h"
16 #include "extensions/common/event_filter.h" 16 #include "extensions/common/event_filter.h"
17 #include "extensions/common/extension_set.h" 17 #include "extensions/common/extension_set.h"
18 #include "extensions/common/extensions_client.h" 18 #include "extensions/common/extensions_client.h"
19 #include "extensions/common/features/feature.h" 19 #include "extensions/common/features/feature.h"
20 #include "extensions/renderer/resource_bundle_source_map.h" 20 #include "extensions/renderer/resource_bundle_source_map.h"
21 #include "extensions/renderer/script_context.h" 21 #include "extensions/renderer/script_context.h"
22 #include "extensions/renderer/script_context_set.h" 22 #include "extensions/renderer/script_context_set.h"
23 #include "extensions/renderer/user_script_set.h" 23 #include "extensions/renderer/user_script_set_manager.h"
24 #include "extensions/renderer/v8_schema_registry.h" 24 #include "extensions/renderer/v8_schema_registry.h"
25 #include "third_party/WebKit/public/platform/WebString.h" 25 #include "third_party/WebKit/public/platform/WebString.h"
26 #include "third_party/WebKit/public/platform/WebVector.h" 26 #include "third_party/WebKit/public/platform/WebVector.h"
27 #include "v8/include/v8.h" 27 #include "v8/include/v8.h"
28 28
29 class ChromeRenderViewTest; 29 class ChromeRenderViewTest;
30 class GURL; 30 class GURL;
31 class ModuleSystem; 31 class ModuleSystem;
32 class URLPattern; 32 class URLPattern;
33 struct ExtensionMsg_ExternalConnectionInfo; 33 struct ExtensionMsg_ExternalConnectionInfo;
(...skipping 21 matching lines...) Expand all
55 class FilteredEventRouter; 55 class FilteredEventRouter;
56 class ManifestPermissionSet; 56 class ManifestPermissionSet;
57 class RequestSender; 57 class RequestSender;
58 class ScriptContext; 58 class ScriptContext;
59 class ScriptInjectionManager; 59 class ScriptInjectionManager;
60 struct Message; 60 struct Message;
61 61
62 // Dispatches extension control messages sent to the renderer and stores 62 // Dispatches extension control messages sent to the renderer and stores
63 // renderer extension related state. 63 // renderer extension related state.
64 class Dispatcher : public content::RenderProcessObserver, 64 class Dispatcher : public content::RenderProcessObserver,
65 public UserScriptSet::Observer { 65 public UserScriptSetManager::Observer {
66 public: 66 public:
67 explicit Dispatcher(DispatcherDelegate* delegate); 67 explicit Dispatcher(DispatcherDelegate* delegate);
68 virtual ~Dispatcher(); 68 virtual ~Dispatcher();
69 69
70 const std::set<std::string>& function_names() const { 70 const std::set<std::string>& function_names() const {
71 return function_names_; 71 return function_names_;
72 } 72 }
73 73
74 bool is_extension_process() const { return is_extension_process_; } 74 bool is_extension_process() const { return is_extension_process_; }
75 75
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 void OnSuspend(const std::string& extension_id); 177 void OnSuspend(const std::string& extension_id);
178 void OnTransferBlobs(const std::vector<std::string>& blob_uuids); 178 void OnTransferBlobs(const std::vector<std::string>& blob_uuids);
179 void OnUnloaded(const std::string& id); 179 void OnUnloaded(const std::string& id);
180 void OnUpdatePermissions(const ExtensionMsg_UpdatePermissions_Params& params); 180 void OnUpdatePermissions(const ExtensionMsg_UpdatePermissions_Params& params);
181 void OnUpdateTabSpecificPermissions(const GURL& url, 181 void OnUpdateTabSpecificPermissions(const GURL& url,
182 int tab_id, 182 int tab_id,
183 const std::string& extension_id, 183 const std::string& extension_id,
184 const URLPatternSet& origin_set); 184 const URLPatternSet& origin_set);
185 void OnUsingWebRequestAPI(bool webrequest_used); 185 void OnUsingWebRequestAPI(bool webrequest_used);
186 186
187 // UserScriptSet::Observer implementation. 187 // UserScriptSetManager::Observer implementation.
188 virtual void OnUserScriptsUpdated( 188 virtual void OnUserScriptsUpdated(
189 const std::set<std::string>& changed_extensions, 189 const std::set<std::string>& changed_extensions,
190 const std::vector<UserScript*>& scripts) OVERRIDE; 190 const std::vector<UserScript*>& scripts) OVERRIDE;
191 191
192 void UpdateActiveExtensions(); 192 void UpdateActiveExtensions();
193 193
194 // Sets up the host permissions for |extension|. 194 // Sets up the host permissions for |extension|.
195 void UpdateOriginPermissions(const Extension* extension); 195 void UpdateOriginPermissions(const Extension* extension);
196 196
197 // Enable custom element whitelist in Apps. 197 // Enable custom element whitelist in Apps.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // The IDs of extensions that failed to load, mapped to the error message 249 // The IDs of extensions that failed to load, mapped to the error message
250 // generated on failure. 250 // generated on failure.
251 std::map<std::string, std::string> extension_load_errors_; 251 std::map<std::string, std::string> extension_load_errors_;
252 252
253 // All the bindings contexts that are currently loaded for this renderer. 253 // All the bindings contexts that are currently loaded for this renderer.
254 // There is zero or one for each v8 context. 254 // There is zero or one for each v8 context.
255 ScriptContextSet script_context_set_; 255 ScriptContextSet script_context_set_;
256 256
257 scoped_ptr<ContentWatcher> content_watcher_; 257 scoped_ptr<ContentWatcher> content_watcher_;
258 258
259 scoped_ptr<UserScriptSet> user_script_set_; 259 scoped_ptr<UserScriptSetManager> user_script_set_manager_;
260 260
261 scoped_ptr<ScriptInjectionManager> script_injection_manager_; 261 scoped_ptr<ScriptInjectionManager> script_injection_manager_;
262 262
263 // Same as above, but on a longer timer and will run even if the process is 263 // Same as above, but on a longer timer and will run even if the process is
264 // not idle, to ensure that IdleHandle gets called eventually. 264 // not idle, to ensure that IdleHandle gets called eventually.
265 scoped_ptr<base::RepeatingTimer<content::RenderThread> > forced_idle_timer_; 265 scoped_ptr<base::RepeatingTimer<content::RenderThread> > forced_idle_timer_;
266 266
267 // All declared function names. 267 // All declared function names.
268 std::set<std::string> function_names_; 268 std::set<std::string> function_names_;
269 269
(...skipping 13 matching lines...) Expand all
283 std::string system_font_size_; 283 std::string system_font_size_;
284 284
285 // Mapping of port IDs to tabs. If there is no tab, the value would be -1. 285 // Mapping of port IDs to tabs. If there is no tab, the value would be -1.
286 std::map<int, int> port_to_tab_id_map_; 286 std::map<int, int> port_to_tab_id_map_;
287 287
288 // True once WebKit has been initialized (and it is therefore safe to poke). 288 // True once WebKit has been initialized (and it is therefore safe to poke).
289 bool is_webkit_initialized_; 289 bool is_webkit_initialized_;
290 290
291 // It is important for this to come after the ScriptInjectionManager, so that 291 // It is important for this to come after the ScriptInjectionManager, so that
292 // the observer is destroyed before the UserScriptSet. 292 // the observer is destroyed before the UserScriptSet.
293 ScopedObserver<UserScriptSet, UserScriptSet::Observer> 293 ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer>
294 user_script_set_observer_; 294 user_script_set_manager_observer_;
295 295
296 DISALLOW_COPY_AND_ASSIGN(Dispatcher); 296 DISALLOW_COPY_AND_ASSIGN(Dispatcher);
297 }; 297 };
298 298
299 } // namespace extensions 299 } // namespace extensions
300 300
301 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ 301 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698