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 #include "chrome/browser/feedback/tracing_manager.h" | 5 #include "chrome/browser/feedback/tracing_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/feedback/feedback_util.h" | 10 #include "chrome/browser/feedback/feedback_util.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 base::debug::TraceLog::RECORD_CONTINUOUSLY); | 89 base::debug::TraceLog::RECORD_CONTINUOUSLY); |
90 } | 90 } |
91 | 91 |
92 void TracingManager::OnEndTracingComplete() { | 92 void TracingManager::OnEndTracingComplete() { |
93 if (!current_trace_id_) | 93 if (!current_trace_id_) |
94 return; | 94 return; |
95 | 95 |
96 std::string output_val; | 96 std::string output_val; |
97 FeedbackUtil::ZipString(data_, &output_val); | 97 FeedbackUtil::ZipString(data_, &output_val); |
98 | 98 |
99 scoped_refptr<base::RefCountedString> output; | 99 scoped_refptr<base::RefCountedString> output( |
100 output->TakeString(&output_val); | 100 base::RefCountedString::TakeString(&output_val)); |
101 | 101 |
102 trace_data_[current_trace_id_] = output; | 102 trace_data_[current_trace_id_] = output; |
103 | 103 |
104 if (!trace_callback_.is_null()) { | 104 if (!trace_callback_.is_null()) { |
105 trace_callback_.Run(output); | 105 trace_callback_.Run(output); |
106 trace_callback_.Reset(); | 106 trace_callback_.Reset(); |
107 } | 107 } |
108 | 108 |
109 current_trace_id_ = 0; | 109 current_trace_id_ = 0; |
110 data_ = ""; | 110 data_ = ""; |
(...skipping 15 matching lines...) Expand all Loading... |
126 // static | 126 // static |
127 scoped_ptr<TracingManager> TracingManager::Create() { | 127 scoped_ptr<TracingManager> TracingManager::Create() { |
128 if (g_tracing_manager) | 128 if (g_tracing_manager) |
129 return scoped_ptr<TracingManager>(); | 129 return scoped_ptr<TracingManager>(); |
130 return scoped_ptr<TracingManager>(new TracingManager()); | 130 return scoped_ptr<TracingManager>(new TracingManager()); |
131 } | 131 } |
132 | 132 |
133 TracingManager* TracingManager::Get() { | 133 TracingManager* TracingManager::Get() { |
134 return g_tracing_manager; | 134 return g_tracing_manager; |
135 } | 135 } |
OLD | NEW |