Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1005)

Side by Side Diff: ppapi/cpp/private/flash_file.h

Issue 10638007: Pepper Flash: Add trivial C++ wrappers for PPB_Flash_File_{ModuleLocal,FileRef}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/cpp/private/flash_file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef PPAPI_CPP_PRIVATE_FLASH_FILE_H_
6 #define PPAPI_CPP_PRIVATE_FLASH_FILE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "ppapi/c/private/ppb_flash_file.h"
12
13 namespace pp {
14
15 class FileRef;
16 class InstanceHandle;
17
18 namespace flash {
19
20 // FileModuleLocal -------------------------------------------------------------
21
22 class FileModuleLocal {
23 public:
24 // Returns true if the required interface is available.
25 static bool IsAvailable();
26
27 static bool CreateThreadAdapterForInstance(const InstanceHandle& instance);
28 static void ClearThreadAdapterForInstance(const InstanceHandle& instance);
29
30 // Returns |PP_kInvalidFileHandle| on error.
31 static PP_FileHandle OpenFile(const InstanceHandle& instance,
32 const std::string& path,
33 int32_t mode);
34 static bool RenameFile(const InstanceHandle& instance,
35 const std::string& path_from,
36 const std::string& path_to);
37 static bool DeleteFileOrDir(const InstanceHandle& instance,
38 const std::string& path,
39 bool recursive);
40 static bool CreateDir(const InstanceHandle& instance,
41 const std::string& path);
42 static bool QueryFile(const InstanceHandle& instance,
43 const std::string& path,
44 PP_FileInfo* info);
45 static bool GetDirContents(const InstanceHandle& instance,
yzshen1 2012/06/22 16:55:25 It seems good to have a comment that FreeDirConten
viettrungluu 2012/06/23 00:10:01 Done.
46 const std::string& path,
47 std::vector<PP_DirEntry_Dev>* dir_contents);
48
49 // Returns true if |CreateTemporaryFile()| is supported.
50 // TODO(viettrungluu): Remove this sometime after M21 ships to Stable?
51 static bool IsCreateTemporaryFileAvailable();
52 // Returns |PP_kInvalidFileHandle| on error.
53 static PP_FileHandle CreateTemporaryFile(const InstanceHandle& instance);
54 };
55
56 // FileFileRef -----------------------------------------------------------------
57
58 class FileFileRef {
59 // Returns true if the required interface is available.
60 static bool IsAvailable();
yzshen1 2012/06/22 16:55:25 Add public, please.
viettrungluu 2012/06/23 00:10:01 Done.
61
62 // Returns |PP_kInvalidFileHandle| on error.
63 static PP_FileHandle OpenFile(const pp::FileRef& resource,
64 int32_t mode);
65 static bool QueryFile(const pp::FileRef& resource,
66 PP_FileInfo* info);
67 };
68
69 } // namespace flash
70 } // namespace pp
71
72 #endif // PPAPI_CPP_PRIVATE_FLASH_FILE_H_
OLDNEW
« no previous file with comments | « no previous file | ppapi/cpp/private/flash_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698