1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_PROXY_FLASH_FILE_RESOURCE_H_
6 #define PPAPI_PROXY_FLASH_FILE_RESOURCE_H_
10 #include "ppapi/proxy/connection.h"
11 #include "ppapi/proxy/plugin_resource.h"
12 #include "ppapi/shared_impl/file_path.h"
13 #include "ppapi/thunk/ppb_flash_file_api.h"
18 class FlashFileResource
19 : public PluginResource
,
20 public thunk::PPB_Flash_File_API
{
22 FlashFileResource(Connection connection
, PP_Instance instance
);
23 virtual ~FlashFileResource();
25 // Resource overrides.
26 virtual thunk::PPB_Flash_File_API
* AsPPB_Flash_File_API() OVERRIDE
;
28 // PPB_Flash_Functions_API.
29 virtual int32_t OpenFile(PP_Instance instance
,
32 PP_FileHandle
* file
) OVERRIDE
;
33 virtual int32_t RenameFile(PP_Instance instance
,
34 const char* path_from
,
35 const char* path_to
) OVERRIDE
;
36 virtual int32_t DeleteFileOrDir(PP_Instance instance
,
38 PP_Bool recursive
) OVERRIDE
;
39 virtual int32_t CreateDir(PP_Instance instance
, const char* path
) OVERRIDE
;
40 virtual int32_t QueryFile(PP_Instance instance
,
42 PP_FileInfo
* info
) OVERRIDE
;
43 virtual int32_t GetDirContents(PP_Instance instance
,
45 PP_DirContents_Dev
** contents
) OVERRIDE
;
46 virtual void FreeDirContents(PP_Instance instance
,
47 PP_DirContents_Dev
* contents
) OVERRIDE
;
48 virtual int32_t CreateTemporaryFile(PP_Instance instance
,
49 PP_FileHandle
* file
) OVERRIDE
;
50 virtual int32_t OpenFileRef(PP_Instance instance
,
53 PP_FileHandle
* file
) OVERRIDE
;
54 virtual int32_t QueryFileRef(PP_Instance instance
,
56 PP_FileInfo
* info
) OVERRIDE
;
59 int32_t OpenFileHelper(const std::string
& path
,
60 PepperFilePath::Domain domain_type
,
63 int32_t QueryFileHelper(const std::string
& path
,
64 PepperFilePath::Domain domain_type
,
67 DISALLOW_COPY_AND_ASSIGN(FlashFileResource
);
73 #endif // PPAPI_PROXY_FLASH_FILE_RESOURCE_H_