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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 void RemoveWorkerCallbacksForProcess(int render_process_id); | 163 void RemoveWorkerCallbacksForProcess(int render_process_id); |
164 | 164 |
165 content::BrowserContext* browser_context_; | 165 content::BrowserContext* browser_context_; |
166 | 166 |
167 Delegate* delegate_; | 167 Delegate* delegate_; |
168 | 168 |
169 // This map doesn't own either the keys or the values. When a RenderFrameHost | 169 // This map doesn't own either the keys or the values. When a RenderFrameHost |
170 // instance goes away, the corresponding entry in this map (if exists) will be | 170 // instance goes away, the corresponding entry in this map (if exists) will be |
171 // removed. | 171 // removed. |
172 typedef std::map<content::RenderFrameHost*, UIThreadResponseCallbackWrapper*> | 172 typedef std::map<content::RenderFrameHost*, |
| 173 std::unique_ptr<UIThreadResponseCallbackWrapper>> |
173 UIThreadResponseCallbackWrapperMap; | 174 UIThreadResponseCallbackWrapperMap; |
174 UIThreadResponseCallbackWrapperMap ui_thread_response_callback_wrappers_; | 175 UIThreadResponseCallbackWrapperMap ui_thread_response_callback_wrappers_; |
175 | 176 |
176 using UIThreadWorkerResponseCallbackWrapperMap = | 177 using UIThreadWorkerResponseCallbackWrapperMap = |
177 std::map<WorkerResponseCallbackMapKey, | 178 std::map<WorkerResponseCallbackMapKey, |
178 std::unique_ptr<UIThreadWorkerResponseCallbackWrapper>>; | 179 std::unique_ptr<UIThreadWorkerResponseCallbackWrapper>>; |
179 // TODO(lazyboy): The map entries are cleared upon RenderProcessHost shutown, | 180 // TODO(lazyboy): The map entries are cleared upon RenderProcessHost shutown, |
180 // we should really be clearing it on service worker shutdown. | 181 // we should really be clearing it on service worker shutdown. |
181 UIThreadWorkerResponseCallbackWrapperMap | 182 UIThreadWorkerResponseCallbackWrapperMap |
182 ui_thread_response_callback_wrappers_for_worker_; | 183 ui_thread_response_callback_wrappers_for_worker_; |
183 }; | 184 }; |
184 | 185 |
185 } // namespace extensions | 186 } // namespace extensions |
186 | 187 |
187 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_DISPATCHER_H_ | 188 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_DISPATCHER_H_ |
OLD | NEW |