OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACE_HANDLER_H_ | |
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACE_HANDLER_H_ | |
7 | |
8 #include "content/public/browser/trace_subscriber.h" | |
9 #include "content/browser/debugger/devtools_browser_target.h" | |
10 | |
11 namespace content { | |
12 | |
13 // This class bridges DevTools remote debugging server with the trace | |
14 // infrastructure. | |
15 class DevToolsTraceDomainHandler | |
16 : public TraceSubscriber, | |
17 public DevToolsBrowserTarget::Handler { | |
18 public: | |
19 DevToolsTraceDomainHandler(); | |
20 ~DevToolsTraceDomainHandler(); | |
21 | |
22 // TraceSubscriber: | |
23 virtual void OnEndTracingComplete(); | |
24 virtual void OnTraceDataCollected( | |
25 const scoped_refptr<base::RefCountedString>& trace_fragment); | |
26 | |
27 // DevToolBrowserTarget::Handler: | |
28 virtual bool OnWebSocketMessage(int connection_id, | |
29 const std::string& data, | |
30 DevToolsServerSender* sender) OVERRIDE; | |
31 | |
32 private: | |
33 void BeginTracing(const std::string& categories); | |
34 void EndTracingAsync(); | |
35 bool has_completed() const; | |
36 | |
37 std::string GetAndResetTrace(); | |
pfeldman
2012/12/12 20:17:12
I'd create a method per protocol method with the s
bulach
2012/12/13 17:36:23
Done.
| |
38 | |
39 bool has_completed_; | |
40 | |
41 std::string buffer_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(DevToolsTraceDomainHandler); | |
44 }; | |
45 | |
46 } // namespace content | |
47 | |
48 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACE_HANDLER_H_ | |
OLD | NEW |