diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-08 00:46:23 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-08 00:46:23 +0000 |
commit | 0c92b0d1079123c39f6e8fbd7eb3ff6503e9bccd (patch) | |
tree | b6defa7168b626436612114c0176b91c84284beb /ppapi/thunk/ppb_flash_file_api.h | |
parent | e61449d257bd231d718afe97a19a686feac2219d (diff) | |
download | chromium_src-0c92b0d1079123c39f6e8fbd7eb3ff6503e9bccd.zip chromium_src-0c92b0d1079123c39f6e8fbd7eb3ff6503e9bccd.tar.gz chromium_src-0c92b0d1079123c39f6e8fbd7eb3ff6503e9bccd.tar.bz2 |
Refactored the PPB_Flash_File_ModuleLocal/FileRef to the new ppapi resource model
The refactors PPB_Flash_File_ModuleLocal/FileRef to the new resource model. Calls for both these interfaces are now made directly to the browser. This removes the in-process implementation for these interfaces also (as they are flash-only). Tests are added for PPB_Flash_File_ModuleLocal.
Review URL: https://codereview.chromium.org/11359097
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk/ppb_flash_file_api.h')
-rw-r--r-- | ppapi/thunk/ppb_flash_file_api.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/ppapi/thunk/ppb_flash_file_api.h b/ppapi/thunk/ppb_flash_file_api.h new file mode 100644 index 0000000..d757253 --- /dev/null +++ b/ppapi/thunk/ppb_flash_file_api.h @@ -0,0 +1,63 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_THUNK_PPB_FLASH_FILE_API_H_ +#define PPAPI_THUNK_PPB_FLASH_FILE_API_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_stdint.h" +#include "ppapi/c/private/pp_file_handle.h" +#include "ppapi/c/private/ppb_flash_file.h" +#include "ppapi/shared_impl/singleton_resource_id.h" +#include "ppapi/thunk/ppapi_thunk_export.h" + +struct PP_FileInfo; + +namespace ppapi { +namespace thunk { + +class PPAPI_THUNK_EXPORT PPB_Flash_File_API { + public: + virtual ~PPB_Flash_File_API() {} + + // FlashFile_ModuleLocal. + virtual int32_t OpenFile(PP_Instance instance, + const char* path, + int32_t mode, + PP_FileHandle* file) = 0; + virtual int32_t RenameFile(PP_Instance instance, + const char* path_from, + const char* path_to) = 0; + virtual int32_t DeleteFileOrDir(PP_Instance instance, + const char* path, + PP_Bool recursive) = 0; + virtual int32_t CreateDir(PP_Instance instance, const char* path) = 0; + virtual int32_t QueryFile(PP_Instance instance, + const char* path, + PP_FileInfo* info) = 0; + virtual int32_t GetDirContents(PP_Instance instance, + const char* path, + PP_DirContents_Dev** contents) = 0; + virtual void FreeDirContents(PP_Instance instance, + PP_DirContents_Dev* contents) = 0; + virtual int32_t CreateTemporaryFile(PP_Instance instance, + PP_FileHandle* file) = 0; + + // FlashFile_FileRef. + virtual int32_t OpenFileRef(PP_Instance instance, + PP_Resource file_ref, + int32_t mode, + PP_FileHandle* file) = 0; + virtual int32_t QueryFileRef(PP_Instance instance, + PP_Resource file_ref, + PP_FileInfo* info) = 0; + + static const SingletonResourceID kSingletonResourceID = + FLASH_FILE_SINGLETON_ID; +}; + +} // namespace thunk +} // namespace ppapi + +#endif // PPAPI_THUNK_PPB_FLASH_FILE_API_H_ |