OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_FEEDBACK_TRACING_MANAGER_H_ | 5 #ifndef COMPONENTS_FEEDBACK_TRACING_MANAGER_H_ |
6 #define COMPONENTS_FEEDBACK_TRACING_MANAGER_H_ | 6 #define COMPONENTS_FEEDBACK_TRACING_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // returned via |callback|. Returns false on failure. | 51 // returned via |callback|. Returns false on failure. |
52 bool GetTraceData(int id, const TraceDataCallback& callback); | 52 bool GetTraceData(int id, const TraceDataCallback& callback); |
53 | 53 |
54 // Discard the data for trace |id|. | 54 // Discard the data for trace |id|. |
55 void DiscardTraceData(int id); | 55 void DiscardTraceData(int id); |
56 | 56 |
57 private: | 57 private: |
58 TracingManager(); | 58 TracingManager(); |
59 | 59 |
60 void StartTracing(); | 60 void StartTracing(); |
61 void OnTraceDataCollected(const base::FilePath& path); | 61 void OnTraceDataCollected(base::RefCountedString* data); |
62 | 62 |
63 // ID of the trace that is being collected. | 63 // ID of the trace that is being collected. |
64 int current_trace_id_; | 64 int current_trace_id_; |
65 | 65 |
66 // Mapping of trace ID to trace data. | 66 // Mapping of trace ID to trace data. |
67 std::map<int, scoped_refptr<base::RefCountedString> > trace_data_; | 67 std::map<int, scoped_refptr<base::RefCountedString> > trace_data_; |
68 | 68 |
69 // Callback for the current trace request. | 69 // Callback for the current trace request. |
70 TraceDataCallback trace_callback_; | 70 TraceDataCallback trace_callback_; |
71 | 71 |
72 base::WeakPtrFactory<TracingManager> weak_ptr_factory_; | 72 base::WeakPtrFactory<TracingManager> weak_ptr_factory_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(TracingManager); | 74 DISALLOW_COPY_AND_ASSIGN(TracingManager); |
75 }; | 75 }; |
76 | 76 |
77 #endif // COMPONENTS_FEEDBACK_TRACING_MANAGER_H_ | 77 #endif // COMPONENTS_FEEDBACK_TRACING_MANAGER_H_ |
78 | 78 |
OLD | NEW |