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 #include "components/feedback/tracing_manager.h" | 5 #include "components/feedback/tracing_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "components/feedback/feedback_util.h" | 10 #include "components/feedback/feedback_util.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // If the trace has already been requested, provide an empty string. | 83 // If the trace has already been requested, provide an empty string. |
84 if (!trace_callback_.is_null()) { | 84 if (!trace_callback_.is_null()) { |
85 trace_callback_.Run(scoped_refptr<base::RefCountedString>()); | 85 trace_callback_.Run(scoped_refptr<base::RefCountedString>()); |
86 trace_callback_.Reset(); | 86 trace_callback_.Reset(); |
87 } | 87 } |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 void TracingManager::StartTracing() { | 91 void TracingManager::StartTracing() { |
92 content::TracingController::GetInstance()->EnableRecording( | 92 content::TracingController::GetInstance()->EnableRecording( |
93 base::trace_event::CategoryFilter(), | 93 base::trace_event::TraceConfig(), |
94 base::trace_event::TraceOptions(), | |
95 content::TracingController::EnableRecordingDoneCallback()); | 94 content::TracingController::EnableRecordingDoneCallback()); |
96 } | 95 } |
97 | 96 |
98 void TracingManager::OnTraceDataCollected(base::RefCountedString* trace_data) { | 97 void TracingManager::OnTraceDataCollected(base::RefCountedString* trace_data) { |
99 if (!current_trace_id_) | 98 if (!current_trace_id_) |
100 return; | 99 return; |
101 | 100 |
102 std::string output_val; | 101 std::string output_val; |
103 feedback_util::ZipString( | 102 feedback_util::ZipString( |
104 base::FilePath(kTracingFilename), trace_data->data(), &output_val); | 103 base::FilePath(kTracingFilename), trace_data->data(), &output_val); |
(...skipping 21 matching lines...) Expand all Loading... |
126 // static | 125 // static |
127 scoped_ptr<TracingManager> TracingManager::Create() { | 126 scoped_ptr<TracingManager> TracingManager::Create() { |
128 if (g_tracing_manager) | 127 if (g_tracing_manager) |
129 return scoped_ptr<TracingManager>(); | 128 return scoped_ptr<TracingManager>(); |
130 return scoped_ptr<TracingManager>(new TracingManager()); | 129 return scoped_ptr<TracingManager>(new TracingManager()); |
131 } | 130 } |
132 | 131 |
133 TracingManager* TracingManager::Get() { | 132 TracingManager* TracingManager::Get() { |
134 return g_tracing_manager; | 133 return g_tracing_manager; |
135 } | 134 } |
OLD | NEW |