| 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 "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "ppapi/c/pp_file_info.h" | 12 #include "ppapi/c/pp_file_info.h" |
| 13 #include "ppapi/c/pp_module.h" | 13 #include "ppapi/c/pp_module.h" |
| 14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
| 15 #include "ppapi/c/pp_time.h" | 15 #include "ppapi/c/pp_time.h" |
| 16 #include "ppapi/proxy/interface_proxy.h" | 16 #include "ppapi/proxy/interface_proxy.h" |
| 17 #include "ppapi/proxy/ppapi_proxy_export.h" | 17 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 18 #include "ppapi/proxy/proxy_completion_callback_factory.h" | 18 #include "ppapi/proxy/proxy_completion_callback_factory.h" |
| 19 #include "ppapi/shared_impl/host_resource.h" |
| 19 #include "ppapi/utility/completion_callback_factory.h" | 20 #include "ppapi/utility/completion_callback_factory.h" |
| 20 | 21 |
| 21 namespace ppapi { | 22 namespace ppapi { |
| 22 | 23 |
| 23 class HostResource; | |
| 24 struct PPB_FileRef_CreateInfo; | 24 struct PPB_FileRef_CreateInfo; |
| 25 | 25 |
| 26 namespace proxy { | 26 namespace proxy { |
| 27 | 27 |
| 28 class SerializedVarReturnValue; | 28 class SerializedVarReturnValue; |
| 29 | 29 |
| 30 class PPAPI_PROXY_EXPORT PPB_FileRef_Proxy | 30 class PPAPI_PROXY_EXPORT PPB_FileRef_Proxy |
| 31 : public NON_EXPORTED_BASE(InterfaceProxy) { | 31 : public NON_EXPORTED_BASE(InterfaceProxy) { |
| 32 public: | 32 public: |
| 33 explicit PPB_FileRef_Proxy(Dispatcher* dispatcher); | 33 explicit PPB_FileRef_Proxy(Dispatcher* dispatcher); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 uint32_t callback_id); | 80 uint32_t callback_id); |
| 81 void OnMsgDelete(const HostResource& host_resource, | 81 void OnMsgDelete(const HostResource& host_resource, |
| 82 uint32_t callback_id); | 82 uint32_t callback_id); |
| 83 void OnMsgRename(const HostResource& file_ref, | 83 void OnMsgRename(const HostResource& file_ref, |
| 84 const HostResource& new_file_ref, | 84 const HostResource& new_file_ref, |
| 85 uint32_t callback_id); | 85 uint32_t callback_id); |
| 86 void OnMsgQuery(const HostResource& file_ref, | 86 void OnMsgQuery(const HostResource& file_ref, |
| 87 uint32_t callback_id); | 87 uint32_t callback_id); |
| 88 void OnMsgGetAbsolutePath(const HostResource& host_resource, | 88 void OnMsgGetAbsolutePath(const HostResource& host_resource, |
| 89 SerializedVarReturnValue result); | 89 SerializedVarReturnValue result); |
| 90 void OnMsgReadEntries(const HostResource& file_ref, |
| 91 uint32_t callback_id); |
| 90 | 92 |
| 91 // Host -> Plugin message handlers. | 93 // Host -> Plugin message handlers. |
| 92 void OnMsgCallbackComplete(const HostResource& host_resource, | 94 void OnMsgCallbackComplete(const HostResource& host_resource, |
| 93 uint32_t callback_id, | 95 uint32_t callback_id, |
| 94 int32_t result); | 96 int32_t result); |
| 95 void OnMsgQueryCallbackComplete(const HostResource& host_resource, | 97 void OnMsgQueryCallbackComplete(const HostResource& host_resource, |
| 96 const PP_FileInfo& info, | 98 const PP_FileInfo& info, |
| 97 uint32_t callback_id, | 99 uint32_t callback_id, |
| 98 int32_t result); | 100 int32_t result); |
| 101 void OnMsgReadEntriesCallbackComplete( |
| 102 const HostResource& host_resource, |
| 103 const std::vector<ppapi::PPB_FileRef_CreateInfo>& infos, |
| 104 const std::vector<PP_FileType>& file_types, |
| 105 uint32_t callback_id, |
| 106 int32_t result); |
| 107 |
| 108 struct HostCallbackParams { |
| 109 HostCallbackParams(const HostResource& host_res, uint32_t cb_id) |
| 110 : host_resource(host_res), callback_id(cb_id) { |
| 111 } |
| 112 HostResource host_resource; |
| 113 uint32_t callback_id; |
| 114 }; |
| 99 | 115 |
| 100 void OnCallbackCompleteInHost(int32_t result, | 116 void OnCallbackCompleteInHost(int32_t result, |
| 101 const HostResource& host_resource, | 117 const HostResource& host_resource, |
| 102 uint32_t callback_id); | 118 uint32_t callback_id); |
| 103 void OnQueryCallbackCompleteInHost( | 119 void OnQueryCallbackCompleteInHost( |
| 104 int32_t result, | 120 int32_t result, |
| 105 const HostResource& host_resource, | 121 const HostResource& host_resource, |
| 106 base::internal::OwnedWrapper<PP_FileInfo> info, | 122 base::internal::OwnedWrapper<PP_FileInfo> info, |
| 107 uint32_t callback_id); | 123 uint32_t callback_id); |
| 124 void OnReadEntriesCallbackCompleteInHost( |
| 125 int32_t result, |
| 126 base::internal::OwnedWrapper<HostCallbackParams> params, |
| 127 base::internal::OwnedWrapper< |
| 128 std::vector<ppapi::PPB_FileRef_CreateInfo> > files, |
| 129 base::internal::OwnedWrapper<std::vector<PP_FileType> > file_types); |
| 108 | 130 |
| 109 ProxyCompletionCallbackFactory<PPB_FileRef_Proxy> callback_factory_; | 131 ProxyCompletionCallbackFactory<PPB_FileRef_Proxy> callback_factory_; |
| 110 | 132 |
| 111 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Proxy); | 133 DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Proxy); |
| 112 }; | 134 }; |
| 113 | 135 |
| 114 } // namespace proxy | 136 } // namespace proxy |
| 115 } // namespace ppapi | 137 } // namespace ppapi |
| 116 | 138 |
| 117 #endif // PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ | 139 #endif // PPAPI_PROXY_PPB_FILE_REF_PROXY_H_ |
| OLD | NEW |