| Index: webkit/media/cache_util.h
|
| diff --git a/webkit/media/cache_util.h b/webkit/media/cache_util.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a79cc256d141d898098511207ea652101eab334e
|
| --- /dev/null
|
| +++ b/webkit/media/cache_util.h
|
| @@ -0,0 +1,38 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WEBKIT_MEDIA_CACHE_UTIL_H_
|
| +#define WEBKIT_MEDIA_CACHE_UTIL_H_
|
| +
|
| +#include <vector>
|
| +
|
| +namespace WebKit {
|
| +class WebURLResponse;
|
| +}
|
| +
|
| +namespace webkit_media {
|
| +
|
| +// Reasons that a cached WebURLResponse will *not* prevent a future request to
|
| +// the server. Reported via UMA, so don't change/reuse previously-existing
|
| +// values.
|
| +enum UncacheableReason {
|
| + kNoData = 1, // Not 200 or 206.
|
| + kPre11PartialResponse = 2, // 206 but HTTP version < 1.1.
|
| + kNoStrongValidatorOnPartialResponse = 3, // 206, no strong validator.
|
| + kShortMaxAge = 4, // Max age less than 1h (arbitrary value).
|
| + kExpiresTooSoon = 5, // Expires in less than 1h (arbitrary value).
|
| + kHasMustRevalidate = 6, // Response asks for revalidation.
|
| + kNoCache = 7, // Response included a no-cache header.
|
| + kNoStore = 8, // Response included a no-store header.
|
| + kMaxReason // Needs to be one more than max legitimate reason.
|
| +};
|
| +
|
| +// Return the reasons "response" cannot be used for a future request (using the
|
| +// disk cache), or an empty vector if it might be useful.
|
| +std::vector<UncacheableReason> GetReasonsForUncacheability(
|
| + const WebKit::WebURLResponse& response);
|
| +
|
| +} // namespace webkit_media
|
| +
|
| +#endif // WEBKIT_MEDIA_CACHE_UTIL_H_
|
|
|