Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: webkit/browser/fileapi/file_system_dir_url_request_job.h

Issue 195923002: Add mechanism to auto mount file systems in response to a URL request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CrOS Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_DIR_URL_REQUEST_JOB_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ 6 #define WEBKIT_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 10 matching lines...) Expand all
21 class FileSystemContext; 21 class FileSystemContext;
22 struct DirectoryEntry; 22 struct DirectoryEntry;
23 23
24 // A request job that handles reading filesystem: URLs for directories. 24 // A request job that handles reading filesystem: URLs for directories.
25 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemDirURLRequestJob 25 class WEBKIT_STORAGE_BROWSER_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 FileSystemContext* file_system_context); 32 FileSystemContext* file_system_context);
32 33
33 // URLRequestJob methods: 34 // URLRequestJob methods:
34 virtual void Start() OVERRIDE; 35 virtual void Start() OVERRIDE;
35 virtual void Kill() OVERRIDE; 36 virtual void Kill() OVERRIDE;
36 virtual bool ReadRawData(net::IOBuffer* buf, 37 virtual bool ReadRawData(net::IOBuffer* buf,
37 int buf_size, 38 int buf_size,
38 int* bytes_read) OVERRIDE; 39 int* bytes_read) OVERRIDE;
39 virtual bool GetCharset(std::string* charset) OVERRIDE; 40 virtual bool GetCharset(std::string* charset) OVERRIDE;
40 41
41 // FilterContext methods (via URLRequestJob): 42 // FilterContext methods (via URLRequestJob):
42 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; 43 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
43 // TODO(adamk): Implement GetResponseInfo and GetResponseCode to simulate 44 // TODO(adamk): Implement GetResponseInfo and GetResponseCode to simulate
44 // an HTTP response. 45 // an HTTP response.
45 46
46 private: 47 private:
47 class CallbackDispatcher; 48 class CallbackDispatcher;
48 49
49 virtual ~FileSystemDirURLRequestJob(); 50 virtual ~FileSystemDirURLRequestJob();
50 51
51 void StartAsync(); 52 void StartAsync();
53 void DidAttemptAutoMount(base::File::Error result);
52 void DidReadDirectory(base::File::Error result, 54 void DidReadDirectory(base::File::Error result,
53 const std::vector<DirectoryEntry>& entries, 55 const std::vector<DirectoryEntry>& entries,
54 bool has_more); 56 bool has_more);
55 57
56 std::string data_; 58 std::string data_;
57 FileSystemURL url_; 59 FileSystemURL url_;
60 const std::string storage_domain_;
58 FileSystemContext* file_system_context_; 61 FileSystemContext* file_system_context_;
59 base::WeakPtrFactory<FileSystemDirURLRequestJob> weak_factory_; 62 base::WeakPtrFactory<FileSystemDirURLRequestJob> weak_factory_;
60 63
61 DISALLOW_COPY_AND_ASSIGN(FileSystemDirURLRequestJob); 64 DISALLOW_COPY_AND_ASSIGN(FileSystemDirURLRequestJob);
62 }; 65 };
63 66
64 } // namespace fileapi 67 } // namespace fileapi
65 68
66 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ 69 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/file_system_context.cc ('k') | webkit/browser/fileapi/file_system_dir_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698