| 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_WEBDEVTOOLSAGENT_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include <wtf/OwnPtr.h> | 10 #include <wtf/OwnPtr.h> |
| 11 | 11 |
| 12 #include "v8.h" | 12 #include "v8.h" |
| 13 #include "third_party/WebKit/WebKit/chromium/src/WebDevToolsAgentPrivate.h" | 13 #include "third_party/WebKit/WebKit/chromium/src/WebDevToolsAgentPrivate.h" |
| 14 #include "webkit/glue/devtools/devtools_rpc.h" | 14 #include "webkit/glue/devtools/devtools_rpc.h" |
| 15 #include "webkit/glue/devtools/apu_agent_delegate.h" | 15 #include "webkit/glue/devtools/apu_agent_delegate.h" |
| 16 #include "webkit/glue/devtools/tools_agent.h" | 16 #include "webkit/glue/devtools/tools_agent.h" |
| 17 | 17 |
| 18 namespace WebCore { | 18 namespace WebCore { |
| 19 class Document; | 19 class Document; |
| 20 class InspectorController; |
| 20 class Node; | 21 class Node; |
| 21 class ScriptState; | 22 class ScriptState; |
| 22 class String; | 23 class String; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace WebKit { | 26 namespace WebKit { |
| 26 class WebDevToolsAgentClient; | 27 class WebDevToolsAgentClient; |
| 27 class WebFrame; | 28 class WebFrame; |
| 28 class WebFrameImpl; | 29 class WebFrameImpl; |
| 29 class WebString; | 30 class WebString; |
| 31 class WebURLRequest; |
| 32 class WebURLResponse; |
| 30 class WebViewImpl; | 33 class WebViewImpl; |
| 34 struct WebURLError; |
| 31 } | 35 } |
| 32 | 36 |
| 33 class BoundObject; | 37 class BoundObject; |
| 34 class DebuggerAgentDelegateStub; | 38 class DebuggerAgentDelegateStub; |
| 35 class DebuggerAgentImpl; | 39 class DebuggerAgentImpl; |
| 36 class Value; | 40 class Value; |
| 37 | 41 |
| 38 class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgentPrivate, | 42 class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgentPrivate, |
| 39 public ToolsAgent, | 43 public ToolsAgent, |
| 40 public DevToolsRpc::Delegate { | 44 public DevToolsRpc::Delegate { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 68 virtual void didNavigate(); | 72 virtual void didNavigate(); |
| 69 virtual void dispatchMessageFromFrontend( | 73 virtual void dispatchMessageFromFrontend( |
| 70 const WebKit::WebString& class_name, | 74 const WebKit::WebString& class_name, |
| 71 const WebKit::WebString& method_name, | 75 const WebKit::WebString& method_name, |
| 72 const WebKit::WebString& param1, | 76 const WebKit::WebString& param1, |
| 73 const WebKit::WebString& param2, | 77 const WebKit::WebString& param2, |
| 74 const WebKit::WebString& param3); | 78 const WebKit::WebString& param3); |
| 75 virtual void inspectElementAt(const WebKit::WebPoint& point); | 79 virtual void inspectElementAt(const WebKit::WebPoint& point); |
| 76 virtual void setRuntimeFeatureEnabled(const WebKit::WebString& feature, | 80 virtual void setRuntimeFeatureEnabled(const WebKit::WebString& feature, |
| 77 bool enabled); | 81 bool enabled); |
| 82 virtual void identifierForInitialRequest( |
| 83 unsigned long resourceId, |
| 84 WebKit::WebFrame* frame, |
| 85 const WebKit::WebURLRequest& request); |
| 86 virtual void willSendRequest(unsigned long resourceId, |
| 87 const WebKit::WebURLRequest& request); |
| 88 virtual void didReceiveData(unsigned long resourceId, int length); |
| 89 virtual void didReceiveResponse( |
| 90 unsigned long resourceId, |
| 91 const WebKit::WebURLResponse& response); |
| 92 virtual void didFinishLoading(unsigned long resourceId); |
| 93 virtual void didFailLoading( |
| 94 unsigned long resourceId, |
| 95 const WebKit::WebURLError& error); |
| 78 | 96 |
| 79 // DevToolsRpc::Delegate implementation. | 97 // DevToolsRpc::Delegate implementation. |
| 80 void SendRpcMessage(const WebCore::String& class_name, | 98 void SendRpcMessage(const WebCore::String& class_name, |
| 81 const WebCore::String& method_name, | 99 const WebCore::String& method_name, |
| 82 const WebCore::String& param1, | 100 const WebCore::String& param1, |
| 83 const WebCore::String& param2, | 101 const WebCore::String& param2, |
| 84 const WebCore::String& param3); | 102 const WebCore::String& param3); |
| 85 | 103 |
| 86 void ForceRepaint(); | 104 void ForceRepaint(); |
| 87 | 105 |
| 88 int host_id() { return host_id_; } | 106 int host_id() { return host_id_; } |
| 89 | 107 |
| 90 private: | 108 private: |
| 91 static v8::Handle<v8::Value> JsDispatchOnClient(const v8::Arguments& args); | 109 static v8::Handle<v8::Value> JsDispatchOnClient(const v8::Arguments& args); |
| 92 static v8::Handle<v8::Value> JsDispatchToApu(const v8::Arguments& args); | 110 static v8::Handle<v8::Value> JsDispatchToApu(const v8::Arguments& args); |
| 93 static v8::Handle<v8::Value> JsOnRuntimeFeatureStateChanged( | 111 static v8::Handle<v8::Value> JsOnRuntimeFeatureStateChanged( |
| 94 const v8::Arguments& args); | 112 const v8::Arguments& args); |
| 95 | 113 |
| 96 void DisposeUtilityContext(); | 114 void DisposeUtilityContext(); |
| 97 void UnhideResourcesPanelIfNecessary(); | 115 void UnhideResourcesPanelIfNecessary(); |
| 98 | 116 |
| 99 void InitDevToolsAgentHost(); | 117 void InitDevToolsAgentHost(); |
| 100 void ResetInspectorFrontendProxy(); | 118 void ResetInspectorFrontendProxy(); |
| 101 void setApuAgentEnabled(bool enabled); | 119 void setApuAgentEnabled(bool enabled); |
| 102 | 120 |
| 121 WebCore::InspectorController* GetInspectorController(); |
| 122 |
| 103 // Creates InspectorBackend v8 wrapper in the utility context so that it's | 123 // Creates InspectorBackend v8 wrapper in the utility context so that it's |
| 104 // methods prototype is Function.protoype object from the utility context. | 124 // methods prototype is Function.protoype object from the utility context. |
| 105 // Otherwise some useful methods defined on Function.prototype(such as bind) | 125 // Otherwise some useful methods defined on Function.prototype(such as bind) |
| 106 // are missing for InspectorController native methods. | 126 // are missing for InspectorController native methods. |
| 107 v8::Local<v8::Object> CreateInspectorBackendV8Wrapper(); | 127 v8::Local<v8::Object> CreateInspectorBackendV8Wrapper(); |
| 108 | 128 |
| 109 int host_id_; | 129 int host_id_; |
| 110 WebKit::WebDevToolsAgentClient* client_; | 130 WebKit::WebDevToolsAgentClient* client_; |
| 111 WebKit::WebViewImpl* web_view_impl_; | 131 WebKit::WebViewImpl* web_view_impl_; |
| 112 OwnPtr<DebuggerAgentDelegateStub> debugger_agent_delegate_stub_; | 132 OwnPtr<DebuggerAgentDelegateStub> debugger_agent_delegate_stub_; |
| 113 OwnPtr<ToolsAgentDelegateStub> tools_agent_delegate_stub_; | 133 OwnPtr<ToolsAgentDelegateStub> tools_agent_delegate_stub_; |
| 114 OwnPtr<ToolsAgentNativeDelegateStub> tools_agent_native_delegate_stub_; | 134 OwnPtr<ToolsAgentNativeDelegateStub> tools_agent_native_delegate_stub_; |
| 115 OwnPtr<DebuggerAgentImpl> debugger_agent_impl_; | 135 OwnPtr<DebuggerAgentImpl> debugger_agent_impl_; |
| 116 OwnPtr<ApuAgentDelegateStub> apu_agent_delegate_stub_; | 136 OwnPtr<ApuAgentDelegateStub> apu_agent_delegate_stub_; |
| 117 bool apu_agent_enabled_; | 137 bool apu_agent_enabled_; |
| 118 bool resource_tracking_was_enabled_; | 138 bool resource_tracking_was_enabled_; |
| 119 bool attached_; | 139 bool attached_; |
| 120 // TODO(pfeldman): This should not be needed once GC styles issue is fixed | 140 // TODO(pfeldman): This should not be needed once GC styles issue is fixed |
| 121 // for matching rules. | 141 // for matching rules. |
| 122 v8::Persistent<v8::Context> utility_context_; | 142 v8::Persistent<v8::Context> utility_context_; |
| 123 OwnPtr<BoundObject> devtools_agent_host_; | 143 OwnPtr<BoundObject> devtools_agent_host_; |
| 124 OwnPtr<WebCore::ScriptState> inspector_frontend_script_state_; | 144 OwnPtr<WebCore::ScriptState> inspector_frontend_script_state_; |
| 125 }; | 145 }; |
| 126 | 146 |
| 127 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ | 147 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ |
| OLD | NEW |