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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "content/public/common/console_message_level.h" | |
15 #include "content/public/renderer/render_frame_observer.h" | 14 #include "content/public/renderer/render_frame_observer.h" |
16 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h" | 15 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h" |
17 | 16 |
18 namespace blink { | 17 namespace blink { |
19 class WebDevToolsAgent; | 18 class WebDevToolsAgent; |
20 } | 19 } |
21 | 20 |
22 namespace content { | 21 namespace content { |
23 | 22 |
24 class DevToolsCPUThrottler; | 23 class DevToolsCPUThrottler; |
(...skipping 16 matching lines...) Expand all Loading... |
41 int routing_id, | 40 int routing_id, |
42 int session_id, | 41 int session_id, |
43 int call_id, | 42 int call_id, |
44 const std::string& message, | 43 const std::string& message, |
45 const std::string& post_state); | 44 const std::string& post_state); |
46 | 45 |
47 blink::WebDevToolsAgent* GetWebAgent(); | 46 blink::WebDevToolsAgent* GetWebAgent(); |
48 | 47 |
49 bool IsAttached(); | 48 bool IsAttached(); |
50 | 49 |
51 void AddMessageToConsole(ConsoleMessageLevel level, | |
52 const std::string& message); | |
53 | |
54 private: | 50 private: |
55 friend class DevToolsAgentTest; | 51 friend class DevToolsAgentTest; |
56 | 52 |
57 // RenderFrameObserver implementation. | 53 // RenderFrameObserver implementation. |
58 bool OnMessageReceived(const IPC::Message& message) override; | 54 bool OnMessageReceived(const IPC::Message& message) override; |
59 void WidgetWillClose() override; | 55 void WidgetWillClose() override; |
60 | 56 |
61 // WebDevToolsAgentClient implementation. | 57 // WebDevToolsAgentClient implementation. |
62 void sendProtocolMessage(int session_id, | 58 void sendProtocolMessage(int session_id, |
63 int call_id, | 59 int call_id, |
(...skipping 30 matching lines...) Expand all Loading... |
94 base::Callback<void(int, int, const std::string&, const std::string&)> | 90 base::Callback<void(int, int, const std::string&, const std::string&)> |
95 send_protocol_message_callback_for_test_; | 91 send_protocol_message_callback_for_test_; |
96 std::unique_ptr<DevToolsCPUThrottler> cpu_throttler_; | 92 std::unique_ptr<DevToolsCPUThrottler> cpu_throttler_; |
97 | 93 |
98 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 94 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
99 }; | 95 }; |
100 | 96 |
101 } // namespace content | 97 } // namespace content |
102 | 98 |
103 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ | 99 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ |
OLD | NEW |