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 11 matching lines...) Expand all Loading... |
22 class PepperFileSystemBrowserHost; | 22 class PepperFileSystemBrowserHost; |
23 | 23 |
24 // Internal and external filesystems have very different codepaths for | 24 // Internal and external filesystems have very different codepaths for |
25 // performing FileRef operations. The logic is split into separate classes | 25 // performing FileRef operations. The logic is split into separate classes |
26 // to make it easier to read. | 26 // to make it easier to read. |
27 class PepperFileRefBackend { | 27 class PepperFileRefBackend { |
28 public: | 28 public: |
29 virtual ~PepperFileRefBackend(); | 29 virtual ~PepperFileRefBackend(); |
30 | 30 |
31 virtual int32_t MakeDirectory(ppapi::host::ReplyMessageContext context, | 31 virtual int32_t MakeDirectory(ppapi::host::ReplyMessageContext context, |
32 bool make_ancestors) = 0; | 32 int32_t make_directory_flags) = 0; |
33 virtual int32_t Touch(ppapi::host::ReplyMessageContext context, | 33 virtual int32_t Touch(ppapi::host::ReplyMessageContext context, |
34 PP_Time last_accessed_time, | 34 PP_Time last_accessed_time, |
35 PP_Time last_modified_time) = 0; | 35 PP_Time last_modified_time) = 0; |
36 virtual int32_t Delete(ppapi::host::ReplyMessageContext context) = 0; | 36 virtual int32_t Delete(ppapi::host::ReplyMessageContext context) = 0; |
37 virtual int32_t Rename(ppapi::host::ReplyMessageContext context, | 37 virtual int32_t Rename(ppapi::host::ReplyMessageContext context, |
38 PepperFileRefHost* new_file_ref) = 0; | 38 PepperFileRefHost* new_file_ref) = 0; |
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( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 base::FilePath GetExternalFilePath() const; | 82 base::FilePath GetExternalFilePath() const; |
83 base::WeakPtr<PepperFileSystemBrowserHost> GetFileSystemHost() const; | 83 base::WeakPtr<PepperFileSystemBrowserHost> GetFileSystemHost() const; |
84 | 84 |
85 int32_t CanRead() const; | 85 int32_t CanRead() const; |
86 int32_t CanWrite() const; | 86 int32_t CanWrite() const; |
87 int32_t CanCreate() const; | 87 int32_t CanCreate() const; |
88 int32_t CanReadWrite() const; | 88 int32_t CanReadWrite() const; |
89 | 89 |
90 private: | 90 private: |
91 int32_t OnMakeDirectory(ppapi::host::HostMessageContext* context, | 91 int32_t OnMakeDirectory(ppapi::host::HostMessageContext* context, |
92 bool make_ancestors); | 92 int32_t make_directory_flags); |
93 int32_t OnTouch(ppapi::host::HostMessageContext* context, | 93 int32_t OnTouch(ppapi::host::HostMessageContext* context, |
94 PP_Time last_access_time, | 94 PP_Time last_access_time, |
95 PP_Time last_modified_time); | 95 PP_Time last_modified_time); |
96 int32_t OnDelete(ppapi::host::HostMessageContext* context); | 96 int32_t OnDelete(ppapi::host::HostMessageContext* context); |
97 int32_t OnRename(ppapi::host::HostMessageContext* context, | 97 int32_t OnRename(ppapi::host::HostMessageContext* context, |
98 PP_Resource new_file_ref); | 98 PP_Resource new_file_ref); |
99 int32_t OnQuery(ppapi::host::HostMessageContext* context); | 99 int32_t OnQuery(ppapi::host::HostMessageContext* context); |
100 int32_t OnReadDirectoryEntries(ppapi::host::HostMessageContext* context); | 100 int32_t OnReadDirectoryEntries(ppapi::host::HostMessageContext* context); |
101 int32_t OnGetAbsolutePath(ppapi::host::HostMessageContext* context); | 101 int32_t OnGetAbsolutePath(ppapi::host::HostMessageContext* context); |
102 | 102 |
103 BrowserPpapiHost* host_; | 103 BrowserPpapiHost* host_; |
104 scoped_ptr<PepperFileRefBackend> backend_; | 104 scoped_ptr<PepperFileRefBackend> backend_; |
105 base::WeakPtr<PepperFileSystemBrowserHost> file_system_host_; | 105 base::WeakPtr<PepperFileSystemBrowserHost> file_system_host_; |
106 PP_FileSystemType fs_type_; | 106 PP_FileSystemType fs_type_; |
107 | 107 |
108 DISALLOW_COPY_AND_ASSIGN(PepperFileRefHost); | 108 DISALLOW_COPY_AND_ASSIGN(PepperFileRefHost); |
109 }; | 109 }; |
110 | 110 |
111 } // namespace content | 111 } // namespace content |
112 | 112 |
113 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ | 113 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ |
OLD | NEW |