| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 CONTENT_BROWSER_ANDROID_URL_REQUEST_CONTENT_JOB_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_URL_REQUEST_CONTENT_JOB_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_URL_REQUEST_CONTENT_JOB_H_ | 6 #define CONTENT_BROWSER_ANDROID_URL_REQUEST_CONTENT_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 URLRequestContentJob( | 36 URLRequestContentJob( |
| 37 net::URLRequest* request, | 37 net::URLRequest* request, |
| 38 net::NetworkDelegate* network_delegate, | 38 net::NetworkDelegate* network_delegate, |
| 39 const base::FilePath& content_path, | 39 const base::FilePath& content_path, |
| 40 const scoped_refptr<base::TaskRunner>& content_task_runner); | 40 const scoped_refptr<base::TaskRunner>& content_task_runner); |
| 41 | 41 |
| 42 // net::URLRequestJob: | 42 // net::URLRequestJob: |
| 43 void Start() override; | 43 void Start() override; |
| 44 void Kill() override; | 44 void Kill() override; |
| 45 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; | 45 int ReadRawData(net::IOBuffer* buf, int buf_size) override; |
| 46 bool IsRedirectResponse(GURL* location, int* http_status_code) override; | 46 bool IsRedirectResponse(GURL* location, int* http_status_code) override; |
| 47 bool GetMimeType(std::string* mime_type) const override; | 47 bool GetMimeType(std::string* mime_type) const override; |
| 48 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; | 48 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 ~URLRequestContentJob() override; | 51 ~URLRequestContentJob() override; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // Meta information about the content URI. It's used as a member in the | 54 // Meta information about the content URI. It's used as a member in the |
| 55 // URLRequestContentJob and also passed between threads because disk access is | 55 // URLRequestContentJob and also passed between threads because disk access is |
| (...skipping 26 matching lines...) Expand all Loading... |
| 82 void DidRead(scoped_refptr<net::IOBuffer> buf, int result); | 82 void DidRead(scoped_refptr<net::IOBuffer> buf, int result); |
| 83 | 83 |
| 84 // The full path of the content URI. | 84 // The full path of the content URI. |
| 85 base::FilePath content_path_; | 85 base::FilePath content_path_; |
| 86 | 86 |
| 87 scoped_ptr<net::FileStream> stream_; | 87 scoped_ptr<net::FileStream> stream_; |
| 88 ContentMetaInfo meta_info_; | 88 ContentMetaInfo meta_info_; |
| 89 const scoped_refptr<base::TaskRunner> content_task_runner_; | 89 const scoped_refptr<base::TaskRunner> content_task_runner_; |
| 90 | 90 |
| 91 net::HttpByteRange byte_range_; | 91 net::HttpByteRange byte_range_; |
| 92 net::Error range_parse_result_; |
| 92 int64 remaining_bytes_; | 93 int64 remaining_bytes_; |
| 93 | 94 |
| 94 bool io_pending_; | 95 bool io_pending_; |
| 95 | 96 |
| 96 base::WeakPtrFactory<URLRequestContentJob> weak_ptr_factory_; | 97 base::WeakPtrFactory<URLRequestContentJob> weak_ptr_factory_; |
| 97 | 98 |
| 98 DISALLOW_COPY_AND_ASSIGN(URLRequestContentJob); | 99 DISALLOW_COPY_AND_ASSIGN(URLRequestContentJob); |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 } // namespace content | 102 } // namespace content |
| 102 | 103 |
| 103 #endif // CONTENT_BROWSER_ANDROID_URL_REQUEST_CONTENT_JOB_H_ | 104 #endif // CONTENT_BROWSER_ANDROID_URL_REQUEST_CONTENT_JOB_H_ |
| OLD | NEW |