OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
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/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
14 #include "base/values.h" | 15 #include "base/values.h" |
15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 class TracingController; | 20 class TracingController; |
20 | 21 |
21 // TracingController is used on the browser processes to enable/disable | 22 // TracingController is used on the browser processes to enable/disable |
(...skipping 24 matching lines...) Expand all Loading... |
46 virtual void AddMetadata(const base::DictionaryValue& data); | 47 virtual void AddMetadata(const base::DictionaryValue& data); |
47 virtual const base::DictionaryValue& GetMetadata() const; | 48 virtual const base::DictionaryValue& GetMetadata() const; |
48 // TODO(prabhur) Replace all the Set* functions with a generic function: | 49 // TODO(prabhur) Replace all the Set* functions with a generic function: |
49 // TraceDataSink::AppendAdditionalData(const std::string& name, | 50 // TraceDataSink::AppendAdditionalData(const std::string& name, |
50 // const std::string& trace_data) | 51 // const std::string& trace_data) |
51 virtual void SetPowerTrace(const std::string& data) {} | 52 virtual void SetPowerTrace(const std::string& data) {} |
52 virtual void Close() {} | 53 virtual void Close() {} |
53 | 54 |
54 protected: | 55 protected: |
55 friend class base::RefCountedThreadSafe<TraceDataSink>; | 56 friend class base::RefCountedThreadSafe<TraceDataSink>; |
| 57 TraceDataSink() = default; |
56 virtual ~TraceDataSink() {} | 58 virtual ~TraceDataSink() {} |
57 | 59 |
58 private: | 60 private: |
59 base::DictionaryValue metadata_; | 61 base::DictionaryValue metadata_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(TraceDataSink); |
60 }; | 64 }; |
61 | 65 |
62 // An implementation of this interface is passed when constructing a | 66 // An implementation of this interface is passed when constructing a |
63 // TraceDataSink, and receives chunks of the final trace data as it's being | 67 // TraceDataSink, and receives chunks of the final trace data as it's being |
64 // constructed. | 68 // constructed. |
65 // Methods may be called from any thread. | 69 // Methods may be called from any thread. |
66 class CONTENT_EXPORT TraceDataEndpoint | 70 class CONTENT_EXPORT TraceDataEndpoint |
67 : public base::RefCountedThreadSafe<TraceDataEndpoint> { | 71 : public base::RefCountedThreadSafe<TraceDataEndpoint> { |
68 public: | 72 public: |
69 virtual void ReceiveTraceChunk(const std::string& chunk) {} | 73 virtual void ReceiveTraceChunk(const std::string& chunk) {} |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Check if the tracing system is tracing | 229 // Check if the tracing system is tracing |
226 virtual bool IsTracing() const = 0; | 230 virtual bool IsTracing() const = 0; |
227 | 231 |
228 protected: | 232 protected: |
229 virtual ~TracingController() {} | 233 virtual ~TracingController() {} |
230 }; | 234 }; |
231 | 235 |
232 } // namespace content | 236 } // namespace content |
233 | 237 |
234 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 238 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
OLD | NEW |