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