| 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 CONTENT_BROWSER_LOADER_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/files/file.h" |
| 8 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
| 13 #include "content/browser/loader/layered_resource_handler.h" | 14 #include "content/browser/loader/layered_resource_handler.h" |
| 14 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
| 15 #include "net/url_request/url_request_status.h" | 16 #include "net/url_request/url_request_status.h" |
| 16 | 17 |
| 17 namespace net { | 18 namespace net { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 int min_size) OVERRIDE; | 50 int min_size) OVERRIDE; |
| 50 virtual bool OnReadCompleted(int request_id, | 51 virtual bool OnReadCompleted(int request_id, |
| 51 int bytes_read, | 52 int bytes_read, |
| 52 bool* defer) OVERRIDE; | 53 bool* defer) OVERRIDE; |
| 53 virtual void OnResponseCompleted(int request_id, | 54 virtual void OnResponseCompleted(int request_id, |
| 54 const net::URLRequestStatus& status, | 55 const net::URLRequestStatus& status, |
| 55 const std::string& security_info, | 56 const std::string& security_info, |
| 56 bool* defer) OVERRIDE; | 57 bool* defer) OVERRIDE; |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 void DidCreateTemporaryFile(base::PlatformFileError error_code, | 60 void DidCreateTemporaryFile(base::File::Error error_code, |
| 60 base::PassPlatformFile file_handle, | 61 base::PassPlatformFile file_handle, |
| 61 const base::FilePath& file_path); | 62 const base::FilePath& file_path); |
| 62 void DidWriteToFile(int result); | 63 void DidWriteToFile(int result); |
| 63 bool WriteMore(); | 64 bool WriteMore(); |
| 64 bool BufIsFull() const; | 65 bool BufIsFull() const; |
| 65 void ResumeIfDeferred(); | 66 void ResumeIfDeferred(); |
| 66 | 67 |
| 67 base::WeakPtrFactory<RedirectToFileResourceHandler> weak_factory_; | 68 base::WeakPtrFactory<RedirectToFileResourceHandler> weak_factory_; |
| 68 | 69 |
| 69 ResourceDispatcherHostImpl* host_; | 70 ResourceDispatcherHostImpl* host_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 98 bool completed_during_write_; | 99 bool completed_during_write_; |
| 99 net::URLRequestStatus completed_status_; | 100 net::URLRequestStatus completed_status_; |
| 100 std::string completed_security_info_; | 101 std::string completed_security_info_; |
| 101 | 102 |
| 102 DISALLOW_COPY_AND_ASSIGN(RedirectToFileResourceHandler); | 103 DISALLOW_COPY_AND_ASSIGN(RedirectToFileResourceHandler); |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 } // namespace content | 106 } // namespace content |
| 106 | 107 |
| 107 #endif // CONTENT_BROWSER_LOADER_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_ | 108 #endif // CONTENT_BROWSER_LOADER_REDIRECT_TO_FILE_RESOURCE_HANDLER_H_ |
| OLD | NEW |