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

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

Issue 22903002: Revert 216744 "Pepper: Move FileRef to the "new" resource proxy." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 "base/task_runner_util.h" 8 #include "base/task_runner_util.h"
9 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 file_system_type_ = type; 107 file_system_type_ = type;
108 108
109 int32_t rv = state_manager_.CheckOperationState( 109 int32_t rv = state_manager_.CheckOperationState(
110 FileIOStateManager::OPERATION_EXCLUSIVE, false); 110 FileIOStateManager::OPERATION_EXCLUSIVE, false);
111 if (rv != PP_OK) 111 if (rv != PP_OK)
112 return rv; 112 return rv;
113 113
114 Call<PpapiPluginMsg_FileIO_OpenReply>(RENDERER, 114 Call<PpapiPluginMsg_FileIO_OpenReply>(RENDERER,
115 PpapiHostMsg_FileIO_Open( 115 PpapiHostMsg_FileIO_Open(
116 file_ref, 116 enter.resource()->host_resource().host_resource(),
117 open_flags), 117 open_flags),
118 base::Bind(&FileIOResource::OnPluginMsgOpenFileComplete, this, 118 base::Bind(&FileIOResource::OnPluginMsgOpenFileComplete, this,
119 callback)); 119 callback));
120 120
121 state_manager_.SetPendingOperation(FileIOStateManager::OPERATION_EXCLUSIVE); 121 state_manager_.SetPendingOperation(FileIOStateManager::OPERATION_EXCLUSIVE);
122 return PP_OK_COMPLETIONPENDING; 122 return PP_OK_COMPLETIONPENDING;
123 } 123 }
124 124
125 int32_t FileIOResource::Query(PP_FileInfo* info, 125 int32_t FileIOResource::Query(PP_FileInfo* info,
126 scoped_refptr<TrackedCallback> callback) { 126 scoped_refptr<TrackedCallback> callback) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 *output_handle = IPC::PlatformFileForTransitToPlatformFile(transit_file); 442 *output_handle = IPC::PlatformFileForTransitToPlatformFile(transit_file);
443 443
444 // End this operation now, so the user's callback can execute another FileIO 444 // End this operation now, so the user's callback can execute another FileIO
445 // operation, assuming there are no other pending operations. 445 // operation, assuming there are no other pending operations.
446 state_manager_.SetOperationFinished(); 446 state_manager_.SetOperationFinished();
447 callback->Run(result); 447 callback->Run(result);
448 } 448 }
449 449
450 } // namespace proxy 450 } // namespace proxy
451 } // namespace ppapi 451 } // namespace ppapi
OLDNEW
« no previous file with comments | « trunk/src/ppapi/proxy/file_chooser_resource_unittest.cc ('k') | trunk/src/ppapi/proxy/file_ref_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698