OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef NET_HTTP_PARTIAL_DATA_H_ | 5 #ifndef NET_HTTP_PARTIAL_DATA_H_ |
6 #define NET_HTTP_PARTIAL_DATA_H_ | 6 #define NET_HTTP_PARTIAL_DATA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 // Returns true if the current range is stored in the cache. | 56 // Returns true if the current range is stored in the cache. |
57 bool IsCurrentRangeCached() const; | 57 bool IsCurrentRangeCached() const; |
58 | 58 |
59 // Returns true if the current range is the last one needed to fulfill the | 59 // Returns true if the current range is the last one needed to fulfill the |
60 // user's request. | 60 // user's request. |
61 bool IsLastRange() const; | 61 bool IsLastRange() const; |
62 | 62 |
63 // Extracts info from headers already stored in the cache. Returns false if | 63 // Extracts info from headers already stored in the cache. Returns false if |
64 // there is any problem with the headers or the requested range. | 64 // there is any problem with the headers or the requested range. |
65 bool UpdateFromStoredHeaders(const HttpResponseHeaders* headers); | 65 bool UpdateFromStoredHeaders(const HttpResponseHeaders* headers, |
| 66 disk_cache::Entry* entry); |
66 | 67 |
67 // Returns true if the response headers match what we expect, false otherwise. | 68 // Returns true if the response headers match what we expect, false otherwise. |
68 bool ResponseHeadersOK(const HttpResponseHeaders* headers); | 69 bool ResponseHeadersOK(const HttpResponseHeaders* headers); |
69 | 70 |
70 // Fixes the response headers to include the right content length and range. | 71 // Fixes the response headers to include the right content length and range. |
71 void FixResponseHeaders(HttpResponseHeaders* headers); | 72 void FixResponseHeaders(HttpResponseHeaders* headers); |
72 | 73 |
73 // Fixes the content length that we want to store in the cache. | 74 // Fixes the content length that we want to store in the cache. |
74 void FixContentLength(HttpResponseHeaders* headers); | 75 void FixContentLength(HttpResponseHeaders* headers); |
75 | 76 |
(...skipping 29 matching lines...) Expand all Loading... |
105 std::string extra_headers_; // The clean set of extra headers (no ranges). | 106 std::string extra_headers_; // The clean set of extra headers (no ranges). |
106 bool range_present_; // True if next range entry is already stored. | 107 bool range_present_; // True if next range entry is already stored. |
107 bool final_range_; | 108 bool final_range_; |
108 | 109 |
109 DISALLOW_COPY_AND_ASSIGN(PartialData); | 110 DISALLOW_COPY_AND_ASSIGN(PartialData); |
110 }; | 111 }; |
111 | 112 |
112 } // namespace net | 113 } // namespace net |
113 | 114 |
114 #endif // NET_HTTP_PARTIAL_DATA_H_ | 115 #endif // NET_HTTP_PARTIAL_DATA_H_ |
OLD | NEW |