| 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_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 16 #include "net/http/http_byte_range.h" | 16 #include "net/http/http_byte_range.h" |
| 17 #include "net/url_request/url_request_job.h" | 17 #include "net/url_request/url_request_job.h" |
| 18 | 18 |
| 19 class GURL; | 19 class GURL; |
| 20 class FilePath; | 20 class FilePath; |
| 21 | 21 |
| 22 namespace webkit_blob { |
| 23 class FileReader; |
| 24 } |
| 25 |
| 22 namespace fileapi { | 26 namespace fileapi { |
| 23 class FileSystemContext; | 27 class FileSystemContext; |
| 24 class FileSystemFileReader; | |
| 25 | 28 |
| 26 // A request job that handles reading filesystem: URLs | 29 // A request job that handles reading filesystem: URLs |
| 27 class FileSystemURLRequestJob : public net::URLRequestJob { | 30 class FileSystemURLRequestJob : public net::URLRequestJob { |
| 28 public: | 31 public: |
| 29 FileSystemURLRequestJob( | 32 FileSystemURLRequestJob( |
| 30 net::URLRequest* request, | 33 net::URLRequest* request, |
| 31 FileSystemContext* file_system_context, | 34 FileSystemContext* file_system_context, |
| 32 scoped_refptr<base::MessageLoopProxy> file_thread_proxy); | 35 scoped_refptr<base::MessageLoopProxy> file_thread_proxy); |
| 33 | 36 |
| 34 // URLRequestJob methods: | 37 // URLRequestJob methods: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 56 void DidGetMetadata( | 59 void DidGetMetadata( |
| 57 base::PlatformFileError error_code, | 60 base::PlatformFileError error_code, |
| 58 const base::PlatformFileInfo& file_info, | 61 const base::PlatformFileInfo& file_info, |
| 59 const FilePath& platform_path); | 62 const FilePath& platform_path); |
| 60 void DidRead(int result); | 63 void DidRead(int result); |
| 61 void NotifyFailed(int rv); | 64 void NotifyFailed(int rv); |
| 62 | 65 |
| 63 FileSystemContext* file_system_context_; | 66 FileSystemContext* file_system_context_; |
| 64 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; | 67 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; |
| 65 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_; | 68 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_; |
| 66 scoped_ptr<FileSystemFileReader> reader_; | 69 scoped_ptr<webkit_blob::FileReader> reader_; |
| 67 bool is_directory_; | 70 bool is_directory_; |
| 68 scoped_ptr<net::HttpResponseInfo> response_info_; | 71 scoped_ptr<net::HttpResponseInfo> response_info_; |
| 69 int64 remaining_bytes_; | 72 int64 remaining_bytes_; |
| 70 net::HttpByteRange byte_range_; | 73 net::HttpByteRange byte_range_; |
| 71 | 74 |
| 72 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); | 75 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace fileapi | 78 } // namespace fileapi |
| 76 | 79 |
| 77 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ | 80 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ |
| OLD | NEW |