| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include <wtf/HashMap.h> | 10 #include <wtf/HashMap.h> |
| 11 #include <wtf/OwnPtr.h> | 11 #include <wtf/OwnPtr.h> |
| 12 | 12 |
| 13 #include "v8.h" | 13 #include "v8.h" |
| 14 #include "webkit/glue/cpp_bound_class.h" | 14 #include "webkit/glue/cpp_bound_class.h" |
| 15 #include "webkit/glue/devtools/devtools_rpc.h" | 15 #include "webkit/glue/devtools/devtools_rpc.h" |
| 16 #include "webkit/glue/webdevtoolsclient.h" | 16 #include "webkit/glue/webdevtoolsclient.h" |
| 17 | 17 |
| 18 namespace WebCore { | 18 namespace WebCore { |
| 19 class Page; | 19 class Page; |
| 20 class String; | 20 class String; |
| 21 } | 21 } |
| 22 | 22 |
| 23 class BoundObject; |
| 23 class JsDebuggerAgentBoundObj; | 24 class JsDebuggerAgentBoundObj; |
| 24 class JsDomAgentBoundObj; | 25 class JsDomAgentBoundObj; |
| 25 class JsNetAgentBoundObj; | 26 class JsNetAgentBoundObj; |
| 26 class JsToolsAgentBoundObj; | 27 class JsToolsAgentBoundObj; |
| 27 class WebDevToolsClientDelegate; | 28 class WebDevToolsClientDelegate; |
| 28 class WebViewImpl; | 29 class WebViewImpl; |
| 29 | 30 |
| 30 class WebDevToolsClientImpl : public WebDevToolsClient, | 31 class WebDevToolsClientImpl : public WebDevToolsClient, |
| 31 public CppBoundClass, | 32 public CppBoundClass, |
| 32 public DevToolsRpc::Delegate { | 33 public DevToolsRpc::Delegate { |
| 33 public: | 34 public: |
| 34 WebDevToolsClientImpl( | 35 WebDevToolsClientImpl( |
| 35 WebViewImpl* web_view_impl, | 36 WebViewImpl* web_view_impl, |
| 36 WebDevToolsClientDelegate* delegate); | 37 WebDevToolsClientDelegate* delegate); |
| 37 virtual ~WebDevToolsClientImpl(); | 38 virtual ~WebDevToolsClientImpl(); |
| 38 | 39 |
| 39 // DevToolsRpc::Delegate implementation. | 40 // DevToolsRpc::Delegate implementation. |
| 40 virtual void SendRpcMessage(const std::string& raw_msg); | 41 virtual void SendRpcMessage(const std::string& raw_msg); |
| 41 | 42 |
| 42 // WebDevToolsClient implementation. | 43 // WebDevToolsClient implementation. |
| 43 virtual void DispatchMessageFromAgent(const std::string& raw_msg); | 44 virtual void DispatchMessageFromAgent(const std::string& raw_msg); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 static v8::Handle<v8::Value> JsAddSourceToFrame(const v8::Arguments& args); | 47 static v8::Handle<v8::Value> JsAddSourceToFrame(const v8::Arguments& args); |
| 47 static v8::Handle<v8::Value> JsLoaded(const v8::Arguments& args); | 48 static v8::Handle<v8::Value> JsLoaded(const v8::Arguments& args); |
| 48 static v8::Handle<v8::Value> JsActivateWindow(const v8::Arguments& args); | 49 static v8::Handle<v8::Value> JsActivateWindow(const v8::Arguments& args); |
| 49 | 50 |
| 50 void InitBoundObject(); | |
| 51 void InitProtoFunction(const char* name, v8::InvocationCallback callback); | |
| 52 | |
| 53 WebViewImpl* web_view_impl_; | 51 WebViewImpl* web_view_impl_; |
| 54 WebDevToolsClientDelegate* delegate_; | 52 WebDevToolsClientDelegate* delegate_; |
| 55 OwnPtr<CppBoundClass> debugger_command_executor_obj_; | 53 OwnPtr<CppBoundClass> debugger_command_executor_obj_; |
| 56 OwnPtr<JsDebuggerAgentBoundObj> debugger_agent_obj_; | 54 OwnPtr<JsDebuggerAgentBoundObj> debugger_agent_obj_; |
| 57 OwnPtr<JsDomAgentBoundObj> dom_agent_obj_; | 55 OwnPtr<JsDomAgentBoundObj> dom_agent_obj_; |
| 58 OwnPtr<JsNetAgentBoundObj> net_agent_obj_; | |
| 59 OwnPtr<JsToolsAgentBoundObj> tools_agent_obj_; | 56 OwnPtr<JsToolsAgentBoundObj> tools_agent_obj_; |
| 60 bool loaded_; | 57 bool loaded_; |
| 61 Vector<std::string> pending_incoming_messages_; | 58 Vector<std::string> pending_incoming_messages_; |
| 62 v8::Persistent<v8::FunctionTemplate> host_template_; | 59 OwnPtr<BoundObject> dev_tools_host_; |
| 63 v8::Persistent<v8::External> v8_this_; | |
| 64 DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientImpl); | 60 DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientImpl); |
| 65 }; | 61 }; |
| 66 | 62 |
| 67 #endif // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ | 63 #endif // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_ |
| OLD | NEW |