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

Side by Side Diff: components/feedback/tracing_manager.cc

Issue 1165673002: [Startup Tracing] Hook up TraceConfig and remove CategoryFilter & TraceOptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 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
« no previous file with comments | « chrome/test/base/tracing.cc ('k') | components/tracing/child_trace_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/test/base/tracing.cc ('k') | components/tracing/child_trace_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698