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

Unified Diff: webkit/tools/test_shell/test_shell_devtools_agent.cc

Issue 15028002: Delete test_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add dummy test_shell build target. 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/test_shell/test_shell_devtools_agent.cc
diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.cc b/webkit/tools/test_shell/test_shell_devtools_agent.cc
deleted file mode 100644
index 54e6825a9f19bb8aeb5bdf7a4653856885581ae6..0000000000000000000000000000000000000000
--- a/webkit/tools/test_shell/test_shell_devtools_agent.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "webkit/tools/test_shell/test_shell_devtools_agent.h"
-
-#include "base/bind.h"
-#include "base/message_loop.h"
-#include "grit/webkit_chromium_resources.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
-#include "webkit/tools/test_shell/test_shell_devtools_callargs.h"
-#include "webkit/tools/test_shell/test_shell_devtools_client.h"
-#include "webkit/glue/webkit_glue.h"
-
-using WebKit::WebCString;
-using WebKit::WebDevToolsAgent;
-using WebKit::WebDevToolsMessageData;
-using WebKit::WebString;
-using WebKit::WebView;
-
-namespace {
-
-class WebKitClientMessageLoopImpl
- : public WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop {
- public:
- WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { }
- virtual ~WebKitClientMessageLoopImpl() {
- message_loop_ = NULL;
- }
- virtual void run() {
- MessageLoop::ScopedNestableTaskAllower allow(message_loop_);
- message_loop_->Run();
- }
- virtual void quitNow() {
- message_loop_->QuitNow();
- }
- private:
- MessageLoop* message_loop_;
-};
-
-} // namespace
-
-TestShellDevToolsAgent::TestShellDevToolsAgent()
- : weak_factory_(this),
- dev_tools_client_(NULL) {
- static int dev_tools_agent_counter;
- routing_id_ = ++dev_tools_agent_counter;
-}
-
-TestShellDevToolsAgent::~TestShellDevToolsAgent() {
-}
-
-void TestShellDevToolsAgent::SetWebView(WebKit::WebView* web_view) {
- web_view_ = web_view;
-}
-
-void TestShellDevToolsAgent::sendMessageToInspectorFrontend(
- const WebString& data) {
- if (dev_tools_client_)
- dev_tools_client_->AsyncCall(TestShellDevToolsCallArgs(data));
-}
-
-int TestShellDevToolsAgent::hostIdentifier() {
- return routing_id_;
-}
-
-void TestShellDevToolsAgent::runtimePropertyChanged(
- const WebKit::WebString& name,
- const WebKit::WebString& value) {
- // TODO: Implement.
-}
-
-WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
- TestShellDevToolsAgent::createClientMessageLoop() {
- return new WebKitClientMessageLoopImpl();
-}
-
-void TestShellDevToolsAgent::AsyncCall(const TestShellDevToolsCallArgs &args) {
- MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&TestShellDevToolsAgent::Call, weak_factory_.GetWeakPtr(),
- args));
-}
-
-void TestShellDevToolsAgent::Call(const TestShellDevToolsCallArgs &args) {
- WebDevToolsAgent* web_agent = GetWebAgent();
- if (web_agent)
- web_agent->dispatchOnInspectorBackend(args.data_);
- if (TestShellDevToolsCallArgs::calls_count() == 1 && dev_tools_client_)
- dev_tools_client_->all_messages_processed();
-}
-
-WebDevToolsAgent* TestShellDevToolsAgent::GetWebAgent() {
- if (!web_view_)
- return NULL;
- return web_view_->devToolsAgent();
-}
-
-void TestShellDevToolsAgent::attach(TestShellDevToolsClient* client) {
- DCHECK(!dev_tools_client_);
- dev_tools_client_ = client;
- WebDevToolsAgent *web_agent = GetWebAgent();
- if (web_agent)
- web_agent->attach();
-}
-
-void TestShellDevToolsAgent::detach() {
- DCHECK(dev_tools_client_);
- WebDevToolsAgent* web_agent = GetWebAgent();
- if (web_agent)
- web_agent->detach();
- dev_tools_client_ = NULL;
-}
-
-bool TestShellDevToolsAgent::evaluateInWebInspector(
- long call_id,
- const std::string& script) {
- WebDevToolsAgent* agent = GetWebAgent();
- if (!agent)
- return false;
- agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script));
- return true;
-}

Powered by Google App Engine
This is Rietveld 408576698