OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/proxy/ppb_file_ref_proxy.h" | 5 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_file_ref_dev.h" | 7 #include "ppapi/c/dev/ppb_file_ref_dev.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/c/private/ppb_proxy_private.h" | 9 #include "ppapi/c/private/ppb_proxy_private.h" |
10 #include "ppapi/proxy/host_dispatcher.h" | 10 #include "ppapi/proxy/host_dispatcher.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 file_system.host_resource(), path.c_str()); | 290 file_system.host_resource(), path.c_str()); |
291 if (!resource) | 291 if (!resource) |
292 return; // CreateInfo default constructor initializes to 0. | 292 return; // CreateInfo default constructor initializes to 0. |
293 SerializeFileRef(resource, result); | 293 SerializeFileRef(resource, result); |
294 } | 294 } |
295 | 295 |
296 void PPB_FileRef_Proxy::OnMsgGetParent(const HostResource& host_resource, | 296 void PPB_FileRef_Proxy::OnMsgGetParent(const HostResource& host_resource, |
297 PPBFileRef_CreateInfo* result) { | 297 PPBFileRef_CreateInfo* result) { |
298 PP_Resource resource = ppb_file_ref_target()->GetParent( | 298 PP_Resource resource = ppb_file_ref_target()->GetParent( |
299 host_resource.host_resource()); | 299 host_resource.host_resource()); |
300 if (!resource) | |
301 return; // CreateInfo default constructor initializes to 0. | |
302 SerializeFileRef(resource, result); | 300 SerializeFileRef(resource, result); |
303 } | 301 } |
304 | 302 |
305 void PPB_FileRef_Proxy::OnMsgMakeDirectory(const HostResource& host_resource, | 303 void PPB_FileRef_Proxy::OnMsgMakeDirectory(const HostResource& host_resource, |
306 PP_Bool make_ancestors, | 304 PP_Bool make_ancestors, |
307 uint32_t serialized_callback) { | 305 uint32_t serialized_callback) { |
308 PP_CompletionCallback callback = ReceiveCallback(serialized_callback); | 306 PP_CompletionCallback callback = ReceiveCallback(serialized_callback); |
309 int32_t result = | 307 int32_t result = |
310 ppb_file_ref_target()->MakeDirectory(host_resource.host_resource(), | 308 ppb_file_ref_target()->MakeDirectory(host_resource.host_resource(), |
311 make_ancestors, callback); | 309 make_ancestors, callback); |
(...skipping 29 matching lines...) Expand all Loading... |
341 int32_t result = | 339 int32_t result = |
342 ppb_file_ref_target()->Rename(file_ref.host_resource(), | 340 ppb_file_ref_target()->Rename(file_ref.host_resource(), |
343 new_file_ref.host_resource(), | 341 new_file_ref.host_resource(), |
344 callback); | 342 callback); |
345 if (result != PP_ERROR_WOULDBLOCK) | 343 if (result != PP_ERROR_WOULDBLOCK) |
346 PP_RunCompletionCallback(&callback, result); | 344 PP_RunCompletionCallback(&callback, result); |
347 } | 345 } |
348 | 346 |
349 } // namespace proxy | 347 } // namespace proxy |
350 } // namespace pp | 348 } // namespace pp |
OLD | NEW |