| 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 "webkit/fileapi/file_writer_delegate.h" | 5 #include "webkit/fileapi/file_writer_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_util_proxy.h" | 9 #include "base/file_util_proxy.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 void FileWriterDelegate::OnCertificateRequested( | 152 void FileWriterDelegate::OnCertificateRequested( |
| 153 net::URLRequest* request, | 153 net::URLRequest* request, |
| 154 net::SSLCertRequestInfo* cert_request_info) { | 154 net::SSLCertRequestInfo* cert_request_info) { |
| 155 NOTREACHED(); | 155 NOTREACHED(); |
| 156 OnError(base::PLATFORM_FILE_ERROR_SECURITY); | 156 OnError(base::PLATFORM_FILE_ERROR_SECURITY); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void FileWriterDelegate::OnSSLCertificateError(net::URLRequest* request, | 159 void FileWriterDelegate::OnSSLCertificateError(net::URLRequest* request, |
| 160 const net::SSLInfo& ssl_info, | 160 const net::SSLInfo& ssl_info, |
| 161 bool is_hsts_host) { | 161 bool fatal) { |
| 162 NOTREACHED(); | 162 NOTREACHED(); |
| 163 OnError(base::PLATFORM_FILE_ERROR_SECURITY); | 163 OnError(base::PLATFORM_FILE_ERROR_SECURITY); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void FileWriterDelegate::OnResponseStarted(net::URLRequest* request) { | 166 void FileWriterDelegate::OnResponseStarted(net::URLRequest* request) { |
| 167 DCHECK_EQ(request_, request); | 167 DCHECK_EQ(request_, request); |
| 168 // file_stream_->Seek() blocks the IO thread. | 168 // file_stream_->Seek() blocks the IO thread. |
| 169 // See http://crbug.com/75548. | 169 // See http://crbug.com/75548. |
| 170 base::ThreadRestrictions::ScopedAllowIO allow_io; | 170 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 171 if (!request->status().is_success() || request->GetResponseCode() != 200) { | 171 if (!request->status().is_success() || request->GetResponseCode() != 200) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const { | 318 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const { |
| 319 DCHECK(file_system_operation_); | 319 DCHECK(file_system_operation_); |
| 320 DCHECK(file_system_operation_->file_system_context()); | 320 DCHECK(file_system_operation_->file_system_context()); |
| 321 DCHECK(file_system_operation_->file_system_operation_context()); | 321 DCHECK(file_system_operation_->file_system_operation_context()); |
| 322 return file_system_operation_->file_system_context()->GetQuotaUtil( | 322 return file_system_operation_->file_system_context()->GetQuotaUtil( |
| 323 file_system_operation_context()->src_type()); | 323 file_system_operation_context()->src_type()); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace fileapi | 326 } // namespace fileapi |
| OLD | NEW |