OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Resets all functions to their initial implementation. | 78 // Resets all functions to their initial implementation. |
79 static void ResetFunctions(); | 79 static void ResetFunctions(); |
80 | 80 |
81 // Dispatches an IO-thread extension function. Only used for specific | 81 // Dispatches an IO-thread extension function. Only used for specific |
82 // functions that must be handled on the IO-thread. | 82 // functions that must be handled on the IO-thread. |
83 static void DispatchOnIOThread( | 83 static void DispatchOnIOThread( |
84 ExtensionInfoMap* extension_info_map, | 84 ExtensionInfoMap* extension_info_map, |
85 void* profile, | 85 void* profile, |
86 int render_process_id, | 86 int render_process_id, |
87 base::WeakPtr<ChromeRenderMessageFilter> ipc_sender, | 87 base::WeakPtr<ChromeRenderMessageFilter> ipc_sender, |
88 int routing_id, | |
89 const ExtensionHostMsg_Request_Params& params); | 88 const ExtensionHostMsg_Request_Params& params); |
90 | 89 |
91 // Public constructor. Callers must ensure that: | 90 // Public constructor. Callers must ensure that: |
92 // - |delegate| outlives this object. | 91 // - |delegate| outlives this object. |
93 // - This object outlives any RenderViewHost's passed to created | 92 // - This object outlives any RenderViewHost's passed to created |
94 // ExtensionFunctions. | 93 // ExtensionFunctions. |
95 ExtensionFunctionDispatcher(Profile* profile, Delegate* delegate); | 94 ExtensionFunctionDispatcher(Profile* profile, Delegate* delegate); |
96 | 95 |
97 ~ExtensionFunctionDispatcher(); | 96 ~ExtensionFunctionDispatcher(); |
98 | 97 |
(...skipping 14 matching lines...) Expand all Loading... |
113 // Helper to create an ExtensionFunction to handle the function given by | 112 // Helper to create an ExtensionFunction to handle the function given by |
114 // |params|. Can be called on any thread. | 113 // |params|. Can be called on any thread. |
115 // Does not set subclass properties, or include_incognito. | 114 // Does not set subclass properties, or include_incognito. |
116 static ExtensionFunction* CreateExtensionFunction( | 115 static ExtensionFunction* CreateExtensionFunction( |
117 const ExtensionHostMsg_Request_Params& params, | 116 const ExtensionHostMsg_Request_Params& params, |
118 const extensions::Extension* extension, | 117 const extensions::Extension* extension, |
119 int requesting_process_id, | 118 int requesting_process_id, |
120 const extensions::ProcessMap& process_map, | 119 const extensions::ProcessMap& process_map, |
121 extensions::ExtensionAPI* api, | 120 extensions::ExtensionAPI* api, |
122 void* profile, | 121 void* profile, |
123 IPC::Sender* ipc_sender, | 122 IPC::Sender* ipc_sender); |
124 int routing_id); | |
125 | 123 |
126 // Helper to send an access denied error to the requesting renderer. Can be | 124 // Helper to send an access denied error to the requesting renderer. Can be |
127 // called on any thread. | 125 // called on any thread. |
128 static void SendAccessDenied(IPC::Sender* ipc_sender, | 126 static void SendAccessDenied(IPC::Sender* ipc_sender, int request_id); |
129 int routing_id, | |
130 int request_id); | |
131 | 127 |
132 Profile* profile_; | 128 Profile* profile_; |
133 | 129 |
134 Delegate* delegate_; | 130 Delegate* delegate_; |
135 }; | 131 }; |
136 | 132 |
137 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 133 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
OLD | NEW |