| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_BASE_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_BASE_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/file_path.h" |
| 10 #include "base/message_loop_proxy.h" |
| 11 #include "net/url_request/url_request_job.h" |
| 12 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 13 #include "webkit/fileapi/file_system_context.h" |
| 14 #include "webkit/fileapi/file_system_operation.h" |
| 15 |
| 16 namespace fileapi { |
| 17 |
| 18 // A base class for request jobs that handle reading filesystem: URLs for |
| 19 // files and directories. |
| 20 class FileSystemURLRequestJobBase : public net::URLRequestJob { |
| 21 public: |
| 22 FileSystemURLRequestJobBase( |
| 23 net::URLRequest* request, FileSystemContext* file_system_context, |
| 24 scoped_refptr<base::MessageLoopProxy> file_thread_proxy); |
| 25 |
| 26 void StartAsync(); |
| 27 |
| 28 protected: |
| 29 virtual void DidGetLocalPath(const FilePath& local_path) = 0 ; |
| 30 |
| 31 void NotifyFailed(int rv); |
| 32 void RespondFailedOnIOThread(int error_code); |
| 33 FileSystemOperation* GetNewOperation(); |
| 34 |
| 35 FilePath relative_file_path_; |
| 36 FilePath absolute_file_path_; |
| 37 scoped_refptr<FileSystemContext> file_system_context_; |
| 38 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; |
| 39 |
| 40 private: |
| 41 friend class LocalPathCallbackDispatcher; |
| 42 void OnGetLocalPath(const FilePath& local_path); |
| 43 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJobBase); |
| 44 }; |
| 45 |
| 46 } // namespace fileapi |
| 47 |
| 48 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_BASE_H_ |
| OLD | NEW |