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> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // DevToolsRpc::Delegate implementation. | 61 // DevToolsRpc::Delegate implementation. |
62 void SendRpcMessage(const std::string& raw_msg); | 62 void SendRpcMessage(const std::string& raw_msg); |
63 | 63 |
64 // Methods called by the glue. | 64 // Methods called by the glue. |
65 void SetMainFrameDocumentReady(bool ready); | 65 void SetMainFrameDocumentReady(bool ready); |
66 void DidCommitLoadForFrame(WebViewImpl* webview, | 66 void DidCommitLoadForFrame(WebViewImpl* webview, |
67 WebFrame* frame, | 67 WebFrame* frame, |
68 bool is_new_navigation); | 68 bool is_new_navigation); |
69 void AddMessageToConsole( | 69 void AddMessageToConsole( |
| 70 int source, |
| 71 int level, |
70 const WebCore::String& message, | 72 const WebCore::String& message, |
71 const WebCore::String& source_id, | 73 unsigned int line_no, |
72 unsigned int line_no); | 74 const WebCore::String& source_id); |
73 | 75 |
74 void ForceRepaint(); | 76 void ForceRepaint(); |
75 | 77 |
76 int host_id() { return host_id_; } | 78 int host_id() { return host_id_; } |
77 NetAgentImpl* net_agent_impl() { return net_agent_impl_.get(); } | 79 NetAgentImpl* net_agent_impl() { return net_agent_impl_.get(); } |
78 | 80 |
79 private: | 81 private: |
80 struct ConsoleMessage { | 82 struct ConsoleMessage { |
81 ConsoleMessage(const String& m, const String& sid, unsigned li) | 83 ConsoleMessage( |
82 : message(m), | 84 int src, int lvl, const String& m, unsigned li, const String& sid) |
83 source_id(sid), | 85 : source(src), |
84 line_no(li) { | 86 level(lvl), |
| 87 text(m), |
| 88 line_no(li), |
| 89 source_id(sid) { |
85 } | 90 } |
86 WebCore::String message; | 91 int source; |
| 92 int level; |
| 93 WebCore::String text; |
87 WebCore::String source_id; | 94 WebCore::String source_id; |
88 unsigned int line_no; | 95 unsigned int line_no; |
89 }; | 96 }; |
| 97 |
| 98 static void Serialize(const ConsoleMessage& message, DictionaryValue* value); |
| 99 |
90 int host_id_; | 100 int host_id_; |
91 WebDevToolsAgentDelegate* delegate_; | 101 WebDevToolsAgentDelegate* delegate_; |
92 WebViewImpl* web_view_impl_; | 102 WebViewImpl* web_view_impl_; |
93 WebCore::Document* document_; | 103 WebCore::Document* document_; |
94 OwnPtr<DebuggerAgentDelegateStub> debugger_agent_delegate_stub_; | 104 OwnPtr<DebuggerAgentDelegateStub> debugger_agent_delegate_stub_; |
95 OwnPtr<DomAgentDelegateStub> dom_agent_delegate_stub_; | 105 OwnPtr<DomAgentDelegateStub> dom_agent_delegate_stub_; |
96 OwnPtr<NetAgentDelegateStub> net_agent_delegate_stub_; | 106 OwnPtr<NetAgentDelegateStub> net_agent_delegate_stub_; |
97 OwnPtr<ToolsAgentDelegateStub> tools_agent_delegate_stub_; | 107 OwnPtr<ToolsAgentDelegateStub> tools_agent_delegate_stub_; |
98 OwnPtr<DebuggerAgentImpl> debugger_agent_impl_; | 108 OwnPtr<DebuggerAgentImpl> debugger_agent_impl_; |
99 OwnPtr<DomAgentImpl> dom_agent_impl_; | 109 OwnPtr<DomAgentImpl> dom_agent_impl_; |
100 OwnPtr<NetAgentImpl> net_agent_impl_; | 110 OwnPtr<NetAgentImpl> net_agent_impl_; |
101 Vector<ConsoleMessage> console_log_; | 111 Vector<ConsoleMessage> console_log_; |
102 bool attached_; | 112 bool attached_; |
103 DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentImpl); | 113 DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentImpl); |
104 }; | 114 }; |
105 | 115 |
106 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ | 116 #endif // WEBKIT_GLUE_WEBDEVTOOLSAGENT_IMPL_H_ |
OLD | NEW |