diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 06:10:57 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 06:10:57 +0000 |
commit | cd57d088c61b38881261c159792537e8b93eb6b8 (patch) | |
tree | b8623b5600833d4deeaca2b1617655c4ad2395c2 /ppapi/proxy/flash_file_resource.h | |
parent | 199e9257d7e6da23084e5ce1d971612bf8ad4c5a (diff) | |
download | chromium_src-cd57d088c61b38881261c159792537e8b93eb6b8.zip chromium_src-cd57d088c61b38881261c159792537e8b93eb6b8.tar.gz chromium_src-cd57d088c61b38881261c159792537e8b93eb6b8.tar.bz2 |
Revert 171389
The revert is causing browser tests to fail. Reverting the revert.
> Revert 171080
>
> > 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
>
> TBR=raymes@chromium.org
>
> Review URL: https://codereview.chromium.org/11437038
TBR=raymes@chromium.org
Review URL: https://codereview.chromium.org/11450025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/flash_file_resource.h')
-rw-r--r-- | ppapi/proxy/flash_file_resource.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/ppapi/proxy/flash_file_resource.h b/ppapi/proxy/flash_file_resource.h new file mode 100644 index 0000000..f8c4b18 --- /dev/null +++ b/ppapi/proxy/flash_file_resource.h @@ -0,0 +1,73 @@ +// 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_PROXY_FLASH_FILE_RESOURCE_H_ +#define PPAPI_PROXY_FLASH_FILE_RESOURCE_H_ + +#include <string> + +#include "ppapi/proxy/connection.h" +#include "ppapi/proxy/plugin_resource.h" +#include "ppapi/shared_impl/file_path.h" +#include "ppapi/thunk/ppb_flash_file_api.h" + +namespace ppapi { +namespace proxy { + +class FlashFileResource + : public PluginResource, + public thunk::PPB_Flash_File_API { + public: + FlashFileResource(Connection connection, PP_Instance instance); + virtual ~FlashFileResource(); + + // Resource overrides. + virtual thunk::PPB_Flash_File_API* AsPPB_Flash_File_API() OVERRIDE; + + // PPB_Flash_Functions_API. + virtual int32_t OpenFile(PP_Instance instance, + const char* path, + int32_t mode, + PP_FileHandle* file) OVERRIDE; + virtual int32_t RenameFile(PP_Instance instance, + const char* path_from, + const char* path_to) OVERRIDE; + virtual int32_t DeleteFileOrDir(PP_Instance instance, + const char* path, + PP_Bool recursive) OVERRIDE; + virtual int32_t CreateDir(PP_Instance instance, const char* path) OVERRIDE; + virtual int32_t QueryFile(PP_Instance instance, + const char* path, + PP_FileInfo* info) OVERRIDE; + virtual int32_t GetDirContents(PP_Instance instance, + const char* path, + PP_DirContents_Dev** contents) OVERRIDE; + virtual void FreeDirContents(PP_Instance instance, + PP_DirContents_Dev* contents) OVERRIDE; + virtual int32_t CreateTemporaryFile(PP_Instance instance, + PP_FileHandle* file) OVERRIDE; + virtual int32_t OpenFileRef(PP_Instance instance, + PP_Resource file_ref, + int32_t mode, + PP_FileHandle* file) OVERRIDE; + virtual int32_t QueryFileRef(PP_Instance instance, + PP_Resource file_ref, + PP_FileInfo* info) OVERRIDE; + + private: + int32_t OpenFileHelper(const std::string& path, + PepperFilePath::Domain domain_type, + int32_t mode, + PP_FileHandle* file); + int32_t QueryFileHelper(const std::string& path, + PepperFilePath::Domain domain_type, + PP_FileInfo* info); + + DISALLOW_COPY_AND_ASSIGN(FlashFileResource); +}; + +} // namespace proxy +} // namespace ppapi + +#endif // PPAPI_PROXY_FLASH_FILE_RESOURCE_H_ |