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_TRACING_HANDLER_H_ | |
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACING_HANDLER_H_ | |
7 | |
8 #include "content/browser/debugger/devtools_browser_target.h" | |
9 #include "content/public/browser/trace_subscriber.h" | |
10 | |
11 namespace content { | |
12 | |
13 // This class bridges DevTools remote debugging server with the trace | |
14 // infrastructure. | |
15 class DevToolsTracingHandler | |
16 : public TraceSubscriber, | |
17 public DevToolsBrowserTarget::Handler { | |
18 public: | |
19 DevToolsTracingHandler(); | |
20 virtual ~DevToolsTracingHandler(); | |
21 | |
22 // TraceSubscriber: | |
23 virtual void OnEndTracingComplete() OVERRIDE;; | |
24 virtual void OnTraceDataCollected( | |
25 const scoped_refptr<base::RefCountedString>& trace_fragment) OVERRIDE; | |
26 | |
27 // DevToolBrowserTarget::Handler: | |
28 virtual std::string Domain() OVERRIDE; | |
29 virtual base::Value* OnProtocolCommand( | |
30 const std::string& method, | |
31 const base::DictionaryValue* params, | |
32 base::Value** error_out) OVERRIDE; | |
33 | |
34 private: | |
35 base::Value* Start(const base::DictionaryValue* params); | |
36 base::Value* End(const base::DictionaryValue* params); | |
37 base::Value* HasCompleted(const base::DictionaryValue* params); | |
38 base::Value* GetTraceAndReset(const base::DictionaryValue* params); | |
39 | |
40 bool has_completed_; | |
41 | |
42 std::vector<std::string> buffer_; | |
43 int buffer_data_size_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(DevToolsTracingHandler); | |
46 }; | |
47 | |
48 } // namespace content | |
49 | |
50 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACING_HANDLER_H_ | |
OLD | NEW |