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

Side by Side Diff: content/browser/download/download_stats.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
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/download/download_stats.h" 5 #include "content/browser/download/download_stats.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "content/browser/download/download_resource_handler.h" 9 #include "content/browser/download/download_resource_handler.h"
10 #include "content/public/browser/download_interrupt_reasons.h" 10 #include "content/public/browser/download_interrupt_reasons.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Record the value. 298 // Record the value.
299 UMA_HISTOGRAM_ENUMERATION("Download.ContentType", 299 UMA_HISTOGRAM_ENUMERATION("Download.ContentType",
300 download_content, 300 download_content,
301 DOWNLOAD_CONTENT_MAX); 301 DOWNLOAD_CONTENT_MAX);
302 } 302 }
303 303
304 void RecordDownloadContentDisposition( 304 void RecordDownloadContentDisposition(
305 const std::string& content_disposition_string) { 305 const std::string& content_disposition_string) {
306 if (content_disposition_string.empty()) 306 if (content_disposition_string.empty())
307 return; 307 return;
308 net::HttpContentDisposition content_disposition( 308 net::HttpContentDisposition content_disposition(content_disposition_string,
309 content_disposition_string, ""); 309 std::string());
310 int result = content_disposition.parse_result_flags(); 310 int result = content_disposition.parse_result_flags();
311 311
312 bool is_valid = !content_disposition.filename().empty(); 312 bool is_valid = !content_disposition.filename().empty();
313 RecordContentDispositionCount(CONTENT_DISPOSITION_HEADER_PRESENT, true); 313 RecordContentDispositionCount(CONTENT_DISPOSITION_HEADER_PRESENT, true);
314 RecordContentDispositionCount(CONTENT_DISPOSITION_IS_VALID, is_valid); 314 RecordContentDispositionCount(CONTENT_DISPOSITION_IS_VALID, is_valid);
315 if (!is_valid) 315 if (!is_valid)
316 return; 316 return;
317 317
318 RecordContentDispositionCountFlag( 318 RecordContentDispositionCountFlag(
319 CONTENT_DISPOSITION_HAS_DISPOSITION_TYPE, result, 319 CONTENT_DISPOSITION_HAS_DISPOSITION_TYPE, result,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 disk_write_time_ms * 100 / elapsed_time_ms); 428 disk_write_time_ms * 100 / elapsed_time_ms);
429 } 429 }
430 430
431 void RecordSavePackageEvent(SavePackageEvent event) { 431 void RecordSavePackageEvent(SavePackageEvent event) {
432 UMA_HISTOGRAM_ENUMERATION("Download.SavePackage", 432 UMA_HISTOGRAM_ENUMERATION("Download.SavePackage",
433 event, 433 event,
434 SAVE_PACKAGE_LAST_ENTRY); 434 SAVE_PACKAGE_LAST_ENTRY);
435 } 435 }
436 436
437 } // namespace content 437 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/browser/download/save_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698