| 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 // Gets a list of all known extension function names. | 74 // Gets a list of all known extension function names. |
| 75 static void GetAllFunctionNames(std::vector<std::string>* names); | 75 static void GetAllFunctionNames(std::vector<std::string>* names); |
| 76 | 76 |
| 77 // Override a previously registered function. Returns true if successful, | 77 // Override a previously registered function. Returns true if successful, |
| 78 // false if no such function was registered. | 78 // false if no such function was registered. |
| 79 static bool OverrideFunction(const std::string& name, | 79 static bool OverrideFunction(const std::string& name, |
| 80 ExtensionFunctionFactory factory); | 80 ExtensionFunctionFactory factory); |
| 81 | 81 |
| 82 // Resets all functions to their initial implementation. | |
| 83 static void ResetFunctions(); | |
| 84 | |
| 85 // Dispatches an IO-thread extension function. Only used for specific | 82 // Dispatches an IO-thread extension function. Only used for specific |
| 86 // functions that must be handled on the IO-thread. | 83 // functions that must be handled on the IO-thread. |
| 87 static void DispatchOnIOThread( | 84 static void DispatchOnIOThread( |
| 88 extensions::InfoMap* extension_info_map, | 85 extensions::InfoMap* extension_info_map, |
| 89 void* profile, | 86 void* profile, |
| 90 int render_process_id, | 87 int render_process_id, |
| 91 base::WeakPtr<ChromeRenderMessageFilter> ipc_sender, | 88 base::WeakPtr<ChromeRenderMessageFilter> ipc_sender, |
| 92 int routing_id, | 89 int routing_id, |
| 93 const ExtensionHostMsg_Request_Params& params); | 90 const ExtensionHostMsg_Request_Params& params); |
| 94 | 91 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 167 |
| 171 // This map doesn't own either the keys or the values. When a RenderViewHost | 168 // This map doesn't own either the keys or the values. When a RenderViewHost |
| 172 // instance goes away, the corresponding entry in this map (if exists) will be | 169 // instance goes away, the corresponding entry in this map (if exists) will be |
| 173 // removed. | 170 // removed. |
| 174 typedef std::map<content::RenderViewHost*, UIThreadResponseCallbackWrapper*> | 171 typedef std::map<content::RenderViewHost*, UIThreadResponseCallbackWrapper*> |
| 175 UIThreadResponseCallbackWrapperMap; | 172 UIThreadResponseCallbackWrapperMap; |
| 176 UIThreadResponseCallbackWrapperMap ui_thread_response_callback_wrappers_; | 173 UIThreadResponseCallbackWrapperMap ui_thread_response_callback_wrappers_; |
| 177 }; | 174 }; |
| 178 | 175 |
| 179 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 176 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
| OLD | NEW |