Index: webkit/blob/blob_url_request_job.h |
diff --git a/webkit/blob/blob_url_request_job.h b/webkit/blob/blob_url_request_job.h |
index 2dec52274fd73c58faf2882079ce8f982c76df2e..68d532081322be65adc767ed9462278d481c75ae 100644 |
--- a/webkit/blob/blob_url_request_job.h |
+++ b/webkit/blob/blob_url_request_job.h |
@@ -11,7 +11,6 @@ |
#include "base/scoped_ptr.h" |
#include "base/task.h" |
#include "net/base/completion_callback.h" |
-#include "net/base/file_stream.h" |
#include "net/http/http_byte_range.h" |
#include "net/url_request/url_request_job.h" |
#include "webkit/blob/blob_data.h" |
@@ -21,6 +20,10 @@ class MessageLoopProxy; |
struct PlatformFileInfo; |
} |
+namespace net { |
+class FileStream; |
+} |
+ |
namespace webkit_blob { |
// A request job that handles reading blob URLs. |
@@ -41,14 +44,17 @@ class BlobURLRequestJob : public net::URLRequestJob { |
virtual void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers); |
private: |
+ void CloseStream(); |
void ResolveFile(const FilePath& file_path); |
void CountSize(); |
void Seek(int64 offset); |
void AdvanceItem(); |
void AdvanceBytesRead(int result); |
+ int ComputeBytesToRead(); |
bool ReadLoop(int* bytes_read); |
bool ReadItem(); |
bool ReadBytes(const BlobData::Item& item, int bytes_to_read); |
+ bool DispatchReadFile(const BlobData::Item& item, int bytes_to_read); |
bool ReadFile(const BlobData::Item& item, int bytes_to_read); |
void HeadersCompleted(int status_code, const std::string& status_txt); |
int ReadCompleted(); |
@@ -58,6 +64,9 @@ class BlobURLRequestJob : public net::URLRequestJob { |
void DidStart(); |
void DidResolve(base::PlatformFileError rv, |
const base::PlatformFileInfo& file_info); |
+ void DidOpen(base::PlatformFileError rv, |
+ base::PassPlatformFile file, |
+ bool created); |
void DidRead(int result); |
base::ScopedCallbackFactory<BlobURLRequestJob> callback_factory_; |
@@ -65,7 +74,7 @@ class BlobURLRequestJob : public net::URLRequestJob { |
scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; |
net::CompletionCallbackImpl<BlobURLRequestJob> io_callback_; |
std::vector<int64> item_length_list_; |
- net::FileStream stream_; |
+ scoped_ptr<net::FileStream> stream_; |
size_t item_index_; |
int64 total_size_; |
int64 current_item_offset_; |