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

Side by Side Diff: content/renderer/devtools/devtools_agent.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/devtools_agent.h" 5 #include "content/renderer/devtools/devtools_agent.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 29 matching lines...) Expand all
40 40
41 using base::debug::TraceLog; 41 using base::debug::TraceLog;
42 42
43 namespace content { 43 namespace content {
44 44
45 namespace { 45 namespace {
46 46
47 class WebKitClientMessageLoopImpl 47 class WebKitClientMessageLoopImpl
48 : public WebDevToolsAgentClient::WebKitClientMessageLoop { 48 : public WebDevToolsAgentClient::WebKitClientMessageLoop {
49 public: 49 public:
50 WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { } 50 WebKitClientMessageLoopImpl() : message_loop_(base::MessageLoop::current()) {}
51 virtual ~WebKitClientMessageLoopImpl() { 51 virtual ~WebKitClientMessageLoopImpl() { message_loop_ = NULL; }
52 message_loop_ = NULL;
53 }
54 virtual void run() { 52 virtual void run() {
55 MessageLoop::ScopedNestableTaskAllower allow(message_loop_); 53 base::MessageLoop::ScopedNestableTaskAllower allow(message_loop_);
56 message_loop_->Run(); 54 message_loop_->Run();
57 } 55 }
58 virtual void quitNow() { 56 virtual void quitNow() {
59 message_loop_->QuitNow(); 57 message_loop_->QuitNow();
60 } 58 }
61 private: 59 private:
62 MessageLoop* message_loop_; 60 base::MessageLoop* message_loop_;
63 }; 61 };
64 62
65 typedef std::map<int, DevToolsAgent*> IdToAgentMap; 63 typedef std::map<int, DevToolsAgent*> IdToAgentMap;
66 base::LazyInstance<IdToAgentMap>::Leaky 64 base::LazyInstance<IdToAgentMap>::Leaky
67 g_agent_for_routing_id = LAZY_INSTANCE_INITIALIZER; 65 g_agent_for_routing_id = LAZY_INSTANCE_INITIALIZER;
68 66
69 } // namespace 67 } // namespace
70 68
71 DevToolsAgent::DevToolsAgent(RenderViewImpl* render_view) 69 DevToolsAgent::DevToolsAgent(RenderViewImpl* render_view)
72 : RenderViewObserver(render_view), 70 : RenderViewObserver(render_view),
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (!web_view) 255 if (!web_view)
258 return NULL; 256 return NULL;
259 return web_view->devToolsAgent(); 257 return web_view->devToolsAgent();
260 } 258 }
261 259
262 bool DevToolsAgent::IsAttached() { 260 bool DevToolsAgent::IsAttached() {
263 return is_attached_; 261 return is_attached_;
264 } 262 }
265 263
266 } // namespace content 264 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/mock_browser_plugin_manager.cc ('k') | content/renderer/devtools/devtools_agent_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698