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 "third_party/ppapi/c/ppb_file_ref.h" |
| 11 #include "webkit/glue/plugins/pepper_resource.h" |
| 12 |
| 13 namespace pepper { |
| 14 |
| 15 class PluginModule; |
| 16 |
| 17 class FileRef : public Resource { |
| 18 public: |
| 19 FileRef(PluginModule* module, |
| 20 PP_FileSystemType file_system_type, |
| 21 const std::string& validated_path, |
| 22 const std::string& origin); |
| 23 virtual ~FileRef(); |
| 24 |
| 25 // Returns a pointer to the interface implementing PPB_FileRef that is |
| 26 // exposed to the plugin. |
| 27 static const PPB_FileRef* GetInterface(); |
| 28 |
| 29 // Resource overrides. |
| 30 FileRef* AsFileRef() { return this; } |
| 31 |
| 32 // PPB_FileRef implementation. |
| 33 std::string GetName() const; |
| 34 scoped_refptr<FileRef> GetParent(); |
| 35 |
| 36 PP_FileSystemType file_system_type() const { return fs_type_; } |
| 37 const std::string& path() const { return path_; } |
| 38 |
| 39 private: |
| 40 PP_FileSystemType fs_type_; |
| 41 std::string path_; // UTF-8 encoded. |
| 42 std::string origin_; |
| 43 }; |
| 44 |
| 45 } // namespace pepper |
| 46 |
| 47 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_FILE_REF_H_ |
OLD | NEW |