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

Side by Side Diff: webkit/tools/test_shell/test_shell_devtools_agent.cc

Issue 9384024: Prefer ScopedNestableTaskAllower over manual save/restore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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) 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 "webkit/tools/test_shell/test_shell_devtools_agent.h" 5 #include "webkit/tools/test_shell/test_shell_devtools_agent.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "grit/webkit_chromium_resources.h" 9 #include "grit/webkit_chromium_resources.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h"
(...skipping 11 matching lines...) Expand all
22 namespace { 22 namespace {
23 23
24 class WebKitClientMessageLoopImpl 24 class WebKitClientMessageLoopImpl
25 : public WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop { 25 : public WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop {
26 public: 26 public:
27 WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { } 27 WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { }
28 virtual ~WebKitClientMessageLoopImpl() { 28 virtual ~WebKitClientMessageLoopImpl() {
29 message_loop_ = NULL; 29 message_loop_ = NULL;
30 } 30 }
31 virtual void run() { 31 virtual void run() {
32 bool old_state = message_loop_->NestableTasksAllowed(); 32 MessageLoop::ScopedNestableTaskAllower allow(message_loop_);
33 message_loop_->SetNestableTasksAllowed(true);
34 message_loop_->Run(); 33 message_loop_->Run();
35 message_loop_->SetNestableTasksAllowed(old_state);
36 } 34 }
37 virtual void quitNow() { 35 virtual void quitNow() {
38 message_loop_->QuitNow(); 36 message_loop_->QuitNow();
39 } 37 }
40 private: 38 private:
41 MessageLoop* message_loop_; 39 MessageLoop* message_loop_;
42 }; 40 };
43 41
44 } // namespace 42 } // namespace
45 43
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 115
118 bool TestShellDevToolsAgent::evaluateInWebInspector( 116 bool TestShellDevToolsAgent::evaluateInWebInspector(
119 long call_id, 117 long call_id,
120 const std::string& script) { 118 const std::string& script) {
121 WebDevToolsAgent* agent = GetWebAgent(); 119 WebDevToolsAgent* agent = GetWebAgent();
122 if (!agent) 120 if (!agent)
123 return false; 121 return false;
124 agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script)); 122 agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script));
125 return true; 123 return true;
126 } 124 }
OLDNEW
« webkit/plugins/ppapi/ppb_flash_message_loop_impl.cc ('K') | « webkit/support/webkit_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698