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/renderer/devtools_agent.h" | 5 #include "content/renderer/devtools_agent.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 virtual void quitNow() { | 48 virtual void quitNow() { |
49 message_loop_->QuitNow(); | 49 message_loop_->QuitNow(); |
50 } | 50 } |
51 private: | 51 private: |
52 MessageLoop* message_loop_; | 52 MessageLoop* message_loop_; |
53 }; | 53 }; |
54 | 54 |
55 typedef std::map<int, DevToolsAgent*> IdToAgentMap; | 55 typedef std::map<int, DevToolsAgent*> IdToAgentMap; |
56 base::LazyInstance<IdToAgentMap, base::LeakyLazyInstanceTraits<IdToAgentMap> > | 56 base::LazyInstance<IdToAgentMap, base::LeakyLazyInstanceTraits<IdToAgentMap> > |
57 g_agent_for_routing_id(base::LINKER_INITIALIZED); | 57 g_agent_for_routing_id = LAZY_INSTANCE_INITIALIZER; |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 DevToolsAgent::DevToolsAgent(RenderViewImpl* render_view) | 61 DevToolsAgent::DevToolsAgent(RenderViewImpl* render_view) |
62 : content::RenderViewObserver(render_view), | 62 : content::RenderViewObserver(render_view), |
63 is_attached_(false) { | 63 is_attached_(false) { |
64 g_agent_for_routing_id.Get()[routing_id()] = this; | 64 g_agent_for_routing_id.Get()[routing_id()] = this; |
65 | 65 |
66 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 66 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
67 expose_v8_debugger_protocol_ = cmd->HasSwitch(switches::kRemoteShellPort); | 67 expose_v8_debugger_protocol_ = cmd->HasSwitch(switches::kRemoteShellPort); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { | 203 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { |
204 WebView* web_view = render_view()->GetWebView(); | 204 WebView* web_view = render_view()->GetWebView(); |
205 if (!web_view) | 205 if (!web_view) |
206 return NULL; | 206 return NULL; |
207 return web_view->devToolsAgent(); | 207 return web_view->devToolsAgent(); |
208 } | 208 } |
209 | 209 |
210 bool DevToolsAgent::IsAttached() { | 210 bool DevToolsAgent::IsAttached() { |
211 return is_attached_; | 211 return is_attached_; |
212 } | 212 } |
OLD | NEW |