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 STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ |
6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class STORAGE_EXPORT_PRIVATE FileSystemDirURLRequestJob | 25 class STORAGE_EXPORT_PRIVATE FileSystemDirURLRequestJob |
26 : public net::URLRequestJob { | 26 : public net::URLRequestJob { |
27 public: | 27 public: |
28 FileSystemDirURLRequestJob( | 28 FileSystemDirURLRequestJob( |
29 net::URLRequest* request, | 29 net::URLRequest* request, |
30 net::NetworkDelegate* network_delegate, | 30 net::NetworkDelegate* network_delegate, |
31 const std::string& storage_domain, | 31 const std::string& storage_domain, |
32 FileSystemContext* file_system_context); | 32 FileSystemContext* file_system_context); |
33 | 33 |
34 // URLRequestJob methods: | 34 // URLRequestJob methods: |
35 virtual void Start() override; | 35 void Start() override; |
36 virtual void Kill() override; | 36 void Kill() override; |
37 virtual bool ReadRawData(net::IOBuffer* buf, | 37 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; |
38 int buf_size, | 38 bool GetCharset(std::string* charset) override; |
39 int* bytes_read) override; | |
40 virtual bool GetCharset(std::string* charset) override; | |
41 | 39 |
42 // FilterContext methods (via URLRequestJob): | 40 // FilterContext methods (via URLRequestJob): |
43 virtual bool GetMimeType(std::string* mime_type) const override; | 41 bool GetMimeType(std::string* mime_type) const override; |
44 // TODO(adamk): Implement GetResponseInfo and GetResponseCode to simulate | 42 // TODO(adamk): Implement GetResponseInfo and GetResponseCode to simulate |
45 // an HTTP response. | 43 // an HTTP response. |
46 | 44 |
47 private: | 45 private: |
48 class CallbackDispatcher; | 46 class CallbackDispatcher; |
49 | 47 |
50 virtual ~FileSystemDirURLRequestJob(); | 48 ~FileSystemDirURLRequestJob() override; |
51 | 49 |
52 void StartAsync(); | 50 void StartAsync(); |
53 void DidAttemptAutoMount(base::File::Error result); | 51 void DidAttemptAutoMount(base::File::Error result); |
54 void DidReadDirectory(base::File::Error result, | 52 void DidReadDirectory(base::File::Error result, |
55 const std::vector<DirectoryEntry>& entries, | 53 const std::vector<DirectoryEntry>& entries, |
56 bool has_more); | 54 bool has_more); |
57 | 55 |
58 std::string data_; | 56 std::string data_; |
59 FileSystemURL url_; | 57 FileSystemURL url_; |
60 const std::string storage_domain_; | 58 const std::string storage_domain_; |
61 FileSystemContext* file_system_context_; | 59 FileSystemContext* file_system_context_; |
62 base::WeakPtrFactory<FileSystemDirURLRequestJob> weak_factory_; | 60 base::WeakPtrFactory<FileSystemDirURLRequestJob> weak_factory_; |
63 | 61 |
64 DISALLOW_COPY_AND_ASSIGN(FileSystemDirURLRequestJob); | 62 DISALLOW_COPY_AND_ASSIGN(FileSystemDirURLRequestJob); |
65 }; | 63 }; |
66 | 64 |
67 } // namespace storage | 65 } // namespace storage |
68 | 66 |
69 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ | 67 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ |
OLD | NEW |