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_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/files/file.h" |
10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "base/platform_file.h" | |
14 #include "net/http/http_byte_range.h" | 14 #include "net/http/http_byte_range.h" |
15 #include "net/url_request/url_request_job.h" | 15 #include "net/url_request/url_request_job.h" |
16 #include "webkit/browser/fileapi/file_system_url.h" | 16 #include "webkit/browser/fileapi/file_system_url.h" |
17 #include "webkit/browser/webkit_storage_browser_export.h" | 17 #include "webkit/browser/webkit_storage_browser_export.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class FilePath; | 22 class FilePath; |
23 } | 23 } |
(...skipping 30 matching lines...) Expand all Loading... |
54 // FilterContext methods (via URLRequestJob): | 54 // FilterContext methods (via URLRequestJob): |
55 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 55 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
56 | 56 |
57 private: | 57 private: |
58 class CallbackDispatcher; | 58 class CallbackDispatcher; |
59 | 59 |
60 virtual ~FileSystemURLRequestJob(); | 60 virtual ~FileSystemURLRequestJob(); |
61 | 61 |
62 void StartAsync(); | 62 void StartAsync(); |
63 void DidGetMetadata( | 63 void DidGetMetadata( |
64 base::PlatformFileError error_code, | 64 base::File::Error error_code, |
65 const base::PlatformFileInfo& file_info); | 65 const base::File::Info& file_info); |
66 void DidRead(int result); | 66 void DidRead(int result); |
67 void NotifyFailed(int rv); | 67 void NotifyFailed(int rv); |
68 | 68 |
69 FileSystemContext* file_system_context_; | 69 FileSystemContext* file_system_context_; |
70 scoped_ptr<webkit_blob::FileStreamReader> reader_; | 70 scoped_ptr<webkit_blob::FileStreamReader> reader_; |
71 FileSystemURL url_; | 71 FileSystemURL url_; |
72 bool is_directory_; | 72 bool is_directory_; |
73 scoped_ptr<net::HttpResponseInfo> response_info_; | 73 scoped_ptr<net::HttpResponseInfo> response_info_; |
74 int64 remaining_bytes_; | 74 int64 remaining_bytes_; |
75 net::HttpByteRange byte_range_; | 75 net::HttpByteRange byte_range_; |
76 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_; | 76 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); | 78 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace fileapi | 81 } // namespace fileapi |
82 | 82 |
83 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ | 83 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ |
OLD | NEW |