| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // A request job that handles reading filesystem: URLs | 29 // A request job that handles reading filesystem: URLs |
| 30 class FileSystemURLRequestJob : public net::URLRequestJob { | 30 class FileSystemURLRequestJob : public net::URLRequestJob { |
| 31 public: | 31 public: |
| 32 FileSystemURLRequestJob( | 32 FileSystemURLRequestJob( |
| 33 net::URLRequest* request, | 33 net::URLRequest* request, |
| 34 FileSystemContext* file_system_context, | 34 FileSystemContext* file_system_context, |
| 35 scoped_refptr<base::MessageLoopProxy> file_thread_proxy); | 35 scoped_refptr<base::MessageLoopProxy> file_thread_proxy); |
| 36 | 36 |
| 37 // URLRequestJob methods: | 37 // URLRequestJob methods: |
| 38 virtual void Start(); | 38 virtual void Start() OVERRIDE; |
| 39 virtual void Kill(); | 39 virtual void Kill() OVERRIDE; |
| 40 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read); | 40 virtual bool ReadRawData(net::IOBuffer* buf, |
| 41 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); | 41 int buf_size, |
| 42 virtual void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers); | 42 int* bytes_read) OVERRIDE; |
| 43 virtual void GetResponseInfo(net::HttpResponseInfo* info); | 43 virtual bool IsRedirectResponse(GURL* location, |
| 44 virtual int GetResponseCode() const; | 44 int* http_status_code) OVERRIDE; |
| 45 virtual void SetExtraRequestHeaders( |
| 46 const net::HttpRequestHeaders& headers) OVERRIDE; |
| 47 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; |
| 48 virtual int GetResponseCode() const OVERRIDE; |
| 45 | 49 |
| 46 // FilterContext methods (via URLRequestJob): | 50 // FilterContext methods (via URLRequestJob): |
| 47 virtual bool GetMimeType(std::string* mime_type) const; | 51 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 class CallbackDispatcher; | 54 class CallbackDispatcher; |
| 51 | 55 |
| 52 virtual ~FileSystemURLRequestJob(); | 56 virtual ~FileSystemURLRequestJob(); |
| 53 | 57 |
| 54 void StartAsync(); | 58 void StartAsync(); |
| 55 void DidGetMetadata(const base::PlatformFileInfo& file_info, | 59 void DidGetMetadata(const base::PlatformFileInfo& file_info, |
| 56 const FilePath& platform_path); | 60 const FilePath& platform_path); |
| 57 void DidOpen(base::PlatformFileError error_code, | 61 void DidOpen(base::PlatformFileError error_code, |
| 58 base::PassPlatformFile file, bool created); | 62 base::PassPlatformFile file, bool created); |
| 59 void DidRead(int result); | 63 void DidRead(int result); |
| 60 void NotifyFailed(int rv); | 64 void NotifyFailed(int rv); |
| 61 | 65 |
| 62 FileSystemContext* file_system_context_; | 66 FileSystemContext* file_system_context_; |
| 63 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; | 67 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; |
| 64 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_; | 68 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_; |
| 65 scoped_ptr<net::FileStream> stream_; | 69 scoped_ptr<net::FileStream> stream_; |
| 66 bool is_directory_; | 70 bool is_directory_; |
| 67 scoped_ptr<net::HttpResponseInfo> response_info_; | 71 scoped_ptr<net::HttpResponseInfo> response_info_; |
| 68 int64 remaining_bytes_; | 72 int64 remaining_bytes_; |
| 69 net::HttpByteRange byte_range_; | 73 net::HttpByteRange byte_range_; |
| 70 | 74 |
| 71 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); | 75 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 } // namespace fileapi | 78 } // namespace fileapi |
| 75 | 79 |
| 76 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ | 80 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ |
| OLD | NEW |