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

Side by Side Diff: webkit/media/cache_util.h

Issue 10387200: Suppress pause-and-buffer behavior when the HTTP response won't satisfy future requests via cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bitfield for reasons and fix typo picking out the Date header. Created 8 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_MEDIA_CACHE_UTIL_H_
6 #define WEBKIT_MEDIA_CACHE_UTIL_H_
7
8 #include <vector>
9
10 namespace WebKit {
11 class WebURLResponse;
12 }
13
14 namespace webkit_media {
15
16 // Reasons that a cached WebURLResponse will *not* prevent a future request to
17 // the server. Reported via UMA, so don't change/reuse previously-existing
18 // values.
19 enum UncacheableReason {
20 kNoData = 1 << 0, // Not 200 or 206.
21 kPre11PartialResponse = 1 << 1, // 206 but HTTP version < 1.1.
22 kNoStrongValidatorOnPartialResponse = 1 << 2, // 206, no strong validator.
23 kShortMaxAge = 1 << 3, // Max age less than 1h (arbitrary value).
24 kExpiresTooSoon = 1 << 4, // Expires in less than 1h (arbitrary value).
25 kHasMustRevalidate = 1 << 5, // Response asks for revalidation.
26 kNoCache = 1 << 6, // Response included a no-cache header.
27 kNoStore = 1 << 7, // Response included a no-store header.
28 kMaxReason // Needs to be one more than max legitimate reason.
29 };
30
31 // Return the reasons "response" cannot be used for a future request (using the
32 // disk cache), or an empty vector if it might be useful.
33 std::vector<UncacheableReason> GetReasonsForUncacheability(
34 const WebKit::WebURLResponse& response);
35
36 } // namespace webkit_media
37
38 #endif // WEBKIT_MEDIA_CACHE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698