OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 ExternalFileURLRequestJob(void* profile_id, | 56 ExternalFileURLRequestJob(void* profile_id, |
57 net::URLRequest* request, | 57 net::URLRequest* request, |
58 net::NetworkDelegate* network_delegate); | 58 net::NetworkDelegate* network_delegate); |
59 | 59 |
60 // net::URLRequestJob overrides: | 60 // net::URLRequestJob overrides: |
61 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; | 61 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; |
62 void Start() override; | 62 void Start() override; |
63 void Kill() override; | 63 void Kill() override; |
64 bool GetMimeType(std::string* mime_type) const override; | 64 bool GetMimeType(std::string* mime_type) const override; |
65 bool IsRedirectResponse(GURL* location, int* http_status_code) override; | 65 bool IsRedirectResponse(GURL* location, int* http_status_code) override; |
66 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; | 66 int ReadRawData(net::IOBuffer* buf, int buf_size) override; |
67 | 67 |
68 protected: | 68 protected: |
69 ~ExternalFileURLRequestJob() override; | 69 ~ExternalFileURLRequestJob() override; |
70 | 70 |
71 private: | 71 private: |
72 // Called from an internal helper class defined in drive_url_request_job.cc, | 72 // Called from an internal helper class defined in drive_url_request_job.cc, |
73 // which is running on the UI thread. | 73 // which is running on the UI thread. |
74 void OnHelperResultObtained( | 74 void OnHelperResultObtained( |
75 net::Error error, | 75 net::Error error, |
76 const scoped_refptr<storage::FileSystemContext>& file_system_context, | 76 const scoped_refptr<storage::FileSystemContext>& file_system_context, |
77 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope, | 77 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope, |
78 const storage::FileSystemURL& file_system_url, | 78 const storage::FileSystemURL& file_system_url, |
79 const std::string& mime_type); | 79 const std::string& mime_type); |
80 | 80 |
81 // Called from FileSystemBackend::GetRedirectURLForContents. | 81 // Called from FileSystemBackend::GetRedirectURLForContents. |
82 void OnRedirectURLObtained(const GURL& redirect_url); | 82 void OnRedirectURLObtained(const GURL& redirect_url); |
83 | 83 |
84 // Called from DriveURLRequestJob::OnFileInfoObtained. | 84 // Called from DriveURLRequestJob::OnFileInfoObtained. |
85 void OnFileInfoObtained(base::File::Error result, | 85 void OnFileInfoObtained(base::File::Error result, |
86 const base::File::Info& file_info); | 86 const base::File::Info& file_info); |
87 | 87 |
88 // Called when DriveFileStreamReader::Read is completed. | 88 // Called when DriveFileStreamReader::Read is completed. |
89 void OnReadCompleted(int read_result); | 89 void OnReadCompleted(int read_result); |
90 | 90 |
91 void* const profile_id_; | 91 void* const profile_id_; |
92 | 92 |
93 // The range of the file to be returned. | 93 // The range of the file to be returned. |
94 net::Error range_parse_result_; | |
mmenke
2015/10/27 19:41:07
include header
xunjieli
2015/10/27 21:24:06
Done.
| |
94 net::HttpByteRange byte_range_; | 95 net::HttpByteRange byte_range_; |
95 int64 remaining_bytes_; | 96 int64 remaining_bytes_; |
96 | 97 |
97 scoped_refptr<storage::FileSystemContext> file_system_context_; | 98 scoped_refptr<storage::FileSystemContext> file_system_context_; |
98 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope_; | 99 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope_; |
99 storage::FileSystemURL file_system_url_; | 100 storage::FileSystemURL file_system_url_; |
100 std::string mime_type_; | 101 std::string mime_type_; |
101 scoped_ptr<storage::FileStreamReader> stream_reader_; | 102 scoped_ptr<storage::FileStreamReader> stream_reader_; |
102 GURL redirect_url_; | 103 GURL redirect_url_; |
103 | 104 |
104 // This should remain the last member so it'll be destroyed first and | 105 // This should remain the last member so it'll be destroyed first and |
105 // invalidate its weak pointers before other members are destroyed. | 106 // invalidate its weak pointers before other members are destroyed. |
106 base::WeakPtrFactory<ExternalFileURLRequestJob> weak_ptr_factory_; | 107 base::WeakPtrFactory<ExternalFileURLRequestJob> weak_ptr_factory_; |
107 DISALLOW_COPY_AND_ASSIGN(ExternalFileURLRequestJob); | 108 DISALLOW_COPY_AND_ASSIGN(ExternalFileURLRequestJob); |
108 }; | 109 }; |
109 | 110 |
110 } // namespace chromeos | 111 } // namespace chromeos |
111 | 112 |
112 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ | 113 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ |
OLD | NEW |