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

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

Issue 21966004: Pepper: Move FileRef to the "new" resource proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better BodyItem refcount fix. Created 7 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/file_io_resource.h" 5 #include "ppapi/proxy/file_io_resource.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ipc/ipc_message.h" 8 #include "ipc/ipc_message.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 file_system_type_ = type; 71 file_system_type_ = type;
72 72
73 int32_t rv = state_manager_.CheckOperationState( 73 int32_t rv = state_manager_.CheckOperationState(
74 FileIOStateManager::OPERATION_EXCLUSIVE, false); 74 FileIOStateManager::OPERATION_EXCLUSIVE, false);
75 if (rv != PP_OK) 75 if (rv != PP_OK)
76 return rv; 76 return rv;
77 77
78 Call<PpapiPluginMsg_FileIO_OpenReply>(RENDERER, 78 Call<PpapiPluginMsg_FileIO_OpenReply>(RENDERER,
79 PpapiHostMsg_FileIO_Open( 79 PpapiHostMsg_FileIO_Open(
80 enter.resource()->host_resource().host_resource(), 80 file_ref,
81 open_flags), 81 open_flags),
82 base::Bind(&FileIOResource::OnPluginMsgOpenFileComplete, this, 82 base::Bind(&FileIOResource::OnPluginMsgOpenFileComplete, this,
83 callback)); 83 callback));
84 84
85 state_manager_.SetPendingOperation(FileIOStateManager::OPERATION_EXCLUSIVE); 85 state_manager_.SetPendingOperation(FileIOStateManager::OPERATION_EXCLUSIVE);
86 return PP_OK_COMPLETIONPENDING; 86 return PP_OK_COMPLETIONPENDING;
87 } 87 }
88 88
89 int32_t FileIOResource::Query(PP_FileInfo* info, 89 int32_t FileIOResource::Query(PP_FileInfo* info,
90 scoped_refptr<TrackedCallback> callback) { 90 scoped_refptr<TrackedCallback> callback) {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 *output_handle = IPC::PlatformFileForTransitToPlatformFile(transit_file); 414 *output_handle = IPC::PlatformFileForTransitToPlatformFile(transit_file);
415 415
416 // End this operation now, so the user's callback can execute another FileIO 416 // End this operation now, so the user's callback can execute another FileIO
417 // operation, assuming there are no other pending operations. 417 // operation, assuming there are no other pending operations.
418 state_manager_.SetOperationFinished(); 418 state_manager_.SetOperationFinished();
419 callback->Run(result); 419 callback->Run(result);
420 } 420 }
421 421
422 } // namespace proxy 422 } // namespace proxy
423 } // namespace ppapi 423 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698