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); | |
64 void CountSize(); | 63 void CountSize(); |
65 void DidCountSize(int error); | 64 void DidCountSize(int error); |
66 void DidGetFileItemLength(size_t index, int64 result); | 65 void DidGetFileItemLength(size_t index, int64 result); |
67 void Seek(int64 offset); | 66 void Seek(int64 offset); |
68 | 67 |
69 // For reading the blob. | 68 // For reading the blob. |
70 bool ReadLoop(int* bytes_read); | 69 bool ReadLoop(int* bytes_read); |
71 bool ReadItem(); | 70 bool ReadItem(); |
72 void AdvanceItem(); | 71 void AdvanceItem(); |
73 void AdvanceBytesRead(int result); | 72 void AdvanceBytesRead(int result); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 bool byte_range_set_; | 107 bool byte_range_set_; |
109 net::HttpByteRange byte_range_; | 108 net::HttpByteRange byte_range_; |
110 scoped_ptr<net::HttpResponseInfo> response_info_; | 109 scoped_ptr<net::HttpResponseInfo> response_info_; |
111 | 110 |
112 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); | 111 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); |
113 }; | 112 }; |
114 | 113 |
115 } // namespace webkit_blob | 114 } // namespace webkit_blob |
116 | 115 |
117 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ | 116 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ |
OLD | NEW |