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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 DCHECK(trace_uploader_); 298 DCHECK(trace_uploader_);
299 trace_uploader_->DoUpload(file_contents, upload_mode, nullptr, 299 trace_uploader_->DoUpload(file_contents, upload_mode, nullptr,
300 progress_callback, done_callback); 300 progress_callback, done_callback);
301 // TODO(mmandlis): Add support for stopping the upload in progress. 301 // TODO(mmandlis): Add support for stopping the upload in progress.
302 } 302 }
303 303
304 void TracingUI::OnTraceUploadProgress(int64_t current, int64_t total) { 304 void TracingUI::OnTraceUploadProgress(int64_t current, int64_t total) {
305 DCHECK(current <= total); 305 DCHECK(current <= total);
306 int percent = (current / total) * 100; 306 int percent = (current / total) * 100;
307 web_ui()->CallJavascriptFunctionUnsafe( 307 web_ui()->CallJavascriptFunctionUnsafe(
308 "onUploadProgress", base::FundamentalValue(percent), 308 "onUploadProgress", base::Value(percent),
309 base::StringValue(base::StringPrintf("%" PRId64, current)), 309 base::StringValue(base::StringPrintf("%" PRId64, current)),
310 base::StringValue(base::StringPrintf("%" PRId64, total))); 310 base::StringValue(base::StringPrintf("%" PRId64, total)));
311 } 311 }
312 312
313 void TracingUI::OnTraceUploadComplete(bool success, 313 void TracingUI::OnTraceUploadComplete(bool success,
314 const std::string& feedback) { 314 const std::string& feedback) {
315 if (success) { 315 if (success) {
316 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete", 316 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete",
317 base::StringValue(feedback)); 317 base::StringValue(feedback));
318 } else { 318 } else {
319 web_ui()->CallJavascriptFunctionUnsafe("onUploadError", 319 web_ui()->CallJavascriptFunctionUnsafe("onUploadError",
320 base::StringValue(feedback)); 320 base::StringValue(feedback));
321 } 321 }
322 trace_uploader_.reset(); 322 trace_uploader_.reset();
323 } 323 }
324 324
325 } // namespace content 325 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/etw_tracing_agent_win.cc ('k') | content/browser/webui/web_ui_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698