Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: ppapi/proxy/ppb_file_ref_proxy.cc

Issue 6543028: Implement the filesystem proxy. This allows the FileRef tests to pass in the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698