| 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 NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 URLRequestFileJob(URLRequest* request, const FilePath& file_path); | 29 URLRequestFileJob(URLRequest* request, const FilePath& file_path); |
| 30 | 30 |
| 31 static URLRequest::ProtocolFactory Factory; | 31 static URLRequest::ProtocolFactory Factory; |
| 32 | 32 |
| 33 #if defined(OS_CHROMEOS) | 33 #if defined(OS_CHROMEOS) |
| 34 static bool AccessDisabled(const FilePath& file_path); | 34 static bool AccessDisabled(const FilePath& file_path); |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 // URLRequestJob: | 37 // URLRequestJob: |
| 38 virtual void Start(); | 38 virtual void Start() OVERRIDE; |
| 39 virtual void Kill(); | 39 virtual void Kill() OVERRIDE; |
| 40 virtual bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read); | 40 virtual bool ReadRawData(IOBuffer* buf, |
| 41 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); | 41 int buf_size, |
| 42 virtual Filter* SetupFilter() const; | 42 int* bytes_read) OVERRIDE; |
| 43 virtual bool GetMimeType(std::string* mime_type) const; | 43 virtual bool IsRedirectResponse(GURL* location, |
| 44 virtual void SetExtraRequestHeaders(const HttpRequestHeaders& headers); | 44 int* http_status_code) OVERRIDE; |
| 45 virtual Filter* SetupFilter() const OVERRIDE; |
| 46 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
| 47 virtual void SetExtraRequestHeaders( |
| 48 const HttpRequestHeaders& headers) OVERRIDE; |
| 45 | 49 |
| 46 protected: | 50 protected: |
| 47 virtual ~URLRequestFileJob(); | 51 virtual ~URLRequestFileJob(); |
| 48 | 52 |
| 49 // The OS-specific full path name of the file | 53 // The OS-specific full path name of the file |
| 50 FilePath file_path_; | 54 FilePath file_path_; |
| 51 | 55 |
| 52 private: | 56 private: |
| 53 // Callback after fetching file info on a background thread. | 57 // Callback after fetching file info on a background thread. |
| 54 void DidResolve(bool exists, const base::PlatformFileInfo& file_info); | 58 void DidResolve(bool exists, const base::PlatformFileInfo& file_info); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 69 scoped_refptr<AsyncResolver> async_resolver_; | 73 scoped_refptr<AsyncResolver> async_resolver_; |
| 70 | 74 |
| 71 ScopedRunnableMethodFactory<URLRequestFileJob> method_factory_; | 75 ScopedRunnableMethodFactory<URLRequestFileJob> method_factory_; |
| 72 | 76 |
| 73 DISALLOW_COPY_AND_ASSIGN(URLRequestFileJob); | 77 DISALLOW_COPY_AND_ASSIGN(URLRequestFileJob); |
| 74 }; | 78 }; |
| 75 | 79 |
| 76 } // namespace net | 80 } // namespace net |
| 77 | 81 |
| 78 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ | 82 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ |
| OLD | NEW |