| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 weak_factory_.GetWeakPtr(), | 398 weak_factory_.GetWeakPtr(), |
| 399 context->MakeReplyMessageContext()))) | 399 context->MakeReplyMessageContext()))) |
| 400 return PP_ERROR_FAILED; | 400 return PP_ERROR_FAILED; |
| 401 | 401 |
| 402 state_manager_.SetPendingOperation(FileIOStateManager::OPERATION_EXCLUSIVE); | 402 state_manager_.SetPendingOperation(FileIOStateManager::OPERATION_EXCLUSIVE); |
| 403 return PP_OK_COMPLETIONPENDING; | 403 return PP_OK_COMPLETIONPENDING; |
| 404 } | 404 } |
| 405 | 405 |
| 406 int32_t PepperFileIOHost::OnHostMsgClose( | 406 int32_t PepperFileIOHost::OnHostMsgClose( |
| 407 ppapi::host::HostMessageContext* context) { | 407 ppapi::host::HostMessageContext* context) { |
| 408 if (check_quota_) | 408 if (check_quota_) { |
| 409 file_system_host_->CloseQuotaFile(this); | 409 file_system_host_->CloseQuotaFile(this); |
| 410 check_quota_ = false; |
| 411 } |
| 410 | 412 |
| 411 if (file_ != base::kInvalidPlatformFileValue) { | 413 if (file_ != base::kInvalidPlatformFileValue) { |
| 412 base::FileUtilProxy::Close( | 414 base::FileUtilProxy::Close( |
| 413 file_message_loop_, | 415 file_message_loop_, |
| 414 file_, | 416 file_, |
| 415 base::Bind(&PepperFileIOHost::DidCloseFile, | 417 base::Bind(&PepperFileIOHost::DidCloseFile, |
| 416 weak_factory_.GetWeakPtr())); | 418 weak_factory_.GetWeakPtr())); |
| 417 file_ = base::kInvalidPlatformFileValue; | 419 file_ = base::kInvalidPlatformFileValue; |
| 418 } | 420 } |
| 419 return PP_OK; | 421 return PP_OK; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 file_, plugin_process_id, false); | 602 file_, plugin_process_id, false); |
| 601 if (transit_file == IPC::InvalidPlatformFileForTransit()) | 603 if (transit_file == IPC::InvalidPlatformFileForTransit()) |
| 602 return false; | 604 return false; |
| 603 ppapi::proxy::SerializedHandle file_handle; | 605 ppapi::proxy::SerializedHandle file_handle; |
| 604 file_handle.set_file_handle(transit_file, open_flags); | 606 file_handle.set_file_handle(transit_file, open_flags); |
| 605 reply_context->params.AppendHandle(file_handle); | 607 reply_context->params.AppendHandle(file_handle); |
| 606 return true; | 608 return true; |
| 607 } | 609 } |
| 608 | 610 |
| 609 } // namespace content | 611 } // namespace content |
| OLD | NEW |