OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer_host/pepper/pepper_file_io_host.h" | 5 #include "content/browser/renderer_host/pepper/pepper_file_io_host.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/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/files/file_util_proxy.h" | 10 #include "base/files/file_util_proxy.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 base::PlatformFileError result, | 228 base::PlatformFileError result, |
229 base::PlatformFile file, | 229 base::PlatformFile file, |
230 const base::Closure& on_close_callback) { | 230 const base::Closure& on_close_callback) { |
231 if (result == base::PLATFORM_FILE_OK) { | 231 if (result == base::PLATFORM_FILE_OK) { |
232 on_close_callback_ = on_close_callback; | 232 on_close_callback_ = on_close_callback; |
233 | 233 |
234 if (FileOpenForWrite(open_flags_) && file_system_host_->ChecksQuota()) { | 234 if (FileOpenForWrite(open_flags_) && file_system_host_->ChecksQuota()) { |
235 check_quota_ = true; | 235 check_quota_ = true; |
236 file_system_host_->OpenQuotaFile( | 236 file_system_host_->OpenQuotaFile( |
237 this, | 237 this, |
238 file_system_url_.path(), | 238 file_system_url_, |
239 base::Bind(&PepperFileIOHost::DidOpenQuotaFile, | 239 base::Bind(&PepperFileIOHost::DidOpenQuotaFile, |
240 weak_factory_.GetWeakPtr(), | 240 weak_factory_.GetWeakPtr(), |
241 reply_context, | 241 reply_context, |
242 file)); | 242 file)); |
243 return; | 243 return; |
244 } | 244 } |
245 } | 245 } |
246 | 246 |
247 ExecutePlatformOpenFileCallback( | 247 ExecutePlatformOpenFileCallback( |
248 reply_context, result, base::PassPlatformFile(&file), true); | 248 reply_context, result, base::PassPlatformFile(&file), true); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 462 |
463 ppapi::proxy::SerializedHandle file_handle; | 463 ppapi::proxy::SerializedHandle file_handle; |
464 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc. | 464 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc. |
465 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0; | 465 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0; |
466 file_handle.set_file_handle(transit_file, open_flags, quota_file_io); | 466 file_handle.set_file_handle(transit_file, open_flags, quota_file_io); |
467 reply_context->params.AppendHandle(file_handle); | 467 reply_context->params.AppendHandle(file_handle); |
468 return true; | 468 return true; |
469 } | 469 } |
470 | 470 |
471 } // namespace content | 471 } // namespace content |
OLD | NEW |