| 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 24 matching lines...) Expand all Loading... |
| 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( |
| 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; | |
| 46 virtual base::FilePath GetExternalPath() const = 0; | |
| 47 | 45 |
| 48 // Returns an error from the pp_errors.h enum. | 46 // Returns an error from the pp_errors.h enum. |
| 49 virtual int32_t CanRead() const = 0; | 47 virtual int32_t CanRead() const = 0; |
| 50 virtual int32_t CanWrite() const = 0; | 48 virtual int32_t CanWrite() const = 0; |
| 51 virtual int32_t CanCreate() const = 0; | 49 virtual int32_t CanCreate() const = 0; |
| 52 virtual int32_t CanReadWrite() const = 0; | 50 virtual int32_t CanReadWrite() const = 0; |
| 53 }; | 51 }; |
| 54 | 52 |
| 55 class CONTENT_EXPORT PepperFileRefHost | 53 class CONTENT_EXPORT PepperFileRefHost |
| 56 : public ppapi::host::ResourceHost, | 54 : public ppapi::host::ResourceHost, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 72 // ResourceHost overrides. | 70 // ResourceHost overrides. |
| 73 virtual int32_t OnResourceMessageReceived( | 71 virtual int32_t OnResourceMessageReceived( |
| 74 const IPC::Message& msg, | 72 const IPC::Message& msg, |
| 75 ppapi::host::HostMessageContext* context) OVERRIDE; | 73 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 76 virtual bool IsFileRefHost() OVERRIDE; | 74 virtual bool IsFileRefHost() OVERRIDE; |
| 77 | 75 |
| 78 // Required to support Rename(). | 76 // Required to support Rename(). |
| 79 PP_FileSystemType GetFileSystemType() const; | 77 PP_FileSystemType GetFileSystemType() const; |
| 80 fileapi::FileSystemURL GetFileSystemURL() const; | 78 fileapi::FileSystemURL GetFileSystemURL() const; |
| 81 | 79 |
| 82 // Required to support FileIO. | |
| 83 std::string GetFileSystemURLSpec() const; | |
| 84 base::FilePath GetExternalPath() const; | |
| 85 | |
| 86 int32_t CanRead() const; | 80 int32_t CanRead() const; |
| 87 int32_t CanWrite() const; | 81 int32_t CanWrite() const; |
| 88 int32_t CanCreate() const; | 82 int32_t CanCreate() const; |
| 89 int32_t CanReadWrite() const; | 83 int32_t CanReadWrite() const; |
| 90 | 84 |
| 91 private: | 85 private: |
| 92 int32_t OnMakeDirectory(ppapi::host::HostMessageContext* context, | 86 int32_t OnMakeDirectory(ppapi::host::HostMessageContext* context, |
| 93 bool make_ancestors); | 87 bool make_ancestors); |
| 94 int32_t OnTouch(ppapi::host::HostMessageContext* context, | 88 int32_t OnTouch(ppapi::host::HostMessageContext* context, |
| 95 PP_Time last_access_time, | 89 PP_Time last_access_time, |
| 96 PP_Time last_modified_time); | 90 PP_Time last_modified_time); |
| 97 int32_t OnDelete(ppapi::host::HostMessageContext* context); | 91 int32_t OnDelete(ppapi::host::HostMessageContext* context); |
| 98 int32_t OnRename(ppapi::host::HostMessageContext* context, | 92 int32_t OnRename(ppapi::host::HostMessageContext* context, |
| 99 PP_Resource new_file_ref); | 93 PP_Resource new_file_ref); |
| 100 int32_t OnQuery(ppapi::host::HostMessageContext* context); | 94 int32_t OnQuery(ppapi::host::HostMessageContext* context); |
| 101 int32_t OnReadDirectoryEntries(ppapi::host::HostMessageContext* context); | 95 int32_t OnReadDirectoryEntries(ppapi::host::HostMessageContext* context); |
| 102 int32_t OnGetAbsolutePath(ppapi::host::HostMessageContext* context); | 96 int32_t OnGetAbsolutePath(ppapi::host::HostMessageContext* context); |
| 103 | 97 |
| 104 BrowserPpapiHost* host_; | 98 BrowserPpapiHost* host_; |
| 105 scoped_ptr<PepperFileRefBackend> backend_; | 99 scoped_ptr<PepperFileRefBackend> backend_; |
| 106 PP_FileSystemType fs_type_; | 100 PP_FileSystemType fs_type_; |
| 107 | 101 |
| 108 DISALLOW_COPY_AND_ASSIGN(PepperFileRefHost); | 102 DISALLOW_COPY_AND_ASSIGN(PepperFileRefHost); |
| 109 }; | 103 }; |
| 110 | 104 |
| 111 } // namespace content | 105 } // namespace content |
| 112 | 106 |
| 113 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ | 107 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_REF_HOST_H_ |
| OLD | NEW |