| OLD | NEW |
| 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 #ifndef PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "ppapi/c/pp_module.h" | 11 #include "ppapi/c/pp_module.h" |
| 12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "ppapi/c/pp_time.h" | 13 #include "ppapi/c/pp_time.h" |
| 14 #include "ppapi/proxy/interface_proxy.h" | 14 #include "ppapi/proxy/interface_proxy.h" |
| 15 | 15 |
| 16 struct PPB_FileRef_Dev; | 16 struct PPB_FileRef_Dev; |
| 17 | 17 |
| 18 namespace ppapi { |
| 19 class HostResource; |
| 20 } |
| 21 |
| 18 namespace pp { | 22 namespace pp { |
| 19 namespace proxy { | 23 namespace proxy { |
| 20 | 24 |
| 21 class HostResource; | |
| 22 struct PPBFileRef_CreateInfo; | 25 struct PPBFileRef_CreateInfo; |
| 23 | 26 |
| 24 class PPB_FileRef_Proxy : public InterfaceProxy { | 27 class PPB_FileRef_Proxy : public InterfaceProxy { |
| 25 public: | 28 public: |
| 26 PPB_FileRef_Proxy(Dispatcher* dispatcher, const void* target_interface); | 29 PPB_FileRef_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 27 virtual ~PPB_FileRef_Proxy(); | 30 virtual ~PPB_FileRef_Proxy(); |
| 28 | 31 |
| 29 static const Info* GetInfo(); | 32 static const Info* GetInfo(); |
| 30 | 33 |
| 31 static PP_Resource CreateProxyResource(PP_Resource file_system, | 34 static PP_Resource CreateProxyResource(PP_Resource file_system, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 // This represents passing the resource ownership to the plugin. This | 54 // This represents passing the resource ownership to the plugin. This |
| 52 // function also checks the validity of the result and returns 0 on failure. | 55 // function also checks the validity of the result and returns 0 on failure. |
| 53 // | 56 // |
| 54 // Various PPAPI functions return file refs from various interfaces, so this | 57 // Various PPAPI functions return file refs from various interfaces, so this |
| 55 // function is public so anybody can receive a file ref. | 58 // function is public so anybody can receive a file ref. |
| 56 static PP_Resource DeserializeFileRef( | 59 static PP_Resource DeserializeFileRef( |
| 57 const PPBFileRef_CreateInfo& serialized); | 60 const PPBFileRef_CreateInfo& serialized); |
| 58 | 61 |
| 59 private: | 62 private: |
| 60 // Message handlers. | 63 // Message handlers. |
| 61 void OnMsgCreate(const HostResource& file_system, | 64 void OnMsgCreate(const ppapi::HostResource& file_system, |
| 62 const std::string& path, | 65 const std::string& path, |
| 63 PPBFileRef_CreateInfo* result); | 66 PPBFileRef_CreateInfo* result); |
| 64 void OnMsgGetParent(const HostResource& host_resource, | 67 void OnMsgGetParent(const ppapi::HostResource& host_resource, |
| 65 PPBFileRef_CreateInfo* result); | 68 PPBFileRef_CreateInfo* result); |
| 66 void OnMsgMakeDirectory(const HostResource& host_resource, | 69 void OnMsgMakeDirectory(const ppapi::HostResource& host_resource, |
| 67 PP_Bool make_ancestors, | 70 PP_Bool make_ancestors, |
| 68 uint32_t serialized_callback); | 71 uint32_t serialized_callback); |
| 69 void OnMsgTouch(const HostResource& host_resource, | 72 void OnMsgTouch(const ppapi::HostResource& host_resource, |
| 70 PP_Time last_access, | 73 PP_Time last_access, |
| 71 PP_Time last_modified, | 74 PP_Time last_modified, |
| 72 uint32_t serialized_callback); | 75 uint32_t serialized_callback); |
| 73 void OnMsgDelete(const HostResource& host_resource, | 76 void OnMsgDelete(const ppapi::HostResource& host_resource, |
| 74 uint32_t serialized_callback); | 77 uint32_t serialized_callback); |
| 75 void OnMsgRename(const HostResource& file_ref, | 78 void OnMsgRename(const ppapi::HostResource& file_ref, |
| 76 const HostResource& new_file_ref, | 79 const ppapi::HostResource& new_file_ref, |
| 77 uint32_t serialized_callback); | 80 uint32_t serialized_callback); |
| 78 | 81 |
| 79 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Proxy); | 82 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Proxy); |
| 80 }; | 83 }; |
| 81 | 84 |
| 82 } // namespace proxy | 85 } // namespace proxy |
| 83 } // namespace pp | 86 } // namespace pp |
| 84 | 87 |
| 85 #endif // PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ | 88 #endif // PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ |
| OLD | NEW |