| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // subsequent partial-content responses. We use sparse cache entries to store | 24 // subsequent partial-content responses. We use sparse cache entries to store |
| 25 // these requests. This class is tightly integrated with HttpCache::Transaction | 25 // these requests. This class is tightly integrated with HttpCache::Transaction |
| 26 // and it is intended to allow a cleaner implementation of that class. | 26 // and it is intended to allow a cleaner implementation of that class. |
| 27 // | 27 // |
| 28 // In order to fulfill range requests, we may have to perform a sequence of | 28 // In order to fulfill range requests, we may have to perform a sequence of |
| 29 // reads from the cache, interleaved with reads from the network / writes to the | 29 // reads from the cache, interleaved with reads from the network / writes to the |
| 30 // cache. This class basically keeps track of the data required to perform each | 30 // cache. This class basically keeps track of the data required to perform each |
| 31 // of those individual network / cache requests. | 31 // of those individual network / cache requests. |
| 32 class PartialData { | 32 class PartialData { |
| 33 public: | 33 public: |
| 34 PartialData() | 34 PartialData(); |
| 35 : range_present_(false), final_range_(false), sparse_entry_(true), | |
| 36 truncated_(false), core_(NULL), callback_(NULL) {} | |
| 37 ~PartialData(); | 35 ~PartialData(); |
| 38 | 36 |
| 39 // Performs initialization of the object by examining the request |headers| | 37 // Performs initialization of the object by examining the request |headers| |
| 40 // and verifying that we can process the requested range. Returns true if | 38 // and verifying that we can process the requested range. Returns true if |
| 41 // we can process the requested range, and false otherwise. | 39 // we can process the requested range, and false otherwise. |
| 42 bool Init(const HttpRequestHeaders& headers); | 40 bool Init(const HttpRequestHeaders& headers); |
| 43 | 41 |
| 44 // Sets the headers that we should use to make byte range requests. This is a | 42 // Sets the headers that we should use to make byte range requests. This is a |
| 45 // subset of the request extra headers, with byte-range related headers | 43 // subset of the request extra headers, with byte-range related headers |
| 46 // removed. | 44 // removed. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 bool truncated_; // We have an incomplete 200 stored. | 131 bool truncated_; // We have an incomplete 200 stored. |
| 134 Core* core_; | 132 Core* core_; |
| 135 CompletionCallback* callback_; | 133 CompletionCallback* callback_; |
| 136 | 134 |
| 137 DISALLOW_COPY_AND_ASSIGN(PartialData); | 135 DISALLOW_COPY_AND_ASSIGN(PartialData); |
| 138 }; | 136 }; |
| 139 | 137 |
| 140 } // namespace net | 138 } // namespace net |
| 141 | 139 |
| 142 #endif // NET_HTTP_PARTIAL_DATA_H_ | 140 #endif // NET_HTTP_PARTIAL_DATA_H_ |
| OLD | NEW |