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

Side by Side Diff: content/browser/devtools/shared_worker_devtools_manager.cc

Issue 1496983002: DevTools: relax the check when looking up the shared workers' agent hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years 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 | no next file » | 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 #include "content/browser/devtools/shared_worker_devtools_manager.h" 5 #include "content/browser/devtools/shared_worker_devtools_manager.h"
6 6
7 #include "content/browser/devtools/shared_worker_devtools_agent_host.h" 7 #include "content/browser/devtools/shared_worker_devtools_agent_host.h"
8 #include "content/browser/shared_worker/shared_worker_instance.h" 8 #include "content/browser/shared_worker/shared_worker_instance.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 workers_[id] = agent_host; 53 workers_[id] = agent_host;
54 return true; 54 return true;
55 } 55 }
56 56
57 void SharedWorkerDevToolsManager::WorkerReadyForInspection( 57 void SharedWorkerDevToolsManager::WorkerReadyForInspection(
58 int worker_process_id, 58 int worker_process_id,
59 int worker_route_id) { 59 int worker_route_id) {
60 DCHECK_CURRENTLY_ON(BrowserThread::UI); 60 DCHECK_CURRENTLY_ON(BrowserThread::UI);
61 const WorkerId id(worker_process_id, worker_route_id); 61 const WorkerId id(worker_process_id, worker_route_id);
62 AgentHostMap::iterator it = workers_.find(id); 62 AgentHostMap::iterator it = workers_.find(id);
63 DCHECK(it != workers_.end()); 63 if (it == workers_.end())
64 return;
64 it->second->WorkerReadyForInspection(); 65 it->second->WorkerReadyForInspection();
65 } 66 }
66 67
67 void SharedWorkerDevToolsManager::WorkerDestroyed( 68 void SharedWorkerDevToolsManager::WorkerDestroyed(
68 int worker_process_id, 69 int worker_process_id,
69 int worker_route_id) { 70 int worker_route_id) {
70 DCHECK_CURRENTLY_ON(BrowserThread::UI); 71 DCHECK_CURRENTLY_ON(BrowserThread::UI);
71 const WorkerId id(worker_process_id, worker_route_id); 72 const WorkerId id(worker_process_id, worker_route_id);
72 AgentHostMap::iterator it = workers_.find(id); 73 AgentHostMap::iterator it = workers_.find(id);
73 DCHECK(it != workers_.end()); 74 if (it == workers_.end())
75 return;
74 scoped_refptr<SharedWorkerDevToolsAgentHost> agent_host(it->second); 76 scoped_refptr<SharedWorkerDevToolsAgentHost> agent_host(it->second);
75 agent_host->WorkerDestroyed(); 77 agent_host->WorkerDestroyed();
76 } 78 }
77 79
78 void SharedWorkerDevToolsManager::RemoveInspectedWorkerData(WorkerId id) { 80 void SharedWorkerDevToolsManager::RemoveInspectedWorkerData(WorkerId id) {
79 DCHECK_CURRENTLY_ON(BrowserThread::UI); 81 DCHECK_CURRENTLY_ON(BrowserThread::UI);
80 workers_.erase(id); 82 workers_.erase(id);
81 } 83 }
82 SharedWorkerDevToolsManager::SharedWorkerDevToolsManager() { 84 SharedWorkerDevToolsManager::SharedWorkerDevToolsManager() {
83 } 85 }
(...skipping 11 matching lines...) Expand all
95 } 97 }
96 return it; 98 return it;
97 } 99 }
98 100
99 void SharedWorkerDevToolsManager::ResetForTesting() { 101 void SharedWorkerDevToolsManager::ResetForTesting() {
100 workers_.clear(); 102 workers_.clear();
101 } 103 }
102 104
103 105
104 } // namespace content 106 } // namespace content
OLDNEW
« 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