OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 virtual int32_t Query(ppapi::host::ReplyMessageContext context) = 0; | 39 virtual int32_t Query(ppapi::host::ReplyMessageContext context) = 0; |
40 virtual int32_t ReadDirectoryEntries( | 40 virtual int32_t ReadDirectoryEntries( |
41 ppapi::host::ReplyMessageContext context) = 0; | 41 ppapi::host::ReplyMessageContext context) = 0; |
42 virtual int32_t GetAbsolutePath( | 42 virtual int32_t GetAbsolutePath( |
43 ppapi::host::ReplyMessageContext context) = 0; | 43 ppapi::host::ReplyMessageContext context) = 0; |
44 virtual fileapi::FileSystemURL GetFileSystemURL() const = 0; | 44 virtual fileapi::FileSystemURL GetFileSystemURL() const = 0; |
45 virtual std::string GetFileSystemURLSpec() const = 0; | 45 virtual std::string GetFileSystemURLSpec() const = 0; |
46 virtual base::FilePath GetExternalPath() const = 0; | 46 virtual base::FilePath GetExternalPath() const = 0; |
47 | 47 |
48 // Returns an error from the pp_errors.h enum. | 48 // Returns an error from the pp_errors.h enum. |
49 virtual int32_t HasPermissions(int permissions) const = 0; | 49 virtual int32_t CanRead() const = 0; |
| 50 virtual int32_t CanWrite() const = 0; |
| 51 virtual int32_t CanCreate() const = 0; |
50 }; | 52 }; |
51 | 53 |
52 class CONTENT_EXPORT PepperFileRefHost | 54 class CONTENT_EXPORT PepperFileRefHost |
53 : public ppapi::host::ResourceHost, | 55 : public ppapi::host::ResourceHost, |
54 public base::SupportsWeakPtr<PepperFileRefHost> { | 56 public base::SupportsWeakPtr<PepperFileRefHost> { |
55 public: | 57 public: |
56 PepperFileRefHost(BrowserPpapiHost* host, | 58 PepperFileRefHost(BrowserPpapiHost* host, |
57 PP_Instance instance, | 59 PP_Instance instance, |
58 PP_Resource resource, | 60 PP_Resource resource, |
59 PP_Resource file_system, | 61 PP_Resource file_system, |
(...skipping 13 matching lines...) Expand all Loading... |
73 virtual PepperFileRefHost* AsPepperFileRefHost() OVERRIDE; | 75 virtual PepperFileRefHost* AsPepperFileRefHost() OVERRIDE; |
74 | 76 |
75 // Required to support Rename(). | 77 // Required to support Rename(). |
76 PP_FileSystemType GetFileSystemType() const; | 78 PP_FileSystemType GetFileSystemType() const; |
77 fileapi::FileSystemURL GetFileSystemURL() const; | 79 fileapi::FileSystemURL GetFileSystemURL() const; |
78 | 80 |
79 // Required to support FileIO. | 81 // Required to support FileIO. |
80 std::string GetFileSystemURLSpec() const; | 82 std::string GetFileSystemURLSpec() const; |
81 base::FilePath GetExternalPath() const; | 83 base::FilePath GetExternalPath() const; |
82 | 84 |
83 int32_t HasPermissions(int permissions) const; | 85 int32_t CanRead() const; |
| 86 int32_t CanWrite() const; |
| 87 int32_t CanCreate() const; |
84 | 88 |
85 private: | 89 private: |
86 int32_t OnMakeDirectory(ppapi::host::HostMessageContext* context, | 90 int32_t OnMakeDirectory(ppapi::host::HostMessageContext* context, |
87 bool make_ancestors); | 91 bool make_ancestors); |
88 int32_t OnTouch(ppapi::host::HostMessageContext* context, | 92 int32_t OnTouch(ppapi::host::HostMessageContext* context, |
89 PP_Time last_access_time, | 93 PP_Time last_access_time, |
90 PP_Time last_modified_time); | 94 PP_Time last_modified_time); |
91 int32_t OnDelete(ppapi::host::HostMessageContext* context); | 95 int32_t OnDelete(ppapi::host::HostMessageContext* context); |
92 int32_t OnRename(ppapi::host::HostMessageContext* context, | 96 int32_t OnRename(ppapi::host::HostMessageContext* context, |
93 PP_Resource new_file_ref); | 97 PP_Resource new_file_ref); |
94 int32_t OnQuery(ppapi::host::HostMessageContext* context); | 98 int32_t OnQuery(ppapi::host::HostMessageContext* context); |
95 int32_t OnReadDirectoryEntries(ppapi::host::HostMessageContext* context); | 99 int32_t OnReadDirectoryEntries(ppapi::host::HostMessageContext* context); |
96 int32_t OnGetAbsolutePath(ppapi::host::HostMessageContext* context); | 100 int32_t OnGetAbsolutePath(ppapi::host::HostMessageContext* context); |
97 | 101 |
98 BrowserPpapiHost* host_; | 102 BrowserPpapiHost* host_; |
99 scoped_ptr<PepperFileRefBackend> backend_; | 103 scoped_ptr<PepperFileRefBackend> backend_; |
100 PP_FileSystemType fs_type_; | 104 PP_FileSystemType fs_type_; |
101 | 105 |
102 DISALLOW_COPY_AND_ASSIGN(PepperFileRefHost); | 106 DISALLOW_COPY_AND_ASSIGN(PepperFileRefHost); |
103 }; | 107 }; |
104 | 108 |
105 } // namespace content | 109 } // namespace content |
106 | 110 |
107 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ | 111 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ |
OLD | NEW |