| 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 #include "content/browser/loader/redirect_to_file_resource_handler.h" | 5 #include "content/browser/loader/redirect_to_file_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util_proxy.h" | 8 #include "base/files/file_util_proxy.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 completed_status_ = status; | 156 completed_status_ = status; |
| 157 completed_security_info_ = security_info; | 157 completed_security_info_ = security_info; |
| 158 did_defer_ = true; | 158 did_defer_ = true; |
| 159 *defer = true; | 159 *defer = true; |
| 160 return; | 160 return; |
| 161 } | 161 } |
| 162 next_handler_->OnResponseCompleted(request_id, status, security_info, defer); | 162 next_handler_->OnResponseCompleted(request_id, status, security_info, defer); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void RedirectToFileResourceHandler::DidCreateTemporaryFile( | 165 void RedirectToFileResourceHandler::DidCreateTemporaryFile( |
| 166 base::PlatformFileError /*error_code*/, | 166 base::File::Error /*error_code*/, |
| 167 base::PassPlatformFile file_handle, | 167 base::PassPlatformFile file_handle, |
| 168 const base::FilePath& file_path) { | 168 const base::FilePath& file_path) { |
| 169 deletable_file_ = ShareableFileReference::GetOrCreate( | 169 deletable_file_ = ShareableFileReference::GetOrCreate( |
| 170 file_path, | 170 file_path, |
| 171 ShareableFileReference::DELETE_ON_FINAL_RELEASE, | 171 ShareableFileReference::DELETE_ON_FINAL_RELEASE, |
| 172 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get()); | 172 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get()); |
| 173 file_stream_.reset( | 173 file_stream_.reset( |
| 174 new net::FileStream(file_handle.ReleaseValue(), | 174 new net::FileStream(file_handle.ReleaseValue(), |
| 175 base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_ASYNC, | 175 base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_ASYNC, |
| 176 NULL)); | 176 NULL)); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 } | 267 } |
| 268 | 268 |
| 269 void RedirectToFileResourceHandler::ResumeIfDeferred() { | 269 void RedirectToFileResourceHandler::ResumeIfDeferred() { |
| 270 if (did_defer_) { | 270 if (did_defer_) { |
| 271 did_defer_ = false; | 271 did_defer_ = false; |
| 272 controller()->Resume(); | 272 controller()->Resume(); |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace content | 276 } // namespace content |
| OLD | NEW |