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

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

Issue 1549113002: Switch to standard integer types in content/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 12 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 | « content/browser/tracing/tracing_ui.h ('k') | content/browser/udev_linux.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 (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>
8
7 #include <set> 9 #include <set>
8 #include <string> 10 #include <string>
9 #include <vector> 11 #include <vector>
10 12
11 #include "base/base64.h" 13 #include "base/base64.h"
12 #include "base/bind.h" 14 #include "base/bind.h"
13 #include "base/bind_helpers.h" 15 #include "base/bind_helpers.h"
14 #include "base/command_line.h" 16 #include "base/command_line.h"
15 #include "base/format_macros.h" 17 #include "base/format_macros.h"
16 #include "base/json/json_reader.h" 18 #include "base/json/json_reader.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 weak_factory_.GetWeakPtr()); 371 weak_factory_.GetWeakPtr());
370 372
371 trace_uploader_ = delegate_->GetTraceUploader( 373 trace_uploader_ = delegate_->GetTraceUploader(
372 web_ui()->GetWebContents()->GetBrowserContext()->GetRequestContext()); 374 web_ui()->GetWebContents()->GetBrowserContext()->GetRequestContext());
373 DCHECK(trace_uploader_); 375 DCHECK(trace_uploader_);
374 trace_uploader_->DoUpload(file_contents, upload_mode, nullptr, 376 trace_uploader_->DoUpload(file_contents, upload_mode, nullptr,
375 progress_callback, done_callback); 377 progress_callback, done_callback);
376 // TODO(mmandlis): Add support for stopping the upload in progress. 378 // TODO(mmandlis): Add support for stopping the upload in progress.
377 } 379 }
378 380
379 void TracingUI::OnTraceUploadProgress(int64 current, int64 total) { 381 void TracingUI::OnTraceUploadProgress(int64_t current, int64_t total) {
380 DCHECK(current <= total); 382 DCHECK(current <= total);
381 int percent = (current / total) * 100; 383 int percent = (current / total) * 100;
382 web_ui()->CallJavascriptFunction( 384 web_ui()->CallJavascriptFunction(
383 "onUploadProgress", 385 "onUploadProgress",
384 base::FundamentalValue(percent), 386 base::FundamentalValue(percent),
385 base::StringValue(base::StringPrintf("%" PRId64, current)), 387 base::StringValue(base::StringPrintf("%" PRId64, current)),
386 base::StringValue(base::StringPrintf("%" PRId64, total))); 388 base::StringValue(base::StringPrintf("%" PRId64, total)));
387 } 389 }
388 390
389 void TracingUI::OnTraceUploadComplete(bool success, 391 void TracingUI::OnTraceUploadComplete(bool success,
390 const std::string& feedback) { 392 const std::string& feedback) {
391 if (success) { 393 if (success) {
392 web_ui()->CallJavascriptFunction("onUploadComplete", 394 web_ui()->CallJavascriptFunction("onUploadComplete",
393 base::StringValue(feedback)); 395 base::StringValue(feedback));
394 } else { 396 } else {
395 web_ui()->CallJavascriptFunction("onUploadError", 397 web_ui()->CallJavascriptFunction("onUploadError",
396 base::StringValue(feedback)); 398 base::StringValue(feedback));
397 } 399 }
398 trace_uploader_.reset(); 400 trace_uploader_.reset();
399 } 401 }
400 402
401 } // namespace content 403 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/tracing_ui.h ('k') | content/browser/udev_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698