| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 ppapi::host::ReplyMessageContext reply_context) { | 90 ppapi::host::ReplyMessageContext reply_context) { |
| 91 host_->SendReply( | 91 host_->SendReply( |
| 92 reply_context, | 92 reply_context, |
| 93 PpapiPluginMsg_FileRef_GetAbsolutePathReply(path_.AsUTF8Unsafe())); | 93 PpapiPluginMsg_FileRef_GetAbsolutePathReply(path_.AsUTF8Unsafe())); |
| 94 | 94 |
| 95 // Use PP_OK_COMPLETIONPENDING instead of PP_OK since we've already sent our | 95 // Use PP_OK_COMPLETIONPENDING instead of PP_OK since we've already sent our |
| 96 // reply above. | 96 // reply above. |
| 97 return PP_OK_COMPLETIONPENDING; | 97 return PP_OK_COMPLETIONPENDING; |
| 98 } | 98 } |
| 99 | 99 |
| 100 fileapi::FileSystemURL PepperExternalFileRefBackend::GetFileSystemURL() const { | 100 storage::FileSystemURL PepperExternalFileRefBackend::GetFileSystemURL() const { |
| 101 return fileapi::FileSystemURL(); | 101 return storage::FileSystemURL(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 base::FilePath PepperExternalFileRefBackend::GetExternalFilePath() const { | 104 base::FilePath PepperExternalFileRefBackend::GetExternalFilePath() const { |
| 105 return path_; | 105 return path_; |
| 106 } | 106 } |
| 107 | 107 |
| 108 int32_t PepperExternalFileRefBackend::CanRead() const { | 108 int32_t PepperExternalFileRefBackend::CanRead() const { |
| 109 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 109 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
| 110 render_process_id_, path_)) { | 110 render_process_id_, path_)) { |
| 111 return PP_ERROR_NOACCESS; | 111 return PP_ERROR_NOACCESS; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 file_info, PP_FILESYSTEMTYPE_EXTERNAL, &pp_file_info); | 151 file_info, PP_FILESYSTEMTYPE_EXTERNAL, &pp_file_info); |
| 152 } else { | 152 } else { |
| 153 memset(&pp_file_info, 0, sizeof(pp_file_info)); | 153 memset(&pp_file_info, 0, sizeof(pp_file_info)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 host_->SendReply(reply_context, | 156 host_->SendReply(reply_context, |
| 157 PpapiPluginMsg_FileRef_QueryReply(pp_file_info)); | 157 PpapiPluginMsg_FileRef_QueryReply(pp_file_info)); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace content | 160 } // namespace content |
| OLD | NEW |