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

Unified Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 290013005: DevTools: Fix use-after-free in DevToolsUIBindings::Unsubscribe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_ui_bindings.cc
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc
index 54c22ab81d156c71ce01318e904e337105de1e60..65dd55743d616701cffa933882e77e88e1d9fb4b 100644
--- a/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -596,8 +596,6 @@ void DevToolsUIBindings::Unsubscribe(const std::string& event_type) {
return;
}
- subscribers_.erase(event_type);
-
if (event_type == kDevicesChanged) {
remote_targets_handler_.reset();
} else if (event_type == kDeviceCountChanged) {
@@ -605,6 +603,8 @@ void DevToolsUIBindings::Unsubscribe(const std::string& event_type) {
} else {
LOG(ERROR) << "Attempt to stop unknown event listener " << event_type;
}
+
+ subscribers_.erase(event_type);
}
void DevToolsUIBindings::EnableRemoteDeviceCounter(bool enable) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698