| 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 "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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |