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

Side by Side Diff: content/browser/tracing/tracing_ui.cc

Issue 717083003: Report trace buffer usage as number of events, not only percentage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/tracing/tracing_ui.h" 5 #include "content/browser/tracing/tracing_ui.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 tracing_options, 123 tracing_options,
124 base::Bind(&OnRecordingEnabledAck, callback)); 124 base::Bind(&OnRecordingEnabledAck, callback));
125 } 125 }
126 126
127 void OnRecordingEnabledAck(const WebUIDataSource::GotDataCallback& callback) { 127 void OnRecordingEnabledAck(const WebUIDataSource::GotDataCallback& callback) {
128 base::RefCountedString* res = new base::RefCountedString(); 128 base::RefCountedString* res = new base::RefCountedString();
129 callback.Run(res); 129 callback.Run(res);
130 } 130 }
131 131
132 void OnTraceBufferPercentFullResult( 132 void OnTraceBufferPercentFullResult(
133 const WebUIDataSource::GotDataCallback& callback, float result) { 133 const WebUIDataSource::GotDataCallback& callback,
134 float result,
135 size_t buffer_usage) {
134 std::string str = base::DoubleToString(result); 136 std::string str = base::DoubleToString(result);
135 callback.Run(base::RefCountedString::TakeString(&str)); 137 callback.Run(base::RefCountedString::TakeString(&str));
136 } 138 }
137 139
138 void OnMonitoringEnabledAck(const WebUIDataSource::GotDataCallback& callback); 140 void OnMonitoringEnabledAck(const WebUIDataSource::GotDataCallback& callback);
139 141
140 bool EnableMonitoring(const std::string& data64, 142 bool EnableMonitoring(const std::string& data64,
141 const WebUIDataSource::GotDataCallback& callback) { 143 const WebUIDataSource::GotDataCallback& callback) {
142 base::debug::TraceOptions tracing_options; 144 base::debug::TraceOptions tracing_options;
143 base::debug::CategoryFilter category_filter(""); 145 base::debug::CategoryFilter category_filter("");
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 if (success) { 379 if (success) {
378 web_ui()->CallJavascriptFunction("onUploadComplete", 380 web_ui()->CallJavascriptFunction("onUploadComplete",
379 base::StringValue(report_id)); 381 base::StringValue(report_id));
380 } else { 382 } else {
381 web_ui()->CallJavascriptFunction("onUploadError", 383 web_ui()->CallJavascriptFunction("onUploadError",
382 base::StringValue(error_message)); 384 base::StringValue(error_message));
383 } 385 }
384 } 386 }
385 387
386 } // namespace content 388 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698