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

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

Issue 541763002: tracing: get rid of files in TracingController interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased, fixed tests following last ps Created 6 years, 3 months 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
OLDNEW
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_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 15 matching lines...) Expand all
26 public: 26 public:
27 enum Target { Browser, Renderer }; 27 enum Target { Browser, Renderer };
28 explicit DevToolsTracingHandler(Target target); 28 explicit DevToolsTracingHandler(Target target);
29 virtual ~DevToolsTracingHandler(); 29 virtual ~DevToolsTracingHandler();
30 30
31 void OnClientDetached(); 31 void OnClientDetached();
32 32
33 void EnableTracing(const std::string& category_filter); 33 void EnableTracing(const std::string& category_filter);
34 void DisableTracing(); 34 void DisableTracing();
35 35
36
37 void OnTraceDataCollected(const std::string& trace_fragment);
38 void OnTraceComplete();
39
36 private: 40 private:
37 void BeginReadingRecordingResult(const base::FilePath& path);
38 void ReadRecordingResult(const scoped_refptr<base::RefCountedString>& result);
39 void OnTraceDataCollected(const std::string& trace_fragment);
40 void OnRecordingEnabled(scoped_refptr<DevToolsProtocol::Command> command); 41 void OnRecordingEnabled(scoped_refptr<DevToolsProtocol::Command> command);
41 void OnBufferUsage(float usage); 42 void OnBufferUsage(float usage);
42 43
43 scoped_refptr<DevToolsProtocol::Response> OnStart( 44 scoped_refptr<DevToolsProtocol::Response> OnStart(
44 scoped_refptr<DevToolsProtocol::Command> command); 45 scoped_refptr<DevToolsProtocol::Command> command);
45 scoped_refptr<DevToolsProtocol::Response> OnEnd( 46 scoped_refptr<DevToolsProtocol::Response> OnEnd(
46 scoped_refptr<DevToolsProtocol::Command> command); 47 scoped_refptr<DevToolsProtocol::Command> command);
47 48
48 scoped_refptr<DevToolsProtocol::Response> OnGetCategories( 49 scoped_refptr<DevToolsProtocol::Response> OnGetCategories(
49 scoped_refptr<DevToolsProtocol::Command> command); 50 scoped_refptr<DevToolsProtocol::Command> command);
50 51
51 void OnCategoriesReceived(scoped_refptr<DevToolsProtocol::Command> command, 52 void OnCategoriesReceived(scoped_refptr<DevToolsProtocol::Command> command,
52 const std::set<std::string>& category_set); 53 const std::set<std::string>& category_set);
53 54
54 base::debug::TraceOptions TraceOptionsFromString(const std::string& options); 55 base::debug::TraceOptions TraceOptionsFromString(const std::string& options);
55 56
56 void SetupTimer(double usage_reporting_interval); 57 void SetupTimer(double usage_reporting_interval);
57 58
58 void DisableRecording( 59 void DisableRecording(bool abort);
59 const TracingController::TracingFileResultCallback& callback =
60 TracingController::TracingFileResultCallback());
61 60
62 base::WeakPtrFactory<DevToolsTracingHandler> weak_factory_; 61 base::WeakPtrFactory<DevToolsTracingHandler> weak_factory_;
63 scoped_ptr<base::Timer> buffer_usage_poll_timer_; 62 scoped_ptr<base::Timer> buffer_usage_poll_timer_;
64 Target target_; 63 Target target_;
65 bool is_recording_; 64 bool is_recording_;
66 65
67 static const char* kDefaultCategories; 66 static const char* kDefaultCategories;
68 static const double kDefaultReportingInterval; 67 static const double kDefaultReportingInterval;
69 static const double kMinimumReportingInterval; 68 static const double kMinimumReportingInterval;
70 69
71 DISALLOW_COPY_AND_ASSIGN(DevToolsTracingHandler); 70 DISALLOW_COPY_AND_ASSIGN(DevToolsTracingHandler);
72 }; 71 };
73 72
74 } // namespace content 73 } // namespace content
75 74
76 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ 75 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698