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

Unified Diff: extensions/browser/extension_function_dispatcher.cc

Issue 2850533002: Store unique_ptr instead of raw poiter in extension callback map (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extension_function_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function_dispatcher.cc
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc
index a2ec0ef04d664f135e0ac4144e905a3445bb0883..ad4acc26b400b8aaecfbabc009aa2bcb3535b61d 100644
--- a/extensions/browser/extension_function_dispatcher.cc
+++ b/extensions/browser/extension_function_dispatcher.cc
@@ -140,8 +140,6 @@ class ExtensionFunctionDispatcher::UIThreadResponseCallbackWrapper
dispatcher_->ui_thread_response_callback_wrappers_
.erase(render_frame_host);
}
-
- delete this;
}
ExtensionFunction::ResponseCallback CreateCallback(int request_id) {
@@ -370,9 +368,9 @@ void ExtensionFunctionDispatcher::Dispatch(
callback_wrapper =
new UIThreadResponseCallbackWrapper(AsWeakPtr(), render_frame_host);
ui_thread_response_callback_wrappers_[render_frame_host] =
- callback_wrapper;
+ base::WrapUnique(callback_wrapper);
} else {
- callback_wrapper = iter->second;
+ callback_wrapper = iter->second.get();
}
DispatchWithCallbackInternal(
params, render_frame_host, render_process_id,
« no previous file with comments | « extensions/browser/extension_function_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698