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

Side by Side Diff: media/blink/cache_util.cc

Issue 1282363003: Convert remaining StringToLowerASCII to ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « media/base/mime_util.cc ('k') | media/blink/key_system_config_selector.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/blink/cache_util.h" 5 #include "media/blink/cache_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 29 matching lines...) Expand all
40 if (code == kHttpPartialContent && 40 if (code == kHttpPartialContent &&
41 !net::HttpUtil::HasStrongValidators( 41 !net::HttpUtil::HasStrongValidators(
42 http_version, 42 http_version,
43 response.httpHeaderField("etag").utf8(), 43 response.httpHeaderField("etag").utf8(),
44 response.httpHeaderField("Last-Modified").utf8(), 44 response.httpHeaderField("Last-Modified").utf8(),
45 response.httpHeaderField("Date").utf8())) { 45 response.httpHeaderField("Date").utf8())) {
46 reasons |= kNoStrongValidatorOnPartialResponse; 46 reasons |= kNoStrongValidatorOnPartialResponse;
47 } 47 }
48 48
49 std::string cache_control_header = 49 std::string cache_control_header =
50 response.httpHeaderField("cache-control").utf8(); 50 base::ToLowerASCII(response.httpHeaderField("cache-control").utf8());
51 base::StringToLowerASCII(&cache_control_header);
52 if (cache_control_header.find("no-cache") != std::string::npos) 51 if (cache_control_header.find("no-cache") != std::string::npos)
53 reasons |= kNoCache; 52 reasons |= kNoCache;
54 if (cache_control_header.find("no-store") != std::string::npos) 53 if (cache_control_header.find("no-store") != std::string::npos)
55 reasons |= kNoStore; 54 reasons |= kNoStore;
56 if (cache_control_header.find("must-revalidate") != std::string::npos) 55 if (cache_control_header.find("must-revalidate") != std::string::npos)
57 reasons |= kHasMustRevalidate; 56 reasons |= kHasMustRevalidate;
58 57
59 const TimeDelta kMinimumAgeForUsefulness = 58 const TimeDelta kMinimumAgeForUsefulness =
60 TimeDelta::FromSeconds(3600); // Arbitrary value. 59 TimeDelta::FromSeconds(3600); // Arbitrary value.
61 60
(...skipping 16 matching lines...) Expand all
78 &expires) && 77 &expires) &&
79 date > Time() && expires > Time() && 78 date > Time() && expires > Time() &&
80 (expires - date) < kMinimumAgeForUsefulness) { 79 (expires - date) < kMinimumAgeForUsefulness) {
81 reasons |= kExpiresTooSoon; 80 reasons |= kExpiresTooSoon;
82 } 81 }
83 82
84 return reasons; 83 return reasons;
85 } 84 }
86 85
87 } // namespace media 86 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mime_util.cc ('k') | media/blink/key_system_config_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698