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

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

Issue 425593002: Refactor trace_event_impl's SetEnabled to use TraceOptions. Propagate this through the whole stack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address joechan's comments Created 6 years, 4 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/file_util.h" 8 #include "base/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // If the trace has already been requested, provide an empty string. 84 // If the trace has already been requested, provide an empty string.
85 if (!trace_callback_.is_null()) { 85 if (!trace_callback_.is_null()) {
86 trace_callback_.Run(scoped_refptr<base::RefCountedString>()); 86 trace_callback_.Run(scoped_refptr<base::RefCountedString>());
87 trace_callback_.Reset(); 87 trace_callback_.Reset();
88 } 88 }
89 } 89 }
90 } 90 }
91 91
92 void TracingManager::StartTracing() { 92 void TracingManager::StartTracing() {
93 content::TracingController::GetInstance()->EnableRecording( 93 content::TracingController::GetInstance()->EnableRecording(
94 "", content::TracingController::DEFAULT_OPTIONS, 94 base::debug::CategoryFilter(),
95 base::debug::TraceOptions(),
95 content::TracingController::EnableRecordingDoneCallback()); 96 content::TracingController::EnableRecordingDoneCallback());
96 } 97 }
97 98
98 void TracingManager::OnTraceDataCollected(const base::FilePath& path) { 99 void TracingManager::OnTraceDataCollected(const base::FilePath& path) {
99 if (!current_trace_id_) 100 if (!current_trace_id_)
100 return; 101 return;
101 102
102 std::string data; 103 std::string data;
103 if (!base::ReadFileToString(path, &data)) { 104 if (!base::ReadFileToString(path, &data)) {
104 LOG(ERROR) << "Failed to read trace data from: " << path.value(); 105 LOG(ERROR) << "Failed to read trace data from: " << path.value();
(...skipping 28 matching lines...) Expand all
133 // static 134 // static
134 scoped_ptr<TracingManager> TracingManager::Create() { 135 scoped_ptr<TracingManager> TracingManager::Create() {
135 if (g_tracing_manager) 136 if (g_tracing_manager)
136 return scoped_ptr<TracingManager>(); 137 return scoped_ptr<TracingManager>();
137 return scoped_ptr<TracingManager>(new TracingManager()); 138 return scoped_ptr<TracingManager>(new TracingManager());
138 } 139 }
139 140
140 TracingManager* TracingManager::Get() { 141 TracingManager* TracingManager::Get() {
141 return g_tracing_manager; 142 return g_tracing_manager;
142 } 143 }
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