Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: content/browser/debugger/devtools_tracing_handler.h

Issue 11548032: Telemetry / Devtools TraceHandler: exposes tracing via dev tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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();
24 virtual void OnTraceDataCollected(
25 const scoped_refptr<base::RefCountedString>& trace_fragment);
26
27 // DevToolBrowserTarget::Handler:
28 virtual base::Value* OnProtocolCommand(
29 const std::string& method,
30 const base::DictionaryValue* params) OVERRIDE;
31
32 private:
33 base::Value* Start(const base::DictionaryValue* params);
34 base::Value* End(const base::DictionaryValue* params);
35 base::Value* HasCompleted(const base::DictionaryValue* params);
36 base::Value* GetTraceAndReset(const base::DictionaryValue* params);
37
38 bool has_completed_;
39
40 std::vector<std::string> buffer_;
41
42 DISALLOW_COPY_AND_ASSIGN(DevToolsTracingHandler);
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_TRACING_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698