| 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_BROWSER_EXTENSION_FUNCTION_DISPATCHER_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_DISPATCHER_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_DISPATCHER_H_ | 6 #define EXTENSIONS_BROWSER_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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 const Extension* extension, | 139 const Extension* extension, |
| 140 int requesting_process_id, | 140 int requesting_process_id, |
| 141 const ProcessMap& process_map, | 141 const ProcessMap& process_map, |
| 142 ExtensionAPI* api, | 142 ExtensionAPI* api, |
| 143 void* profile_id, | 143 void* profile_id, |
| 144 const ExtensionFunction::ResponseCallback& callback); | 144 const ExtensionFunction::ResponseCallback& callback); |
| 145 | 145 |
| 146 // Helper to run the response callback with an access denied error. Can be | 146 // Helper to run the response callback with an access denied error. Can be |
| 147 // called on any thread. | 147 // called on any thread. |
| 148 static void SendAccessDenied( | 148 static void SendAccessDenied( |
| 149 const ExtensionFunction::ResponseCallback& callback); | 149 const ExtensionFunction::ResponseCallback& callback, |
| 150 functions::HistogramValue histogram_value); |
| 150 | 151 |
| 151 void DispatchWithCallbackInternal( | 152 void DispatchWithCallbackInternal( |
| 152 const ExtensionHostMsg_Request_Params& params, | 153 const ExtensionHostMsg_Request_Params& params, |
| 153 content::RenderViewHost* render_view_host, | 154 content::RenderViewHost* render_view_host, |
| 154 content::RenderFrameHost* render_frame_host, | 155 content::RenderFrameHost* render_frame_host, |
| 155 const ExtensionFunction::ResponseCallback& callback); | 156 const ExtensionFunction::ResponseCallback& callback); |
| 156 | 157 |
| 157 content::BrowserContext* browser_context_; | 158 content::BrowserContext* browser_context_; |
| 158 | 159 |
| 159 Delegate* delegate_; | 160 Delegate* delegate_; |
| 160 | 161 |
| 161 // This map doesn't own either the keys or the values. When a RenderViewHost | 162 // This map doesn't own either the keys or the values. When a RenderViewHost |
| 162 // instance goes away, the corresponding entry in this map (if exists) will be | 163 // instance goes away, the corresponding entry in this map (if exists) will be |
| 163 // removed. | 164 // removed. |
| 164 typedef std::map<content::RenderViewHost*, UIThreadResponseCallbackWrapper*> | 165 typedef std::map<content::RenderViewHost*, UIThreadResponseCallbackWrapper*> |
| 165 UIThreadResponseCallbackWrapperMap; | 166 UIThreadResponseCallbackWrapperMap; |
| 166 UIThreadResponseCallbackWrapperMap ui_thread_response_callback_wrappers_; | 167 UIThreadResponseCallbackWrapperMap ui_thread_response_callback_wrappers_; |
| 167 }; | 168 }; |
| 168 | 169 |
| 169 } // namespace extensions | 170 } // namespace extensions |
| 170 | 171 |
| 171 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_DISPATCHER_H_ | 172 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_DISPATCHER_H_ |
| OLD | NEW |