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

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

Issue 1172753003: Move LowerCaseEqualsASCII to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: Created 5 years, 6 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/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/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "content/browser/download/download_resource_handler.h" 10 #include "content/browser/download/download_resource_handler.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 UMA_HISTOGRAM_ENUMERATION("Download.WriteLoopCount", count, 20); 337 UMA_HISTOGRAM_ENUMERATION("Download.WriteLoopCount", count, 20);
338 } 338 }
339 339
340 void RecordAcceptsRanges(const std::string& accepts_ranges, 340 void RecordAcceptsRanges(const std::string& accepts_ranges,
341 int64 download_len, 341 int64 download_len,
342 bool has_strong_validator) { 342 bool has_strong_validator) {
343 int64 max = 1024 * 1024 * 1024; // One Terabyte. 343 int64 max = 1024 * 1024 * 1024; // One Terabyte.
344 download_len /= 1024; // In Kilobytes 344 download_len /= 1024; // In Kilobytes
345 static const int kBuckets = 50; 345 static const int kBuckets = 50;
346 346
347 if (LowerCaseEqualsASCII(accepts_ranges, "none")) { 347 if (base::LowerCaseEqualsASCII(accepts_ranges, "none")) {
348 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.AcceptRangesNone.KBytes", 348 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.AcceptRangesNone.KBytes",
349 download_len, 349 download_len,
350 1, 350 1,
351 max, 351 max,
352 kBuckets); 352 kBuckets);
353 } else if (LowerCaseEqualsASCII(accepts_ranges, "bytes")) { 353 } else if (base::LowerCaseEqualsASCII(accepts_ranges, "bytes")) {
354 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.AcceptRangesBytes.KBytes", 354 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.AcceptRangesBytes.KBytes",
355 download_len, 355 download_len,
356 1, 356 1,
357 max, 357 max,
358 kBuckets); 358 kBuckets);
359 if (has_strong_validator) 359 if (has_strong_validator)
360 RecordDownloadCount(STRONG_VALIDATOR_AND_ACCEPTS_RANGES); 360 RecordDownloadCount(STRONG_VALIDATOR_AND_ACCEPTS_RANGES);
361 } else { 361 } else {
362 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.AcceptRangesMissingOrInvalid.KBytes", 362 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.AcceptRangesMissingOrInvalid.KBytes",
363 download_len, 363 download_len,
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 int state) { 624 int state) {
625 if (is_partial) 625 if (is_partial)
626 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnPartialResumption", state, 626 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnPartialResumption", state,
627 ORIGIN_STATE_ON_RESUMPTION_MAX); 627 ORIGIN_STATE_ON_RESUMPTION_MAX);
628 else 628 else
629 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnFullResumption", state, 629 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnFullResumption", state,
630 ORIGIN_STATE_ON_RESUMPTION_MAX); 630 ORIGIN_STATE_ON_RESUMPTION_MAX);
631 } 631 }
632 632
633 } // namespace content 633 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/child_process_security_policy_impl.cc ('k') | content/browser/loader/buffered_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698