Commit 100f1a19 authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

DevTools: Remove base/ dependencies from glue/devtools

BUG=24622,24597

Review URL: http://codereview.chromium.org/330029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30330 0039d316-1c4b-4281-b951-d872f2087c98
parent 3af0c5be
...@@ -10,16 +10,17 @@ ...@@ -10,16 +10,17 @@
#include "chrome/common/render_messages.h" #include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h" #include "chrome/renderer/render_thread.h"
#include "chrome/renderer/render_view.h" #include "chrome/renderer/render_view.h"
#include "webkit/api/public/WebDevToolsFrontend.h"
#include "webkit/api/public/WebString.h" #include "webkit/api/public/WebString.h"
#include "webkit/glue/webdevtoolsclient.h"
using WebKit::WebDevToolsFrontend;
using WebKit::WebString; using WebKit::WebString;
DevToolsClient::DevToolsClient(RenderView* view) DevToolsClient::DevToolsClient(RenderView* view)
: render_view_(view) { : render_view_(view) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
web_tools_client_.reset( web_tools_frontend_.reset(
WebDevToolsClient::Create( WebDevToolsFrontend::create(
view->webview(), view->webview(),
this, this,
WideToUTF16Hack(command_line.GetSwitchValue(switches::kLang)))); WideToUTF16Hack(command_line.GetSwitchValue(switches::kLang))));
...@@ -46,7 +47,7 @@ bool DevToolsClient::OnMessageReceived(const IPC::Message& message) { ...@@ -46,7 +47,7 @@ bool DevToolsClient::OnMessageReceived(const IPC::Message& message) {
return handled; return handled;
} }
void DevToolsClient::SendMessageToAgent(const WebString& class_name, void DevToolsClient::sendMessageToAgent(const WebString& class_name,
const WebString& method_name, const WebString& method_name,
const WebString& param1, const WebString& param1,
const WebString& param2, const WebString& param2,
...@@ -59,31 +60,31 @@ void DevToolsClient::SendMessageToAgent(const WebString& class_name, ...@@ -59,31 +60,31 @@ void DevToolsClient::SendMessageToAgent(const WebString& class_name,
param3.utf8())); param3.utf8()));
} }
void DevToolsClient::SendDebuggerCommandToAgent(const WebString& command) { void DevToolsClient::sendDebuggerCommandToAgent(const WebString& command) {
Send(DevToolsAgentMsg_DebuggerCommand(command.utf8())); Send(DevToolsAgentMsg_DebuggerCommand(command.utf8()));
} }
void DevToolsClient::ActivateWindow() { void DevToolsClient::activateWindow() {
render_view_->Send(new ViewHostMsg_ActivateDevToolsWindow( render_view_->Send(new ViewHostMsg_ActivateDevToolsWindow(
render_view_->routing_id())); render_view_->routing_id()));
} }
void DevToolsClient::CloseWindow() { void DevToolsClient::closeWindow() {
render_view_->Send(new ViewHostMsg_CloseDevToolsWindow( render_view_->Send(new ViewHostMsg_CloseDevToolsWindow(
render_view_->routing_id())); render_view_->routing_id()));
} }
void DevToolsClient::DockWindow() { void DevToolsClient::dockWindow() {
render_view_->Send(new ViewHostMsg_DockDevToolsWindow( render_view_->Send(new ViewHostMsg_DockDevToolsWindow(
render_view_->routing_id())); render_view_->routing_id()));
} }
void DevToolsClient::UndockWindow() { void DevToolsClient::undockWindow() {
render_view_->Send(new ViewHostMsg_UndockDevToolsWindow( render_view_->Send(new ViewHostMsg_UndockDevToolsWindow(
render_view_->routing_id())); render_view_->routing_id()));
} }
void DevToolsClient::ToggleInspectElementMode(bool enabled) { void DevToolsClient::toggleInspectElementMode(bool enabled) {
render_view_->Send(new ViewHostMsg_ToggleInspectElementMode( render_view_->Send(new ViewHostMsg_ToggleInspectElementMode(
render_view_->routing_id(), enabled)); render_view_->routing_id(), enabled));
} }
...@@ -94,7 +95,7 @@ void DevToolsClient::OnRpcMessage(const std::string& class_name, ...@@ -94,7 +95,7 @@ void DevToolsClient::OnRpcMessage(const std::string& class_name,
const std::string& param1, const std::string& param1,
const std::string& param2, const std::string& param2,
const std::string& param3) { const std::string& param3) {
web_tools_client_->DispatchMessageFromAgent( web_tools_frontend_->dispatchMessageFromAgent(
WebString::fromUTF8(class_name), WebString::fromUTF8(class_name),
WebString::fromUTF8(method_name), WebString::fromUTF8(method_name),
WebString::fromUTF8(param1), WebString::fromUTF8(param1),
......
...@@ -7,15 +7,19 @@ ...@@ -7,15 +7,19 @@
#include <string> #include <string>
#include "base/basictypes.h"
#include "base/scoped_ptr.h" #include "base/scoped_ptr.h"
#include "webkit/glue/webdevtoolsclient_delegate.h" #include "webkit/api/public/WebDevToolsFrontendClient.h"
namespace IPC { namespace IPC {
class Message; class Message;
} }
class MessageLoop; class MessageLoop;
class RenderView; class RenderView;
class WebDevToolsClient;
namespace WebKit {
class WebDevToolsFrontend;
}
// Developer tools UI end of communication channel between the render process of // Developer tools UI end of communication channel between the render process of
// the page being inspected and tools UI renderer process. All messages will // the page being inspected and tools UI renderer process. All messages will
...@@ -23,7 +27,7 @@ class WebDevToolsClient; ...@@ -23,7 +27,7 @@ class WebDevToolsClient;
// corresponding DevToolsAgent object. // corresponding DevToolsAgent object.
// TODO(yurys): now the client is almost empty later it will delegate calls to // TODO(yurys): now the client is almost empty later it will delegate calls to
// code in glue // code in glue
class DevToolsClient : public WebDevToolsClientDelegate { class DevToolsClient : public WebKit::WebDevToolsFrontendClient {
public: public:
explicit DevToolsClient(RenderView* view); explicit DevToolsClient(RenderView* view);
virtual ~DevToolsClient(); virtual ~DevToolsClient();
...@@ -32,19 +36,19 @@ class DevToolsClient : public WebDevToolsClientDelegate { ...@@ -32,19 +36,19 @@ class DevToolsClient : public WebDevToolsClientDelegate {
// handled. Called in render thread. // handled. Called in render thread.
bool OnMessageReceived(const IPC::Message& message); bool OnMessageReceived(const IPC::Message& message);
// WebDevToolsClient::Delegate implementation // WebDevToolsFrontendClient implementation
virtual void SendMessageToAgent(const WebKit::WebString& class_name, virtual void sendMessageToAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name, const WebKit::WebString& method_name,
const WebKit::WebString& param1, const WebKit::WebString& param1,
const WebKit::WebString& param2, const WebKit::WebString& param2,
const WebKit::WebString& param3); const WebKit::WebString& param3);
virtual void SendDebuggerCommandToAgent(const WebKit::WebString& command); virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command);
virtual void ActivateWindow(); virtual void activateWindow();
virtual void CloseWindow(); virtual void closeWindow();
virtual void DockWindow(); virtual void dockWindow();
virtual void UndockWindow(); virtual void undockWindow();
virtual void ToggleInspectElementMode(bool enabled); virtual void toggleInspectElementMode(bool enabled);
private: private:
void OnRpcMessage(const std::string& class_name, void OnRpcMessage(const std::string& class_name,
...@@ -57,7 +61,7 @@ class DevToolsClient : public WebDevToolsClientDelegate { ...@@ -57,7 +61,7 @@ class DevToolsClient : public WebDevToolsClientDelegate {
void Send(const IPC::Message& tools_agent_message); void Send(const IPC::Message& tools_agent_message);
RenderView* render_view_; // host render view RenderView* render_view_; // host render view
scoped_ptr<WebDevToolsClient> web_tools_client_; scoped_ptr<WebKit::WebDevToolsFrontend> web_tools_frontend_;
DISALLOW_COPY_AND_ASSIGN(DevToolsClient); DISALLOW_COPY_AND_ASSIGN(DevToolsClient);
}; };
......
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebDevToolsFrontend_h
#define WebDevToolsFrontend_h
#include "WebCommon.h"
namespace WebKit {
class WebDevToolsFrontendClient;
class WebString;
class WebView;
// WebDevToolsFrontend represents DevTools client sitting in the Glue. It provides
// direct and delegate Apis to the host.
class WebDevToolsFrontend {
public:
static WebDevToolsFrontend* create(WebView* view,
WebDevToolsFrontendClient* client,
const WebString& applicationLocale);
WebDevToolsFrontend() {}
virtual ~WebDevToolsFrontend() {}
virtual void dispatchMessageFromAgent(const WebString& className,
const WebString& methodName,
const WebString& param1,
const WebString& param2,
const WebString& param3) = 0;
};
} // namespace WebKit
#endif
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebDevToolsFrontendClient_h
#define WebDevToolsFrontendClient_h
namespace WebKit {
class WebString;
class WebDevToolsFrontendClient {
public:
WebDevToolsFrontendClient() {}
virtual void sendMessageToAgent(const WebString& className,
const WebString& methodName,
const WebString& param1,
const WebString& param2,
const WebString& param3) = 0;
virtual void sendDebuggerCommandToAgent(const WebString& command) = 0;
virtual void activateWindow() = 0;
virtual void closeWindow() = 0;
virtual void dockWindow() = 0;
virtual void undockWindow() = 0;
virtual void toggleInspectElementMode(bool enabled) = 0;
protected:
virtual ~WebDevToolsFrontendClient() {}
};
} // namespace WebKit
#endif
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
#ifndef WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_ #ifndef WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
#define WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_ #define WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
#include <wtf/Noncopyable.h>
#include "v8.h" #include "v8.h"
// BoundObject lets you map JavaScript method calls and property accesses // BoundObject lets you map JavaScript method calls and property accesses
// directly to C++ method calls and V8 variable access. // directly to C++ method calls and V8 variable access.
class BoundObject { class BoundObject : public Noncopyable {
public: public:
BoundObject(v8::Handle<v8::Context> context, BoundObject(v8::Handle<v8::Context> context,
void* v8_this, void* v8_this,
...@@ -25,7 +27,6 @@ class BoundObject { ...@@ -25,7 +27,6 @@ class BoundObject {
v8::Persistent<v8::FunctionTemplate> host_template_; v8::Persistent<v8::FunctionTemplate> host_template_;
v8::Persistent<v8::External> v8_this_; v8::Persistent<v8::External> v8_this_;
v8::Persistent<v8::Object> bound_object_; v8::Persistent<v8::Object> bound_object_;
DISALLOW_COPY_AND_ASSIGN(BoundObject);
}; };
#endif // WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_ #endif // WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "V8Proxy.h" #include "V8Proxy.h"
#undef LOG #undef LOG
#include "base/string_piece.h"
#include "grit/webkit_resources.h" #include "grit/webkit_resources.h"
#include "webkit/glue/devtools/debugger_agent_impl.h" #include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h" #include "webkit/glue/devtools/debugger_agent_manager.h"
...@@ -62,7 +61,7 @@ void DebuggerAgentImpl::GetContextId() { ...@@ -62,7 +61,7 @@ void DebuggerAgentImpl::GetContextId() {
void DebuggerAgentImpl::StartProfiling(int flags) { void DebuggerAgentImpl::StartProfiling(int flags) {
v8::HandleScope scope; v8::HandleScope scope;
WebCore::Frame* frame = GetPage()->mainFrame(); WebCore::Frame* frame = GetPage()->mainFrame();
DCHECK(V8Proxy::retrieve(GetPage()->mainFrame())->isContextInitialized()); ASSERT(V8Proxy::retrieve(GetPage()->mainFrame())->isContextInitialized());
v8::Context::Scope context_scope(V8Proxy::context(frame)); v8::Context::Scope context_scope(V8Proxy::context(frame));
v8::V8::ResumeProfilerEx(flags); v8::V8::ResumeProfilerEx(flags);
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_ #define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_
#include <wtf/HashSet.h> #include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include "v8.h" #include "v8.h"
#include "webkit/glue/devtools/debugger_agent.h" #include "webkit/glue/devtools/debugger_agent.h"
...@@ -72,8 +73,6 @@ class DebuggerAgentImpl : public DebuggerAgent { ...@@ -72,8 +73,6 @@ class DebuggerAgentImpl : public DebuggerAgent {
DebuggerAgentDelegate* delegate_; DebuggerAgentDelegate* delegate_;
WebDevToolsAgentImpl* webdevtools_agent_; WebDevToolsAgentImpl* webdevtools_agent_;
int profiler_log_position_; int profiler_log_position_;
DISALLOW_COPY_AND_ASSIGN(DebuggerAgentImpl);
}; };
#endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_ #endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <wtf/HashSet.h> #include <wtf/HashSet.h>
#undef LOG #undef LOG
#include "base/string_util.h"
#include "webkit/api/public/WebDevToolsAgent.h" #include "webkit/api/public/WebDevToolsAgent.h"
#include "webkit/glue/devtools/debugger_agent_impl.h" #include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h" #include "webkit/glue/devtools/debugger_agent_manager.h"
...@@ -117,18 +116,18 @@ void DebuggerAgentManager::DebugAttach(DebuggerAgentImpl* debugger_agent) { ...@@ -117,18 +116,18 @@ void DebuggerAgentManager::DebugAttach(DebuggerAgentImpl* debugger_agent) {
&DebuggerAgentManager::V8DebugHostDispatchHandler, 100 /* ms */); &DebuggerAgentManager::V8DebugHostDispatchHandler, 100 /* ms */);
} }
int host_id = debugger_agent->webdevtools_agent()->host_id(); int host_id = debugger_agent->webdevtools_agent()->host_id();
DCHECK(host_id != 0); ASSERT(host_id != 0);
attached_agents_map_->set(host_id, debugger_agent); attached_agents_map_->set(host_id, debugger_agent);
} }
// static // static
void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) { void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) {
if (!attached_agents_map_) { if (!attached_agents_map_) {
NOTREACHED(); ASSERT_NOT_REACHED();
return; return;
} }
int host_id = debugger_agent->webdevtools_agent()->host_id(); int host_id = debugger_agent->webdevtools_agent()->host_id();
DCHECK(attached_agents_map_->get(host_id) == debugger_agent); ASSERT(attached_agents_map_->get(host_id) == debugger_agent);
bool is_on_breakpoint = (FindAgentForCurrentV8Context() == debugger_agent); bool is_on_breakpoint = (FindAgentForCurrentV8Context() == debugger_agent);
attached_agents_map_->remove(host_id); attached_agents_map_->remove(host_id);
...@@ -163,7 +162,7 @@ void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) { ...@@ -163,7 +162,7 @@ void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) {
// static // static
void DebuggerAgentManager::DebugBreak(DebuggerAgentImpl* debugger_agent) { void DebuggerAgentManager::DebugBreak(DebuggerAgentImpl* debugger_agent) {
#if USE(V8) #if USE(V8)
DCHECK(DebuggerAgentForHostId(debugger_agent->webdevtools_agent()->host_id()) ASSERT(DebuggerAgentForHostId(debugger_agent->webdevtools_agent()->host_id())
== debugger_agent); == debugger_agent);
if (in_utility_context_) { if (in_utility_context_) {
debug_break_delayed_ = true; debug_break_delayed_ = true;
...@@ -196,7 +195,7 @@ void DebuggerAgentManager::OnV8DebugMessage(const v8::Debug::Message& message) { ...@@ -196,7 +195,7 @@ void DebuggerAgentManager::OnV8DebugMessage(const v8::Debug::Message& message) {
} }
return; return;
} // Otherwise it's an event message. } // Otherwise it's an event message.
DCHECK(message.IsEvent()); ASSERT(message.IsEvent());
// Ignore unsupported event types. // Ignore unsupported event types.
if (message.GetEvent() != v8::AfterCompile && if (message.GetEvent() != v8::AfterCompile &&
...@@ -254,7 +253,7 @@ void DebuggerAgentManager::SetMessageLoopDispatchHandler( ...@@ -254,7 +253,7 @@ void DebuggerAgentManager::SetMessageLoopDispatchHandler(
// static // static
void DebuggerAgentManager::SetHostId(WebFrameImpl* webframe, int host_id) { void DebuggerAgentManager::SetHostId(WebFrameImpl* webframe, int host_id) {
DCHECK(host_id > 0); ASSERT(host_id > 0);
WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame()); WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame());
if (proxy) { if (proxy) {
proxy->setContextDebugId(host_id); proxy->setContextDebugId(host_id);
...@@ -297,7 +296,7 @@ DebuggerAgentImpl* DebuggerAgentManager::FindAgentForCurrentV8Context() { ...@@ -297,7 +296,7 @@ DebuggerAgentImpl* DebuggerAgentManager::FindAgentForCurrentV8Context() {
if (!attached_agents_map_) { if (!attached_agents_map_) {
return NULL; return NULL;
} }
DCHECK(!attached_agents_map_->isEmpty()); ASSERT(!attached_agents_map_->isEmpty());
WebCore::Frame* frame = WebCore::V8Proxy::retrieveFrameForEnteredContext(); WebCore::Frame* frame = WebCore::V8Proxy::retrieveFrameForEnteredContext();
if (!frame) { if (!frame) {
......
...@@ -6,9 +6,8 @@ ...@@ -6,9 +6,8 @@
#define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ #define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_
#include <wtf/HashMap.h> #include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include "base/basictypes.h"
#include "base/logging.h"
#include "v8/include/v8-debug.h" #include "v8/include/v8-debug.h"
#include "webkit/api/public/WebDevToolsAgent.h" #include "webkit/api/public/WebDevToolsAgent.h"
...@@ -33,7 +32,7 @@ class WebViewImpl; ...@@ -33,7 +32,7 @@ class WebViewImpl;
// would expect some actions from the handler. If there is no appropriate // would expect some actions from the handler. If there is no appropriate
// debugger agent to handle such messages the manager will perform the action // debugger agent to handle such messages the manager will perform the action
// itself, otherwise v8 may hang waiting for the action. // itself, otherwise v8 may hang waiting for the action.
class DebuggerAgentManager { class DebuggerAgentManager : public Noncopyable {
public: public:
static void DebugAttach(DebuggerAgentImpl* debugger_agent); static void DebugAttach(DebuggerAgentImpl* debugger_agent);
static void DebugDetach(DebuggerAgentImpl* debugger_agent); static void DebugDetach(DebuggerAgentImpl* debugger_agent);
...@@ -53,10 +52,10 @@ class DebuggerAgentManager { ...@@ -53,10 +52,10 @@ class DebuggerAgentManager {
static void OnNavigate(); static void OnNavigate();
class UtilityContextScope { class UtilityContextScope : public Noncopyable {
public: public:
UtilityContextScope() { UtilityContextScope() {
DCHECK(!in_utility_context_); ASSERT(!in_utility_context_);
in_utility_context_ = true; in_utility_context_ = true;
} }
~UtilityContextScope() { ~UtilityContextScope() {
...@@ -66,8 +65,6 @@ class DebuggerAgentManager { ...@@ -66,8 +65,6 @@ class DebuggerAgentManager {
} }
in_utility_context_ = false; in_utility_context_ = false;
} }
private:
DISALLOW_COPY_AND_ASSIGN(UtilityContextScope);
}; };
private: private:
...@@ -95,8 +92,6 @@ class DebuggerAgentManager { ...@@ -95,8 +92,6 @@ class DebuggerAgentManager {
static bool in_utility_context_; static bool in_utility_context_;
static bool debug_break_delayed_; static bool debug_break_delayed_;
DISALLOW_COPY_AND_ASSIGN(DebuggerAgentManager);
}; };
#endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ #endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_
...@@ -52,9 +52,7 @@ ...@@ -52,9 +52,7 @@
#include "PlatformString.h" #include "PlatformString.h"
// TODO(darin): Remove these dependencies on Chromium base/. #include <wtf/Noncopyable.h>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
namespace WebCore { namespace WebCore {
class String; class String;
...@@ -74,7 +72,7 @@ template<> ...@@ -74,7 +72,7 @@ template<>
struct RpcTypeTrait<bool> { struct RpcTypeTrait<bool> {
typedef bool ApiType; typedef bool ApiType;
static bool Parse(const WebCore::String& t) { static bool Parse(const WebCore::String& t) {
ALLOW_UNUSED bool success; bool success;
int i = t.toIntStrict(&success); int i = t.toIntStrict(&success);
ASSERT(success); ASSERT(success);
return i; return i;
...@@ -88,7 +86,7 @@ template<> ...@@ -88,7 +86,7 @@ template<>
struct RpcTypeTrait<int> { struct RpcTypeTrait<int> {
typedef int ApiType; typedef int ApiType;
static int Parse(const WebCore::String& t) { static int Parse(const WebCore::String& t) {
ALLOW_UNUSED bool success; bool success;
int i = t.toIntStrict(&success); int i = t.toIntStrict(&success);
ASSERT(success); ASSERT(success);
return i; return i;
...@@ -206,7 +204,7 @@ if (method_name == #Method) { \ ...@@ -206,7 +204,7 @@ if (method_name == #Method) { \
// serializing method calls and ClassDispatch that is capable of dispatching // serializing method calls and ClassDispatch that is capable of dispatching
// the serialized message into its delegate. // the serialized message into its delegate.
#define DEFINE_RPC_CLASS(Class, STRUCT) \ #define DEFINE_RPC_CLASS(Class, STRUCT) \
class Class {\ class Class : public Noncopyable {\
public: \ public: \
Class() { \ Class() { \
class_name = #Class; \ class_name = #Class; \
...@@ -219,11 +217,11 @@ class Class {\ ...@@ -219,11 +217,11 @@ class Class {\
TOOLS_RPC_API_METHOD2, \ TOOLS_RPC_API_METHOD2, \
TOOLS_RPC_API_METHOD3) \ TOOLS_RPC_API_METHOD3) \
WebCore::String class_name; \ WebCore::String class_name; \
private: \
DISALLOW_COPY_AND_ASSIGN(Class); \
}; \ }; \
\ \
class Class##Stub : public Class, public DevToolsRpc { \ class Class##Stub \
: public Class, \
public DevToolsRpc { \
public: \ public: \
explicit Class##Stub(Delegate* delegate) : DevToolsRpc(delegate) {} \ explicit Class##Stub(Delegate* delegate) : DevToolsRpc(delegate) {} \
virtual ~Class##Stub() {} \ virtual ~Class##Stub() {} \
...@@ -233,11 +231,9 @@ class Class##Stub : public Class, public DevToolsRpc { \ ...@@ -233,11 +231,9 @@ class Class##Stub : public Class, public DevToolsRpc { \
TOOLS_RPC_STUB_METHOD1, \ TOOLS_RPC_STUB_METHOD1, \
TOOLS_RPC_STUB_METHOD2, \ TOOLS_RPC_STUB_METHOD2, \
TOOLS_RPC_STUB_METHOD3) \ TOOLS_RPC_STUB_METHOD3) \
private: \
DISALLOW_COPY_AND_ASSIGN(Class##Stub); \
}; \ }; \
\ \
class Class##Dispatch { \ class Class##Dispatch : public Noncopyable { \
public: \ public: \
Class##Dispatch() {} \ Class##Dispatch() {} \
virtual ~Class##Dispatch() {} \ virtual ~Class##Dispatch() {} \
...@@ -259,8 +255,6 @@ class Class##Dispatch { \ ...@@ -259,8 +255,6 @@ class Class##Dispatch { \
TOOLS_RPC_DISPATCH3) \ TOOLS_RPC_DISPATCH3) \
return false; \ return false; \
} \ } \
private: \
DISALLOW_COPY_AND_ASSIGN(Class##Dispatch); \
}; };
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
...@@ -276,8 +270,6 @@ class DevToolsRpc { ...@@ -276,8 +270,6 @@ class DevToolsRpc {
const WebCore::String& p1 = "", const WebCore::String& p1 = "",
const WebCore::String& p2 = "", const WebCore::String& p2 = "",
const WebCore::String& p3 = "") = 0; const WebCore::String& p3 = "") = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Delegate);
}; };
explicit DevToolsRpc(Delegate* delegate) explicit DevToolsRpc(Delegate* delegate)
...@@ -286,8 +278,6 @@ class DevToolsRpc { ...@@ -286,8 +278,6 @@ class DevToolsRpc {
protected: protected:
Delegate* delegate_; Delegate* delegate_;
private:
DISALLOW_COPY_AND_ASSIGN(DevToolsRpc);
}; };
#endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_H_ #endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_H_
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
#define WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_ #define WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_
// Do not remove this one although it is not used. // Do not remove this one although it is not used.
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h> #include <wtf/OwnPtr.h>
#include "base/basictypes.h"
#include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebFrame.h"
#include "webkit/glue/devtools/bound_object.h" #include "webkit/glue/devtools/bound_object.h"
#include "webkit/glue/devtools/devtools_rpc.h" #include "webkit/glue/devtools/devtools_rpc.h"
...@@ -106,7 +106,6 @@ class Js##Class##BoundObj : public Class##Stub { \ ...@@ -106,7 +106,6 @@ class Js##Class##BoundObj : public Class##Stub { \
param3); \ param3); \
} \ } \
OwnPtr<BoundObject> bound_obj_; \ OwnPtr<BoundObject> bound_obj_; \
DISALLOW_COPY_AND_ASSIGN(Js##Class##BoundObj); \
}; };
#endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_ #endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_
...@@ -119,7 +119,6 @@ class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgent, ...@@ -119,7 +119,6 @@ class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgent,
v8::Persistent<v8::Context> utility_context_; v8::Persistent<v8::Context> utility_context_;
OwnPtr<BoundObject> devtools_agent_host_; OwnPtr<BoundObject> devtools_agent_host_;
OwnPtr<WebCore::ScriptState> inspector_frontend_script_state_; OwnPtr<WebCore::ScriptState> inspector_frontend_script_state_;
DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentImpl);
}; };
#endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_
// Copyright (c) 2009 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.
#ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_H_
#define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_H_
#include "base/basictypes.h"
class WebDevToolsClientDelegate;
namespace WebKit {
class WebString;
class WebView;
}
// WebDevToolsClient represents DevTools client sitting in the Glue. It provides
// direct and delegate Apis to the host.
class WebDevToolsClient {
public:
static WebDevToolsClient* Create(
WebKit::WebView* view,
WebDevToolsClientDelegate* delegate,
const WebKit::WebString& application_locale);
WebDevToolsClient() {}
virtual ~WebDevToolsClient() {}
virtual void DispatchMessageFromAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name,
const WebKit::WebString& param1,
const WebKit::WebString& param2,
const WebKit::WebString& param3) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(WebDevToolsClient);
};
#endif // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_H_
// Copyright (c) 2009 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.
#ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_DELEGATE_H_
#define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_DELEGATE_H_
#include "base/basictypes.h"
namespace WebKit {
class WebString;
}
class WebDevToolsClientDelegate {
public:
WebDevToolsClientDelegate() {}
virtual ~WebDevToolsClientDelegate() {}
virtual void SendMessageToAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name,
const WebKit::WebString& param1,
const WebKit::WebString& param2,
const WebKit::WebString& param3) = 0;
virtual void SendDebuggerCommandToAgent(const WebKit::WebString& command) = 0;
virtual void ActivateWindow() = 0;
virtual void CloseWindow() = 0;
virtual void DockWindow() = 0;
virtual void UndockWindow() = 0;
virtual void ToggleInspectElementMode(bool enabled) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientDelegate);
};
#endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_DELEGATE_H_
...@@ -2,18 +2,19 @@ ...@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ #ifndef WEBKIT_GLUE_WEBDEVTOOLSFRONTEND_IMPL_H_
#define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ #define WEBKIT_GLUE_WEBDEVTOOLSFRONTEND_IMPL_H_
#include <string> #include <string>
#include <wtf/HashMap.h> #include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h> #include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h> #include <wtf/RefPtr.h>
#include "v8.h" #include "v8.h"
#include "webkit/api/public/WebDevToolsFrontend.h"
#include "webkit/glue/devtools/devtools_rpc.h" #include "webkit/glue/devtools/devtools_rpc.h"
#include "webkit/glue/webdevtoolsclient.h"
namespace WebCore { namespace WebCore {
class Node; class Node;
...@@ -29,14 +30,15 @@ class ToolsAgentNativeDelegateImpl; ...@@ -29,14 +30,15 @@ class ToolsAgentNativeDelegateImpl;
class WebDevToolsClientDelegate; class WebDevToolsClientDelegate;
class WebViewImpl; class WebViewImpl;
class WebDevToolsClientImpl : public WebDevToolsClient, class WebDevToolsFrontendImpl : public WebKit::WebDevToolsFrontend,
public DevToolsRpc::Delegate { public DevToolsRpc::Delegate,
public Noncopyable {
public: public:
WebDevToolsClientImpl( WebDevToolsFrontendImpl(
WebViewImpl* web_view_impl, WebViewImpl* web_view_impl,
WebDevToolsClientDelegate* delegate, WebKit::WebDevToolsFrontendClient* client,
const String& application_locale); const String& application_locale);
virtual ~WebDevToolsClientImpl(); virtual ~WebDevToolsFrontendImpl();
// DevToolsRpc::Delegate implementation. // DevToolsRpc::Delegate implementation.
virtual void SendRpcMessage(const String& class_name, virtual void SendRpcMessage(const String& class_name,
...@@ -45,8 +47,8 @@ class WebDevToolsClientImpl : public WebDevToolsClient, ...@@ -45,8 +47,8 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
const String& param2, const String& param2,
const String& param3); const String& param3);
// WebDevToolsClient implementation. // WebDevToolsFrontend implementation.
virtual void DispatchMessageFromAgent(const WebKit::WebString& class_name, virtual void dispatchMessageFromAgent(const WebKit::WebString& class_name,
const WebKit::WebString& method_name, const WebKit::WebString& method_name,
const WebKit::WebString& param1, const WebKit::WebString& param1,
const WebKit::WebString& param2, const WebKit::WebString& param2,
...@@ -79,7 +81,7 @@ class WebDevToolsClientImpl : public WebDevToolsClient, ...@@ -79,7 +81,7 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
const v8::Arguments& args); const v8::Arguments& args);
WebViewImpl* web_view_impl_; WebViewImpl* web_view_impl_;
WebDevToolsClientDelegate* delegate_; WebKit::WebDevToolsFrontendClient* client_;
String application_locale_; String application_locale_;
OwnPtr<BoundObject> debugger_command_executor_obj_; OwnPtr<BoundObject> debugger_command_executor_obj_;
OwnPtr<JsDebuggerAgentBoundObj> debugger_agent_obj_; OwnPtr<JsDebuggerAgentBoundObj> debugger_agent_obj_;
...@@ -88,7 +90,6 @@ class WebDevToolsClientImpl : public WebDevToolsClient, ...@@ -88,7 +90,6 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
Vector<Vector<String> > pending_incoming_messages_; Vector<Vector<String> > pending_incoming_messages_;
OwnPtr<BoundObject> dev_tools_host_; OwnPtr<BoundObject> dev_tools_host_;
OwnPtr<ToolsAgentNativeDelegateImpl> tools_agent_native_delegate_impl_; OwnPtr<ToolsAgentNativeDelegateImpl> tools_agent_native_delegate_impl_;
DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientImpl);
}; };
#endif // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ #endif // WEBKIT_GLUE_WEBDEVTOOLSFRONTEND_IMPL_H_
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
'api/public/WebDataSource.h', 'api/public/WebDataSource.h',
'api/public/WebDevToolsAgent.h', 'api/public/WebDevToolsAgent.h',
'api/public/WebDevToolsAgentClient.h', 'api/public/WebDevToolsAgentClient.h',
'api/public/WebDevToolsFrontend.h',
'api/public/WebDevToolsFrontendClient.h',
'api/public/WebDragData.h', 'api/public/WebDragData.h',
'api/public/WebEditingAction.h', 'api/public/WebEditingAction.h',
'api/public/WebFileChooserCompletion.h', 'api/public/WebFileChooserCompletion.h',
...@@ -632,10 +634,8 @@ ...@@ -632,10 +634,8 @@
'glue/webcursor_win.cc', 'glue/webcursor_win.cc',
'glue/webdevtoolsagent_impl.cc', 'glue/webdevtoolsagent_impl.cc',
'glue/webdevtoolsagent_impl.h', 'glue/webdevtoolsagent_impl.h',
'glue/webdevtoolsclient.h', 'glue/webdevtoolsfrontend_impl.cc',
'glue/webdevtoolsclient_delegate.h', 'glue/webdevtoolsfrontend_impl.h',
'glue/webdevtoolsclient_impl.cc',
'glue/webdevtoolsclient_impl.h',
'glue/webdropdata.cc', 'glue/webdropdata.cc',
'glue/webdropdata_win.cc', 'glue/webdropdata_win.cc',
'glue/webdropdata.h', 'glue/webdropdata.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment