Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/browser/debugger/worker_devtools_manager_io.h" | 5 #include "content/browser/debugger/worker_devtools_manager_io.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/tuple.h" | 9 #include "base/tuple.h" |
| 10 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 WorkerProcessHost* const host; | 139 WorkerProcessHost* const host; |
| 140 int const route_id; | 140 int const route_id; |
| 141 }; | 141 }; |
| 142 typedef std::list<Entry> Entries; | 142 typedef std::list<Entry> Entries; |
| 143 | 143 |
| 144 Entries::iterator FindEntry(int host_id, int route_id) { | 144 Entries::iterator FindEntry(int host_id, int route_id) { |
| 145 Entries::iterator it = map_.begin(); | 145 Entries::iterator it = map_.begin(); |
| 146 while (it != map_.end()) { | 146 while (it != map_.end()) { |
| 147 if (it->host->id() == host_id && it->route_id == route_id) | 147 if (it->host->id() == host_id && it->route_id == route_id) |
| 148 break; | 148 break; |
| 149 ++it; | |
|
pfeldman1
2011/08/04 10:12:20
nice. Could you please test this?
| |
| 149 } | 150 } |
| 150 return it; | 151 return it; |
| 151 } | 152 } |
| 152 | 153 |
| 153 Entries map_; | 154 Entries map_; |
| 154 DISALLOW_COPY_AND_ASSIGN(InspectedWorkersList); | 155 DISALLOW_COPY_AND_ASSIGN(InspectedWorkersList); |
| 155 }; | 156 }; |
| 156 | 157 |
| 157 // static | 158 // static |
| 158 WorkerDevToolsManagerIO* WorkerDevToolsManagerIO::GetInstance() { | 159 WorkerDevToolsManagerIO* WorkerDevToolsManagerIO::GetInstance() { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 const IPC::Message& message) { | 312 const IPC::Message& message) { |
| 312 WorkerProcessHost* host = inspected_workers_->FindHost( | 313 WorkerProcessHost* host = inspected_workers_->FindHost( |
| 313 worker_process_host_id, | 314 worker_process_host_id, |
| 314 worker_route_id); | 315 worker_route_id); |
| 315 if (!host) | 316 if (!host) |
| 316 return; | 317 return; |
| 317 IPC::Message* msg = new IPC::Message(message); | 318 IPC::Message* msg = new IPC::Message(message); |
| 318 msg->set_routing_id(worker_route_id); | 319 msg->set_routing_id(worker_route_id); |
| 319 host->Send(msg); | 320 host->Send(msg); |
| 320 } | 321 } |
| OLD | NEW |