| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // A request job that handles reading blob URLs. | 28 // A request job that handles reading blob URLs. |
| 29 class BLOB_EXPORT BlobURLRequestJob : public net::URLRequestJob { | 29 class BLOB_EXPORT BlobURLRequestJob : public net::URLRequestJob { |
| 30 public: | 30 public: |
| 31 BlobURLRequestJob(net::URLRequest* request, | 31 BlobURLRequestJob(net::URLRequest* request, |
| 32 BlobData* blob_data, | 32 BlobData* blob_data, |
| 33 base::MessageLoopProxy* resolving_message_loop_proxy); | 33 base::MessageLoopProxy* resolving_message_loop_proxy); |
| 34 virtual ~BlobURLRequestJob(); | 34 virtual ~BlobURLRequestJob(); |
| 35 | 35 |
| 36 // net::URLRequestJob methods. | 36 // net::URLRequestJob methods. |
| 37 virtual void Start(); | 37 virtual void Start() OVERRIDE; |
| 38 virtual void Kill(); | 38 virtual void Kill() OVERRIDE; |
| 39 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); | 39 virtual bool ReadRawData(net::IOBuffer* buf, |
| 40 virtual bool GetMimeType(std::string* mime_type) const; | 40 int buf_size, |
| 41 virtual void GetResponseInfo(net::HttpResponseInfo* info); | 41 int* bytes_read) OVERRIDE; |
| 42 virtual int GetResponseCode() const; | 42 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
| 43 virtual void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers); | 43 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; |
| 44 virtual int GetResponseCode() const OVERRIDE; |
| 45 virtual void SetExtraRequestHeaders( |
| 46 const net::HttpRequestHeaders& headers) OVERRIDE; |
| 44 | 47 |
| 45 private: | 48 private: |
| 46 void CloseStream(); | 49 void CloseStream(); |
| 47 void ResolveFile(const FilePath& file_path); | 50 void ResolveFile(const FilePath& file_path); |
| 48 void CountSize(); | 51 void CountSize(); |
| 49 void Seek(int64 offset); | 52 void Seek(int64 offset); |
| 50 void AdvanceItem(); | 53 void AdvanceItem(); |
| 51 void AdvanceBytesRead(int result); | 54 void AdvanceBytesRead(int result); |
| 52 int ComputeBytesToRead() const; | 55 int ComputeBytesToRead() const; |
| 53 bool ReadLoop(int* bytes_read); | 56 bool ReadLoop(int* bytes_read); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 bool byte_range_set_; | 90 bool byte_range_set_; |
| 88 net::HttpByteRange byte_range_; | 91 net::HttpByteRange byte_range_; |
| 89 scoped_ptr<net::HttpResponseInfo> response_info_; | 92 scoped_ptr<net::HttpResponseInfo> response_info_; |
| 90 | 93 |
| 91 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); | 94 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); |
| 92 }; | 95 }; |
| 93 | 96 |
| 94 } // namespace webkit_blob | 97 } // namespace webkit_blob |
| 95 | 98 |
| 96 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ | 99 #endif // WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ |
| OLD | NEW |