OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 5 #ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/trace_event/trace_config.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 #include "content/public/common/console_message_level.h" | 14 #include "content/public/common/console_message_level.h" |
14 #include "content/public/renderer/render_frame_observer.h" | 15 #include "content/public/renderer/render_frame_observer.h" |
15 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h" | 16 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h" |
16 | 17 |
17 namespace blink { | 18 namespace blink { |
18 class WebDevToolsAgent; | 19 class WebDevToolsAgent; |
19 } | 20 } |
20 | 21 |
21 namespace content { | 22 namespace content { |
(...skipping 24 matching lines...) Expand all Loading... |
46 blink::WebDevToolsAgent* GetWebAgent(); | 47 blink::WebDevToolsAgent* GetWebAgent(); |
47 | 48 |
48 bool IsAttached(); | 49 bool IsAttached(); |
49 | 50 |
50 void AddMessageToConsole(ConsoleMessageLevel level, | 51 void AddMessageToConsole(ConsoleMessageLevel level, |
51 const std::string& message); | 52 const std::string& message); |
52 | 53 |
53 private: | 54 private: |
54 friend class DevToolsAgentTest; | 55 friend class DevToolsAgentTest; |
55 | 56 |
| 57 void enableTracingWithTraceConfig( |
| 58 const base::trace_event::TraceConfig& trace_config); |
| 59 |
56 // RenderFrameObserver implementation. | 60 // RenderFrameObserver implementation. |
57 bool OnMessageReceived(const IPC::Message& message) override; | 61 bool OnMessageReceived(const IPC::Message& message) override; |
58 void WidgetWillClose() override; | 62 void WidgetWillClose() override; |
59 | 63 |
60 // WebDevToolsAgentClient implementation. | 64 // WebDevToolsAgentClient implementation. |
61 void sendProtocolMessage(int session_id, | 65 void sendProtocolMessage(int session_id, |
62 int call_id, | 66 int call_id, |
63 const blink::WebString& response, | 67 const blink::WebString& response, |
64 const blink::WebString& state) override; | 68 const blink::WebString& state) override; |
65 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* | 69 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* |
66 createClientMessageLoop() override; | 70 createClientMessageLoop() override; |
67 void willEnterDebugLoop() override; | 71 void willEnterDebugLoop() override; |
68 void didExitDebugLoop() override; | 72 void didExitDebugLoop() override; |
69 | 73 |
70 bool requestDevToolsForFrame(blink::WebLocalFrame* frame) override; | 74 bool requestDevToolsForFrame(blink::WebLocalFrame* frame) override; |
71 | 75 |
| 76 void enableTracingWithConfigStr( |
| 77 const blink::WebString& devtools_style_config) override; |
72 void enableTracing(const blink::WebString& category_filter) override; | 78 void enableTracing(const blink::WebString& category_filter) override; |
73 void disableTracing() override; | 79 void disableTracing() override; |
74 | 80 |
75 void setCPUThrottlingRate(double rate) override; | 81 void setCPUThrottlingRate(double rate) override; |
76 | 82 |
77 void OnAttach(const std::string& host_id, int session_id); | 83 void OnAttach(const std::string& host_id, int session_id); |
78 void OnReattach(const std::string& host_id, | 84 void OnReattach(const std::string& host_id, |
79 int session_id, | 85 int session_id, |
80 const std::string& agent_state); | 86 const std::string& agent_state); |
81 void OnDetach(); | 87 void OnDetach(); |
82 void OnDispatchOnInspectorBackend(int session_id, const std::string& message); | 88 void OnDispatchOnInspectorBackend(int session_id, const std::string& message); |
83 void OnInspectElement(int x, int y); | 89 void OnInspectElement(int x, int y); |
84 void OnRequestNewWindowACK(bool success); | 90 void OnRequestNewWindowACK(bool success); |
85 void ContinueProgram(); | 91 void ContinueProgram(); |
86 void OnSetupDevToolsClient(const std::string& compatibility_script); | 92 void OnSetupDevToolsClient(const std::string& compatibility_script); |
87 | 93 |
88 bool is_attached_; | 94 bool is_attached_; |
89 bool is_devtools_client_; | 95 bool is_devtools_client_; |
90 bool paused_in_mouse_move_; | 96 bool paused_in_mouse_move_; |
91 bool paused_; | 97 bool paused_; |
92 RenderFrameImpl* frame_; | 98 RenderFrameImpl* frame_; |
93 scoped_ptr<DevToolsCPUThrottler> cpu_throttler_; | 99 scoped_ptr<DevToolsCPUThrottler> cpu_throttler_; |
94 | 100 |
95 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 101 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
96 }; | 102 }; |
97 | 103 |
98 } // namespace content | 104 } // namespace content |
99 | 105 |
100 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 106 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
OLD | NEW |