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

Unified Diff: content/browser/devtools/protocol/target_auto_attacher.cc

Issue 2944523002: Improving flat containers interface. (Closed)
Patch Set: Other platforms compilation 2. Created 3 years, 5 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 | « components/viz/service/display/surface_aggregator.cc ('k') | ui/events/blink/input_handler_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/target_auto_attacher.cc
diff --git a/content/browser/devtools/protocol/target_auto_attacher.cc b/content/browser/devtools/protocol/target_auto_attacher.cc
index 06064c02e4e5220df7fdcc65f8dcf6b5b38f4391..90e566decb5252d2792d322bf5a1f9d8bc008ecf 100644
--- a/content/browser/devtools/protocol/target_auto_attacher.cc
+++ b/content/browser/devtools/protocol/target_auto_attacher.cc
@@ -134,7 +134,7 @@ void TargetAutoAttacher::UpdateFrames() {
}
void TargetAutoAttacher::AgentHostClosed(DevToolsAgentHost* host) {
- auto_attached_hosts_.erase(host);
+ auto_attached_hosts_.erase(make_scoped_refptr(host));
}
void TargetAutoAttacher::ReattachServiceWorkers(bool waiting_for_debugger) {
@@ -166,17 +166,15 @@ void TargetAutoAttacher::ReattachTargetsOfType(const Hosts& new_hosts,
const std::string& type,
bool waiting_for_debugger) {
Hosts old_hosts = auto_attached_hosts_;
- for (auto& it : old_hosts) {
- DevToolsAgentHost* host = it.get();
+ for (auto& host : old_hosts) {
if (host->GetType() == type && new_hosts.find(host) == new_hosts.end()) {
auto_attached_hosts_.erase(host);
- detach_callback_.Run(host);
+ detach_callback_.Run(host.get());
}
}
- for (auto& it : new_hosts) {
- DevToolsAgentHost* host = it.get();
+ for (auto& host : new_hosts) {
if (old_hosts.find(host) == old_hosts.end()) {
- attach_callback_.Run(host, waiting_for_debugger);
+ attach_callback_.Run(host.get(), waiting_for_debugger);
auto_attached_hosts_.insert(host);
}
}
« no previous file with comments | « components/viz/service/display/surface_aggregator.cc ('k') | ui/events/blink/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698