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

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

Issue 7248047: Migrating PPB_FileIO_Dev, PPB_FileRef_Dev, and PPB_FileSystem_Dev dependencies to PPB_FileIO, PPB... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | « ppapi/proxy/ppapi_param_traits.cc ('k') | ppapi/proxy/ppb_file_system_proxy.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) 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"
8 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_file_ref.h"
9 #include "ppapi/c/private/ppb_proxy_private.h" 9 #include "ppapi/c/private/ppb_proxy_private.h"
10 #include "ppapi/proxy/enter_proxy.h" 10 #include "ppapi/proxy/enter_proxy.h"
11 #include "ppapi/proxy/host_dispatcher.h" 11 #include "ppapi/proxy/host_dispatcher.h"
12 #include "ppapi/proxy/plugin_dispatcher.h" 12 #include "ppapi/proxy/plugin_dispatcher.h"
13 #include "ppapi/proxy/plugin_resource.h" 13 #include "ppapi/proxy/plugin_resource.h"
14 #include "ppapi/proxy/ppapi_messages.h" 14 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/proxy/serialized_var.h" 15 #include "ppapi/proxy/serialized_var.h"
16 #include "ppapi/thunk/ppb_file_ref_api.h" 16 #include "ppapi/thunk/ppb_file_ref_api.h"
17 #include "ppapi/thunk/resource_creation_api.h" 17 #include "ppapi/thunk/resource_creation_api.h"
18 #include "ppapi/thunk/thunk.h" 18 #include "ppapi/thunk/thunk.h"
(...skipping 17 matching lines...) Expand all
36 36
37 class FileRef : public PluginResource, public PPB_FileRef_API { 37 class FileRef : public PluginResource, public PPB_FileRef_API {
38 public: 38 public:
39 explicit FileRef(const PPBFileRef_CreateInfo& info); 39 explicit FileRef(const PPBFileRef_CreateInfo& info);
40 virtual ~FileRef(); 40 virtual ~FileRef();
41 41
42 // ResourceObjectBase overrides. 42 // ResourceObjectBase overrides.
43 virtual PPB_FileRef_API* AsPPB_FileRef_API() OVERRIDE; 43 virtual PPB_FileRef_API* AsPPB_FileRef_API() OVERRIDE;
44 44
45 // PPB_FileRef_API implementation. 45 // PPB_FileRef_API implementation.
46 virtual PP_FileSystemType_Dev GetFileSystemType() const OVERRIDE; 46 virtual PP_FileSystemType GetFileSystemType() const OVERRIDE;
47 virtual PP_Var GetName() const OVERRIDE; 47 virtual PP_Var GetName() const OVERRIDE;
48 virtual PP_Var GetPath() const OVERRIDE; 48 virtual PP_Var GetPath() const OVERRIDE;
49 virtual PP_Resource GetParent() OVERRIDE; 49 virtual PP_Resource GetParent() OVERRIDE;
50 virtual int32_t MakeDirectory(PP_Bool make_ancestors, 50 virtual int32_t MakeDirectory(PP_Bool make_ancestors,
51 PP_CompletionCallback callback) OVERRIDE; 51 PP_CompletionCallback callback) OVERRIDE;
52 virtual int32_t Touch(PP_Time last_access_time, 52 virtual int32_t Touch(PP_Time last_access_time,
53 PP_Time last_modified_time, 53 PP_Time last_modified_time,
54 PP_CompletionCallback callback) OVERRIDE; 54 PP_CompletionCallback callback) OVERRIDE;
55 virtual int32_t Delete(PP_CompletionCallback callback) OVERRIDE; 55 virtual int32_t Delete(PP_CompletionCallback callback) OVERRIDE;
56 virtual int32_t Rename(PP_Resource new_file_ref, 56 virtual int32_t Rename(PP_Resource new_file_ref,
57 PP_CompletionCallback callback) OVERRIDE; 57 PP_CompletionCallback callback) OVERRIDE;
58 58
59 private: 59 private:
60 PP_FileSystemType_Dev file_system_type_; 60 PP_FileSystemType file_system_type_;
61 PP_Var path_; 61 PP_Var path_;
62 PP_Var name_; 62 PP_Var name_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(FileRef); 64 DISALLOW_COPY_AND_ASSIGN(FileRef);
65 }; 65 };
66 66
67 FileRef::FileRef(const PPBFileRef_CreateInfo& info) 67 FileRef::FileRef(const PPBFileRef_CreateInfo& info)
68 : PluginResource(info.resource) { 68 : PluginResource(info.resource) {
69 Dispatcher* dispatcher = PluginDispatcher::GetForInstance(instance()); 69 Dispatcher* dispatcher = PluginDispatcher::GetForInstance(instance());
70 70
71 file_system_type_ = static_cast<PP_FileSystemType_Dev>(info.file_system_type); 71 file_system_type_ = static_cast<PP_FileSystemType>(info.file_system_type);
72 72
73 name_ = ReceiveSerializedVarReturnValue(info.name).Return(dispatcher); 73 name_ = ReceiveSerializedVarReturnValue(info.name).Return(dispatcher);
74 path_ = ReceiveSerializedVarReturnValue(info.path).Return(dispatcher); 74 path_ = ReceiveSerializedVarReturnValue(info.path).Return(dispatcher);
75 } 75 }
76 76
77 FileRef::~FileRef() { 77 FileRef::~FileRef() {
78 PluginVarTracker::GetInstance()->Release(path_); 78 PluginVarTracker::GetInstance()->Release(path_);
79 PluginVarTracker::GetInstance()->Release(name_); 79 PluginVarTracker::GetInstance()->Release(name_);
80 } 80 }
81 81
82 PPB_FileRef_API* FileRef::AsPPB_FileRef_API() { 82 PPB_FileRef_API* FileRef::AsPPB_FileRef_API() {
83 return this; 83 return this;
84 } 84 }
85 85
86 PP_FileSystemType_Dev FileRef::GetFileSystemType() const { 86 PP_FileSystemType FileRef::GetFileSystemType() const {
87 return file_system_type_; 87 return file_system_type_;
88 } 88 }
89 89
90 PP_Var FileRef::GetName() const { 90 PP_Var FileRef::GetName() const {
91 PluginVarTracker::GetInstance()->AddRef(name_); 91 PluginVarTracker::GetInstance()->AddRef(name_);
92 return name_; 92 return name_;
93 } 93 }
94 94
95 PP_Var FileRef::GetPath() const { 95 PP_Var FileRef::GetPath() const {
96 PluginVarTracker::GetInstance()->AddRef(path_); 96 PluginVarTracker::GetInstance()->AddRef(path_);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 const void* target_interface) 148 const void* target_interface)
149 : InterfaceProxy(dispatcher, target_interface) { 149 : InterfaceProxy(dispatcher, target_interface) {
150 } 150 }
151 151
152 PPB_FileRef_Proxy::~PPB_FileRef_Proxy() { 152 PPB_FileRef_Proxy::~PPB_FileRef_Proxy() {
153 } 153 }
154 154
155 const InterfaceProxy::Info* PPB_FileRef_Proxy::GetInfo() { 155 const InterfaceProxy::Info* PPB_FileRef_Proxy::GetInfo() {
156 static const Info info = { 156 static const Info info = {
157 ::ppapi::thunk::GetPPB_FileRef_Thunk(), 157 ::ppapi::thunk::GetPPB_FileRef_Thunk(),
158 PPB_FILEREF_DEV_INTERFACE, 158 PPB_FILEREF_INTERFACE,
159 INTERFACE_ID_PPB_FILE_REF, 159 INTERFACE_ID_PPB_FILE_REF,
160 false, 160 false,
161 &CreateFileRefProxy, 161 &CreateFileRefProxy,
162 }; 162 };
163 return &info; 163 return &info;
164 } 164 }
165 165
166 // static 166 // static
167 PP_Resource PPB_FileRef_Proxy::CreateProxyResource(PP_Resource file_system, 167 PP_Resource PPB_FileRef_Proxy::CreateProxyResource(PP_Resource file_system,
168 const char* path) { 168 const char* path) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return; 294 return;
295 PP_CompletionCallback callback = ReceiveCallback(serialized_callback); 295 PP_CompletionCallback callback = ReceiveCallback(serialized_callback);
296 int32_t result = enter.object()->Rename(new_file_ref.host_resource(), 296 int32_t result = enter.object()->Rename(new_file_ref.host_resource(),
297 callback); 297 callback);
298 if (result != PP_OK_COMPLETIONPENDING) 298 if (result != PP_OK_COMPLETIONPENDING)
299 PP_RunCompletionCallback(&callback, result); 299 PP_RunCompletionCallback(&callback, result);
300 } 300 }
301 301
302 } // namespace proxy 302 } // namespace proxy
303 } // namespace pp 303 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.cc ('k') | ppapi/proxy/ppb_file_system_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698