OLD | NEW |
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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 namespace extensions { | 54 namespace extensions { |
55 class ContentWatcher; | 55 class ContentWatcher; |
56 class DispatcherDelegate; | 56 class DispatcherDelegate; |
57 class ExtensionBindingsSystem; | 57 class ExtensionBindingsSystem; |
58 class RequestSender; | 58 class RequestSender; |
59 class ScriptContext; | 59 class ScriptContext; |
60 class ScriptInjectionManager; | 60 class ScriptInjectionManager; |
61 struct Message; | 61 struct Message; |
| 62 struct PortId; |
62 | 63 |
63 // Dispatches extension control messages sent to the renderer and stores | 64 // Dispatches extension control messages sent to the renderer and stores |
64 // renderer extension related state. | 65 // renderer extension related state. |
65 class Dispatcher : public content::RenderThreadObserver, | 66 class Dispatcher : public content::RenderThreadObserver, |
66 public UserScriptSetManager::Observer { | 67 public UserScriptSetManager::Observer { |
67 public: | 68 public: |
68 explicit Dispatcher(DispatcherDelegate* delegate); | 69 explicit Dispatcher(DispatcherDelegate* delegate); |
69 ~Dispatcher() override; | 70 ~Dispatcher() override; |
70 | 71 |
71 const ScriptContextSet& script_context_set() const { | 72 const ScriptContextSet& script_context_set() const { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, | 149 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, |
149 CannotScriptWebstore); | 150 CannotScriptWebstore); |
150 | 151 |
151 // RenderThreadObserver implementation: | 152 // RenderThreadObserver implementation: |
152 bool OnControlMessageReceived(const IPC::Message& message) override; | 153 bool OnControlMessageReceived(const IPC::Message& message) override; |
153 void IdleNotification() override; | 154 void IdleNotification() override; |
154 void OnRenderProcessShutdown() override; | 155 void OnRenderProcessShutdown() override; |
155 | 156 |
156 void OnActivateExtension(const std::string& extension_id); | 157 void OnActivateExtension(const std::string& extension_id); |
157 void OnCancelSuspend(const std::string& extension_id); | 158 void OnCancelSuspend(const std::string& extension_id); |
158 void OnDeliverMessage(int target_port_id, | 159 void OnDeliverMessage(const PortId& target_port_id, const Message& message); |
159 const Message& message); | 160 void OnDispatchOnConnect(const PortId& target_port_id, |
160 void OnDispatchOnConnect(int target_port_id, | |
161 const std::string& channel_name, | 161 const std::string& channel_name, |
162 const ExtensionMsg_TabConnectionInfo& source, | 162 const ExtensionMsg_TabConnectionInfo& source, |
163 const ExtensionMsg_ExternalConnectionInfo& info, | 163 const ExtensionMsg_ExternalConnectionInfo& info, |
164 const std::string& tls_channel_id); | 164 const std::string& tls_channel_id); |
165 void OnDispatchOnDisconnect(int port_id, const std::string& error_message); | 165 void OnDispatchOnDisconnect(const PortId& port_id, |
| 166 const std::string& error_message); |
166 void OnLoaded( | 167 void OnLoaded( |
167 const std::vector<ExtensionMsg_Loaded_Params>& loaded_extensions); | 168 const std::vector<ExtensionMsg_Loaded_Params>& loaded_extensions); |
168 void OnMessageInvoke(const std::string& extension_id, | 169 void OnMessageInvoke(const std::string& extension_id, |
169 const std::string& module_name, | 170 const std::string& module_name, |
170 const std::string& function_name, | 171 const std::string& function_name, |
171 const base::ListValue& args); | 172 const base::ListValue& args); |
172 void OnDispatchEvent(const ExtensionMsg_DispatchEvent_Params& params, | 173 void OnDispatchEvent(const ExtensionMsg_DispatchEvent_Params& params, |
173 const base::ListValue& event_args); | 174 const base::ListValue& event_args); |
174 void OnSetSessionInfo(version_info::Channel channel, | 175 void OnSetSessionInfo(version_info::Channel channel, |
175 FeatureSessionType session_type); | 176 FeatureSessionType session_type); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // if this renderer is a WebView guest render process. Otherwise, this will be | 290 // if this renderer is a WebView guest render process. Otherwise, this will be |
290 // empty. | 291 // empty. |
291 std::string webview_partition_id_; | 292 std::string webview_partition_id_; |
292 | 293 |
293 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 294 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
294 }; | 295 }; |
295 | 296 |
296 } // namespace extensions | 297 } // namespace extensions |
297 | 298 |
298 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ | 299 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ |
OLD | NEW |