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_ref_host.h" | 5 #include "content/browser/renderer_host/pepper/pepper_file_ref_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "content/browser/renderer_host/pepper/pepper_external_file_ref_backend.
h" | 9 #include "content/browser/renderer_host/pepper/pepper_external_file_ref_backend.
h" |
10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" | 10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 OnReadDirectoryEntries); | 173 OnReadDirectoryEntries); |
174 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FileRef_GetAbsolutePath, | 174 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FileRef_GetAbsolutePath, |
175 OnGetAbsolutePath); | 175 OnGetAbsolutePath); |
176 | 176 |
177 IPC_END_MESSAGE_MAP() | 177 IPC_END_MESSAGE_MAP() |
178 return PP_ERROR_FAILED; | 178 return PP_ERROR_FAILED; |
179 } | 179 } |
180 | 180 |
181 int32_t PepperFileRefHost::OnMakeDirectory( | 181 int32_t PepperFileRefHost::OnMakeDirectory( |
182 ppapi::host::HostMessageContext* context, | 182 ppapi::host::HostMessageContext* context, |
183 bool make_ancestors) { | 183 int32_t make_directory_flags) { |
184 int32_t rv = CanCreate(); | 184 int32_t rv = CanCreate(); |
185 if (rv != PP_OK) | 185 if (rv != PP_OK) |
186 return rv; | 186 return rv; |
187 return backend_->MakeDirectory(context->MakeReplyMessageContext(), | 187 return backend_->MakeDirectory( |
188 make_ancestors); | 188 context->MakeReplyMessageContext(), make_directory_flags); |
189 } | 189 } |
190 | 190 |
191 int32_t PepperFileRefHost::OnTouch(ppapi::host::HostMessageContext* context, | 191 int32_t PepperFileRefHost::OnTouch(ppapi::host::HostMessageContext* context, |
192 PP_Time last_access_time, | 192 PP_Time last_access_time, |
193 PP_Time last_modified_time) { | 193 PP_Time last_modified_time) { |
194 // TODO(teravest): Change this to be kWriteFilePermissions here and in | 194 // TODO(teravest): Change this to be kWriteFilePermissions here and in |
195 // fileapi_message_filter. | 195 // fileapi_message_filter. |
196 int32_t rv = CanCreate(); | 196 int32_t rv = CanCreate(); |
197 if (rv != PP_OK) | 197 if (rv != PP_OK) |
198 return rv; | 198 return rv; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 int32_t PepperFileRefHost::OnGetAbsolutePath( | 251 int32_t PepperFileRefHost::OnGetAbsolutePath( |
252 ppapi::host::HostMessageContext* context) { | 252 ppapi::host::HostMessageContext* context) { |
253 if (!host_->GetPpapiHost()->permissions().HasPermission( | 253 if (!host_->GetPpapiHost()->permissions().HasPermission( |
254 ppapi::PERMISSION_PRIVATE)) | 254 ppapi::PERMISSION_PRIVATE)) |
255 return PP_ERROR_NOACCESS; | 255 return PP_ERROR_NOACCESS; |
256 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); | 256 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); |
257 } | 257 } |
258 | 258 |
259 } // namespace content | 259 } // namespace content |
OLD | NEW |