| 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/memory/scoped_ptr.h" |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 #include "content/public/common/console_message_level.h" | 12 #include "content/public/common/console_message_level.h" |
| 12 #include "content/public/renderer/render_frame_observer.h" | 13 #include "content/public/renderer/render_frame_observer.h" |
| 13 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h" | 14 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 class WebDevToolsAgent; | 17 class WebDevToolsAgent; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 | 21 |
| 22 class DevToolsCPUThrottler; |
| 21 class RenderFrameImpl; | 23 class RenderFrameImpl; |
| 22 | 24 |
| 23 // DevToolsAgent belongs to the inspectable RenderFrameImpl and communicates | 25 // DevToolsAgent belongs to the inspectable RenderFrameImpl and communicates |
| 24 // with WebDevToolsAgent. There is a corresponding DevToolsAgentHost | 26 // with WebDevToolsAgent. There is a corresponding DevToolsAgentHost |
| 25 // on the browser side. | 27 // on the browser side. |
| 26 class CONTENT_EXPORT DevToolsAgent | 28 class CONTENT_EXPORT DevToolsAgent |
| 27 : public RenderFrameObserver, | 29 : public RenderFrameObserver, |
| 28 NON_EXPORTED_BASE(public blink::WebDevToolsAgentClient) { | 30 NON_EXPORTED_BASE(public blink::WebDevToolsAgentClient) { |
| 29 public: | 31 public: |
| 30 explicit DevToolsAgent(RenderFrameImpl* frame); | 32 explicit DevToolsAgent(RenderFrameImpl* frame); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 60 const blink::WebString& response, | 62 const blink::WebString& response, |
| 61 const blink::WebString& state) override; | 63 const blink::WebString& state) override; |
| 62 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* | 64 blink::WebDevToolsAgentClient::WebKitClientMessageLoop* |
| 63 createClientMessageLoop() override; | 65 createClientMessageLoop() override; |
| 64 void willEnterDebugLoop() override; | 66 void willEnterDebugLoop() override; |
| 65 void didExitDebugLoop() override; | 67 void didExitDebugLoop() override; |
| 66 | 68 |
| 67 void enableTracing(const blink::WebString& category_filter) override; | 69 void enableTracing(const blink::WebString& category_filter) override; |
| 68 void disableTracing() override; | 70 void disableTracing() override; |
| 69 | 71 |
| 72 void setCPUThrottlingRate(double rate) override; |
| 73 |
| 70 void OnAttach(const std::string& host_id, int session_id); | 74 void OnAttach(const std::string& host_id, int session_id); |
| 71 void OnReattach(const std::string& host_id, | 75 void OnReattach(const std::string& host_id, |
| 72 int session_id, | 76 int session_id, |
| 73 const std::string& agent_state); | 77 const std::string& agent_state); |
| 74 void OnDetach(); | 78 void OnDetach(); |
| 75 void OnDispatchOnInspectorBackend(int session_id, const std::string& message); | 79 void OnDispatchOnInspectorBackend(int session_id, const std::string& message); |
| 76 void OnInspectElement(int x, int y); | 80 void OnInspectElement(int x, int y); |
| 77 void ContinueProgram(); | 81 void ContinueProgram(); |
| 78 void OnSetupDevToolsClient(const std::string& compatibility_script); | 82 void OnSetupDevToolsClient(const std::string& compatibility_script); |
| 79 | 83 |
| 80 bool is_attached_; | 84 bool is_attached_; |
| 81 bool is_devtools_client_; | 85 bool is_devtools_client_; |
| 82 bool paused_in_mouse_move_; | 86 bool paused_in_mouse_move_; |
| 83 bool paused_; | 87 bool paused_; |
| 84 RenderFrameImpl* frame_; | 88 RenderFrameImpl* frame_; |
| 89 scoped_ptr<DevToolsCPUThrottler> cpu_throttler_; |
| 85 | 90 |
| 86 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 91 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
| 87 }; | 92 }; |
| 88 | 93 |
| 89 } // namespace content | 94 } // namespace content |
| 90 | 95 |
| 91 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 96 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
| OLD | NEW |