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

Side by Side Diff: content/browser/debugger/devtools_manager.cc

Issue 8609010: Make DevToolsManager a singleton, remove it from ContentBrowserClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverted notification service changes, use non-leaky singleton Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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/devtools_manager.h" 5 #include "content/browser/debugger/devtools_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "content/browser/browsing_instance.h" 11 #include "content/browser/browsing_instance.h"
12 #include "content/browser/child_process_security_policy.h" 12 #include "content/browser/child_process_security_policy.h"
13 #include "content/browser/debugger/devtools_client_host.h" 13 #include "content/browser/debugger/devtools_client_host.h"
14 #include "content/browser/debugger/devtools_netlog_observer.h" 14 #include "content/browser/debugger/devtools_netlog_observer.h"
15 #include "content/browser/debugger/render_view_devtools_agent_host.h" 15 #include "content/browser/debugger/render_view_devtools_agent_host.h"
16 #include "content/browser/renderer_host/render_view_host.h" 16 #include "content/browser/renderer_host/render_view_host.h"
17 #include "content/browser/tab_contents/tab_contents.h" 17 #include "content/browser/tab_contents/tab_contents.h"
18 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
19 #include "content/public/browser/content_browser_client.h"
20 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
21 20
22 using content::BrowserThread; 21 using content::BrowserThread;
23 22
24 // static 23 // static
25 DevToolsManager* DevToolsManager::GetInstance() { 24 DevToolsManager* DevToolsManager::GetInstance() {
26 return content::GetContentClient()->browser()->GetDevToolsManager(); 25 return Singleton<DevToolsManager>::get();
27 } 26 }
28 27
29 DevToolsManager::DevToolsManager() 28 DevToolsManager::DevToolsManager()
30 : last_orphan_cookie_(0) { 29 : last_orphan_cookie_(0) {
31 } 30 }
32 31
33 DevToolsManager::~DevToolsManager() { 32 DevToolsManager::~DevToolsManager() {
34 DCHECK(agent_to_client_host_.empty()); 33 DCHECK(agent_to_client_host_.empty());
35 DCHECK(client_to_agent_host_.empty()); 34 DCHECK(client_to_agent_host_.empty());
36 // By the time we destroy devtools manager, all orphan client hosts should 35 // By the time we destroy devtools manager, all orphan client hosts should
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 for (AgentToClientHostMap::iterator it = 287 for (AgentToClientHostMap::iterator it =
289 agent_to_client_host_.begin(); 288 agent_to_client_host_.begin();
290 it != agent_to_client_host_.end(); ++it) { 289 it != agent_to_client_host_.end(); ++it) {
291 agents.push_back(it->first); 290 agents.push_back(it->first);
292 } 291 }
293 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); 292 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin();
294 it != agents.end(); ++it) { 293 it != agents.end(); ++it) {
295 UnregisterDevToolsClientHostFor(*it); 294 UnregisterDevToolsClientHostFor(*it);
296 } 295 }
297 } 296 }
OLDNEW
« no previous file with comments | « content/browser/debugger/devtools_manager.h ('k') | content/browser/debugger/devtools_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698