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

Side by Side Diff: trunk/src/ppapi/thunk/ppb_file_ref_thunk.cc

Issue 23647008: Revert 221284 "Pepper: Move FileRef to the "new" resource proxy." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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
« no previous file with comments | « trunk/src/ppapi/thunk/ppb_file_ref_api.h ('k') | trunk/src/ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/c/pp_file_info.h" 5 #include "ppapi/c/pp_file_info.h"
6 #include "ppapi/c/ppb_file_ref.h" 6 #include "ppapi/c/ppb_file_ref.h"
7 #include "ppapi/c/pp_completion_callback.h" 7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_file_ref_private.h" 9 #include "ppapi/c/private/ppb_file_ref_private.h"
10 #include "ppapi/shared_impl/file_ref_create_info.h"
11 #include "ppapi/shared_impl/proxy_lock.h" 10 #include "ppapi/shared_impl/proxy_lock.h"
12 #include "ppapi/shared_impl/tracked_callback.h" 11 #include "ppapi/shared_impl/tracked_callback.h"
13 #include "ppapi/thunk/enter.h" 12 #include "ppapi/thunk/enter.h"
14 #include "ppapi/thunk/thunk.h" 13 #include "ppapi/thunk/thunk.h"
15 #include "ppapi/thunk/ppb_file_ref_api.h" 14 #include "ppapi/thunk/ppb_file_ref_api.h"
16 #include "ppapi/thunk/ppb_file_system_api.h" 15 #include "ppapi/thunk/ppb_file_system_api.h"
17 #include "ppapi/thunk/resource_creation_api.h" 16 #include "ppapi/thunk/resource_creation_api.h"
18 17
19 namespace ppapi { 18 namespace ppapi {
20 namespace thunk { 19 namespace thunk {
21 20
22 namespace { 21 namespace {
23 22
24 typedef EnterResource<PPB_FileRef_API> EnterFileRef; 23 typedef EnterResource<PPB_FileRef_API> EnterFileRef;
25 24
26 PP_Resource Create(PP_Resource file_system, const char* path) { 25 PP_Resource Create(PP_Resource file_system, const char* path) {
27 VLOG(4) << "PPB_FileRef::Create()"; 26 VLOG(4) << "PPB_FileRef::Create()";
28 ppapi::ProxyAutoLock lock; 27 ppapi::ProxyAutoLock lock;
29 EnterResourceNoLock<PPB_FileSystem_API> enter_file_system(file_system, true); 28 EnterResourceNoLock<PPB_FileSystem_API> enter_file_system(file_system, true);
30 if (enter_file_system.failed()) 29 if (enter_file_system.failed())
31 return 0; 30 return 0;
32 PP_Instance instance = enter_file_system.resource()->pp_instance(); 31 PP_Instance instance = enter_file_system.resource()->pp_instance();
33 EnterResourceCreationNoLock enter(instance); 32 EnterResourceCreationNoLock enter(instance);
34 if (enter.failed()) 33 if (enter.failed())
35 return 0; 34 return 0;
36 FileRefCreateInfo info; 35 return enter.functions()->CreateFileRef(instance, file_system, path);
37 info.file_system_type = enter_file_system.object()->GetType();
38 info.internal_path = std::string(path);
39 info.browser_pending_host_resource_id = 0;
40 info.renderer_pending_host_resource_id = 0;
41 info.file_system_plugin_resource = file_system;
42 return enter.functions()->CreateFileRef(instance, info);
43 } 36 }
44 37
45 PP_Bool IsFileRef(PP_Resource resource) { 38 PP_Bool IsFileRef(PP_Resource resource) {
46 VLOG(4) << "PPB_FileRef::IsFileRef()"; 39 VLOG(4) << "PPB_FileRef::IsFileRef()";
47 EnterFileRef enter(resource, false); 40 EnterFileRef enter(resource, false);
48 return PP_FromBool(enter.succeeded()); 41 return PP_FromBool(enter.succeeded());
49 } 42 }
50 43
51 PP_FileSystemType GetFileSystemType(PP_Resource file_ref) { 44 PP_FileSystemType GetFileSystemType(PP_Resource file_ref) {
52 VLOG(4) << "PPB_FileRef::GetFileSystemType()"; 45 VLOG(4) << "PPB_FileRef::GetFileSystemType()";
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() { 186 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() {
194 return &g_ppb_file_ref_thunk_1_1; 187 return &g_ppb_file_ref_thunk_1_1;
195 } 188 }
196 189
197 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() { 190 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() {
198 return &g_ppb_file_ref_private_thunk; 191 return &g_ppb_file_ref_private_thunk;
199 } 192 }
200 193
201 } // namespace thunk 194 } // namespace thunk
202 } // namespace ppapi 195 } // namespace ppapi
OLDNEW
« no previous file with comments | « trunk/src/ppapi/thunk/ppb_file_ref_api.h ('k') | trunk/src/ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698