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

Side by Side Diff: net/http/http_response_headers.cc

Issue 183763011: Reland "Add base::TimeDelta::Max()" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: print "unknown" Created 6 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | net/spdy/spdy_session.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 (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 // The rules for header parsing were borrowed from Firefox: 5 // The rules for header parsing were borrowed from Firefox:
6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo nseHead.cpp 6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo nseHead.cpp
7 // The rules for parsing content-types were also borrowed from Firefox: 7 // The rules for parsing content-types were also borrowed from Firefox:
8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834
9 9
10 #include "net/http/http_response_headers.h" 10 #include "net/http/http_response_headers.h"
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 Time last_modified_value; 1002 Time last_modified_value;
1003 if (GetLastModifiedValue(&last_modified_value)) { 1003 if (GetLastModifiedValue(&last_modified_value)) {
1004 // The last-modified value can be a date in the past! 1004 // The last-modified value can be a date in the past!
1005 if (last_modified_value <= date_value) 1005 if (last_modified_value <= date_value)
1006 return (date_value - last_modified_value) / 10; 1006 return (date_value - last_modified_value) / 10;
1007 } 1007 }
1008 } 1008 }
1009 1009
1010 // These responses are implicitly fresh (unless otherwise overruled): 1010 // These responses are implicitly fresh (unless otherwise overruled):
1011 if (response_code_ == 300 || response_code_ == 301 || response_code_ == 410) 1011 if (response_code_ == 300 || response_code_ == 301 || response_code_ == 410)
1012 return TimeDelta::FromMicroseconds(kint64max); 1012 return TimeDelta::Max();
1013 1013
1014 return TimeDelta(); // not fresh 1014 return TimeDelta(); // not fresh
1015 } 1015 }
1016 1016
1017 // From RFC 2616 section 13.2.3: 1017 // From RFC 2616 section 13.2.3:
1018 // 1018 //
1019 // Summary of age calculation algorithm, when a cache receives a response: 1019 // Summary of age calculation algorithm, when a cache receives a response:
1020 // 1020 //
1021 // /* 1021 // /*
1022 // * age_value 1022 // * age_value
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 iter = NULL; 1440 iter = NULL;
1441 while (EnumerateHeader(&iter, "via", &value)) 1441 while (EnumerateHeader(&iter, "via", &value))
1442 if (value == kDeprecatedChromeProxyViaValue) 1442 if (value == kDeprecatedChromeProxyViaValue)
1443 return true; 1443 return true;
1444 1444
1445 return false; 1445 return false;
1446 } 1446 }
1447 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) 1447 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
1448 1448
1449 } // namespace net 1449 } // namespace net
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698