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