OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_PEPPER_FILE_REF_H_ | |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_FILE_REF_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/file_path.h" | |
11 #include "ppapi/c/dev/ppb_file_ref_dev.h" | |
12 #include "webkit/glue/plugins/pepper_resource.h" | |
13 | |
14 namespace pepper { | |
15 | |
16 class FileSystem; | |
17 class PluginInstance; | |
18 class PluginModule; | |
19 | |
20 class FileRef : public Resource { | |
21 public: | |
22 FileRef(); | |
23 FileRef(PluginModule* module, | |
24 scoped_refptr<FileSystem> file_system, | |
25 const std::string& validated_path); | |
26 FileRef(PluginModule* module, | |
27 const FilePath& external_file_path); | |
28 virtual ~FileRef(); | |
29 | |
30 // Returns a pointer to the interface implementing PPB_FileRef that is | |
31 // exposed to the plugin. | |
32 static const PPB_FileRef_Dev* GetInterface(); | |
33 | |
34 // Resource overrides. | |
35 virtual FileRef* AsFileRef(); | |
36 | |
37 // PPB_FileRef implementation. | |
38 std::string GetName() const; | |
39 scoped_refptr<FileRef> GetParent(); | |
40 | |
41 // Returns the file system to which this FileRef belongs. | |
42 scoped_refptr<FileSystem> GetFileSystem() const; | |
43 | |
44 // Returns the type of the file system to which this FileRef belongs. | |
45 PP_FileSystemType_Dev GetFileSystemType() const; | |
46 | |
47 // Returns the virtual path (i.e., the path that the pepper plugin sees) | |
48 // corresponding to this file. | |
49 std::string GetPath() const; | |
50 | |
51 // Returns the system path corresponding to this file. | |
52 FilePath GetSystemPath() const; | |
53 | |
54 private: | |
55 scoped_refptr<FileSystem> file_system_; | |
56 std::string virtual_path_; // UTF-8 encoded | |
57 FilePath system_path_; | |
58 }; | |
59 | |
60 } // namespace pepper | |
61 | |
62 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_FILE_REF_H_ | |
OLD | NEW |