Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: extensions/browser/extension_function_dispatcher.h

Issue 2850533002: Store unique_ptr instead of raw poiter in extension callback map (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | extensions/browser/extension_function_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698