OLD | NEW |
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 #ifndef WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ | 5 #ifndef WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ |
6 #define WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ | 6 #define WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const net::HttpRequestHeaders& headers) OVERRIDE; | 53 const net::HttpRequestHeaders& headers) OVERRIDE; |
54 | 54 |
55 protected: | 55 protected: |
56 virtual ~BlobURLRequestJob(); | 56 virtual ~BlobURLRequestJob(); |
57 | 57 |
58 private: | 58 private: |
59 typedef std::map<size_t, FileStreamReader*> IndexToReaderMap; | 59 typedef std::map<size_t, FileStreamReader*> IndexToReaderMap; |
60 | 60 |
61 // For preparing for read: get the size, apply the range and perform seek. | 61 // For preparing for read: get the size, apply the range and perform seek. |
62 void DidStart(); | 62 void DidStart(); |
| 63 bool AddItemLength(size_t index, int64 item_length); |
63 void CountSize(); | 64 void CountSize(); |
64 void DidCountSize(int error); | 65 void DidCountSize(int error); |
65 void DidGetFileItemLength(size_t index, int64 result); | 66 void DidGetFileItemLength(size_t index, int64 result); |
66 void Seek(int64 offset); | 67 void Seek(int64 offset); |
67 | 68 |
68 // For reading the blob. | 69 // For reading the blob. |
69 bool ReadLoop(int* bytes_read); | 70 bool ReadLoop(int* bytes_read); |
70 bool ReadItem(); | 71 bool ReadItem(); |
71 void AdvanceItem(); | 72 void AdvanceItem(); |
72 void AdvanceBytesRead(int result); | 73 void AdvanceBytesRead(int result); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 bool byte_range_set_; | 108 bool byte_range_set_; |
108 net::HttpByteRange byte_range_; | 109 net::HttpByteRange byte_range_; |
109 scoped_ptr<net::HttpResponseInfo> response_info_; | 110 scoped_ptr<net::HttpResponseInfo> response_info_; |
110 | 111 |
111 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); | 112 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); |
112 }; | 113 }; |
113 | 114 |
114 } // namespace webkit_blob | 115 } // namespace webkit_blob |
115 | 116 |
116 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ | 117 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ |
OLD | NEW |