| 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_external_file_ref_backend.
h" | 5 #include "content/browser/renderer_host/pepper/pepper_external_file_ref_backend.
h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util_proxy.h" | 8 #include "base/files/file_util_proxy.h" |
| 9 #include "content/browser/child_process_security_policy_impl.h" | 9 #include "content/browser/child_process_security_policy_impl.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 if (!ChildProcessSecurityPolicyImpl::GetInstance()-> | 126 if (!ChildProcessSecurityPolicyImpl::GetInstance()-> |
| 127 CanCreateReadWriteFile(render_process_id_, path_)) { | 127 CanCreateReadWriteFile(render_process_id_, path_)) { |
| 128 return PP_ERROR_NOACCESS; | 128 return PP_ERROR_NOACCESS; |
| 129 } | 129 } |
| 130 return PP_OK; | 130 return PP_OK; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void PepperExternalFileRefBackend::DidFinish( | 133 void PepperExternalFileRefBackend::DidFinish( |
| 134 ppapi::host::ReplyMessageContext reply_context, | 134 ppapi::host::ReplyMessageContext reply_context, |
| 135 const IPC::Message& msg, | 135 const IPC::Message& msg, |
| 136 base::PlatformFileError error) { | 136 base::File::Error error) { |
| 137 reply_context.params.set_result(ppapi::PlatformFileErrorToPepperError(error)); | 137 reply_context.params.set_result(ppapi::FileErrorToPepperError(error)); |
| 138 host_->SendReply(reply_context, msg); | 138 host_->SendReply(reply_context, msg); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void PepperExternalFileRefBackend::GetMetadataComplete( | 141 void PepperExternalFileRefBackend::GetMetadataComplete( |
| 142 ppapi::host::ReplyMessageContext reply_context, | 142 ppapi::host::ReplyMessageContext reply_context, |
| 143 const base::PlatformFileError error, | 143 const base::File::Error error, |
| 144 const base::PlatformFileInfo& file_info) { | 144 const base::File::Info& file_info) { |
| 145 reply_context.params.set_result(ppapi::PlatformFileErrorToPepperError(error)); | 145 reply_context.params.set_result(ppapi::FileErrorToPepperError(error)); |
| 146 | 146 |
| 147 PP_FileInfo pp_file_info; | 147 PP_FileInfo pp_file_info; |
| 148 if (error == base::PLATFORM_FILE_OK) { | 148 if (error == base::File::FILE_OK) { |
| 149 ppapi::PlatformFileInfoToPepperFileInfo( | 149 ppapi::FileInfoToPepperFileInfo(file_info, PP_FILESYSTEMTYPE_EXTERNAL, |
| 150 file_info, PP_FILESYSTEMTYPE_EXTERNAL, &pp_file_info); | 150 &pp_file_info); |
| 151 } else { | 151 } else { |
| 152 memset(&pp_file_info, 0, sizeof(pp_file_info)); | 152 memset(&pp_file_info, 0, sizeof(pp_file_info)); |
| 153 } | 153 } |
| 154 | 154 |
| 155 host_->SendReply(reply_context, | 155 host_->SendReply(reply_context, |
| 156 PpapiPluginMsg_FileRef_QueryReply(pp_file_info)); | 156 PpapiPluginMsg_FileRef_QueryReply(pp_file_info)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace content | 159 } // namespace content |
| OLD | NEW |