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_SYSTEM_BROWSER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_SYSTEM_BROWSER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_SYSTEM_BROWSER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_SYSTEM_BROWSER_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Supports FileIOs direct access on the host side. | 58 // Supports FileIOs direct access on the host side. |
59 // Non-NULL only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. | 59 // Non-NULL only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. |
60 fileapi::FileSystemOperationRunner* GetFileSystemOperationRunner() const { | 60 fileapi::FileSystemOperationRunner* GetFileSystemOperationRunner() const { |
61 return file_system_operation_runner_.get(); | 61 return file_system_operation_runner_.get(); |
62 } | 62 } |
63 | 63 |
64 private: | 64 private: |
65 friend class PepperFileSystemBrowserHostTest; | 65 friend class PepperFileSystemBrowserHostTest; |
66 | 66 |
67 void OpenExistingWithContext( | 67 void OpenExistingFileSystem( |
68 const base::Closure& callback, | 68 const base::Closure& callback); |
69 scoped_refptr<fileapi::FileSystemContext> file_system_context); | 69 void OpenFileSystem( |
70 void GotFileSystemContext( | |
71 ppapi::host::ReplyMessageContext reply_context, | 70 ppapi::host::ReplyMessageContext reply_context, |
72 fileapi::FileSystemType file_system_type, | 71 fileapi::FileSystemType file_system_type); |
73 scoped_refptr<fileapi::FileSystemContext> file_system_context); | |
74 void OpenFileSystemComplete( | 72 void OpenFileSystemComplete( |
75 ppapi::host::ReplyMessageContext reply_context, | 73 ppapi::host::ReplyMessageContext reply_context, |
76 const GURL& root, | 74 const GURL& root, |
77 const std::string& name, | 75 const std::string& name, |
78 base::PlatformFileError error); | 76 base::PlatformFileError error); |
79 void GotIsolatedFileSystemContext( | 77 void OpenIsolatedFileSystem( |
80 ppapi::host::ReplyMessageContext reply_context, | 78 ppapi::host::ReplyMessageContext reply_context, |
81 const std::string& fsid, | 79 const std::string& fsid, |
82 PP_IsolatedFileSystemType_Private type, | 80 PP_IsolatedFileSystemType_Private type); |
83 scoped_refptr<fileapi::FileSystemContext> file_system_context); | |
84 void OpenPluginPrivateFileSystem( | 81 void OpenPluginPrivateFileSystem( |
85 ppapi::host::ReplyMessageContext reply_context, | 82 ppapi::host::ReplyMessageContext reply_context, |
86 const std::string& fsid, | 83 const std::string& fsid); |
87 scoped_refptr<fileapi::FileSystemContext> file_system_context); | |
88 void OpenPluginPrivateFileSystemComplete( | 84 void OpenPluginPrivateFileSystemComplete( |
89 ppapi::host::ReplyMessageContext reply_context, | 85 ppapi::host::ReplyMessageContext reply_context, |
90 const std::string& fsid, | 86 const std::string& fsid, |
91 base::PlatformFileError error); | 87 base::PlatformFileError error); |
92 | 88 |
93 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, | 89 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, |
94 int64_t expected_size); | 90 int64_t expected_size); |
95 int32_t OnHostMsgInitIsolatedFileSystem( | 91 int32_t OnHostMsgInitIsolatedFileSystem( |
96 ppapi::host::HostMessageContext* context, | 92 ppapi::host::HostMessageContext* context, |
97 const std::string& fsid, | 93 const std::string& fsid, |
98 PP_IsolatedFileSystemType_Private type); | 94 PP_IsolatedFileSystemType_Private type); |
99 | 95 |
100 void SendReplyForIsolatedFileSystem( | 96 void SendReplyForIsolatedFileSystem( |
101 ppapi::host::ReplyMessageContext reply_context, | 97 ppapi::host::ReplyMessageContext reply_context, |
102 const std::string& fsid, | 98 const std::string& fsid, |
103 int32_t error); | 99 int32_t error); |
104 | 100 |
105 void SetFileSystemContext( | 101 void GotFileSystemContext( |
| 102 const base::Closure& closure, |
106 scoped_refptr<fileapi::FileSystemContext> file_system_context); | 103 scoped_refptr<fileapi::FileSystemContext> file_system_context); |
107 | 104 |
108 std::string GetPluginMimeType() const; | 105 std::string GetPluginMimeType() const; |
109 | 106 |
110 // Returns plugin ID generated from plugin's MIME type. | 107 // Returns plugin ID generated from plugin's MIME type. |
111 std::string GeneratePluginId(const std::string& mime_type) const; | 108 std::string GeneratePluginId(const std::string& mime_type) const; |
112 | 109 |
113 BrowserPpapiHost* browser_ppapi_host_; | 110 BrowserPpapiHost* browser_ppapi_host_; |
114 | 111 |
115 PP_FileSystemType type_; | 112 PP_FileSystemType type_; |
116 bool called_open_; // whether open has been called. | 113 bool called_open_; // whether open has been called. |
117 bool opened_; // whether open has succeeded. | 114 bool opened_; // whether open has succeeded. |
118 GURL root_url_; | 115 GURL root_url_; |
119 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 116 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
120 | 117 |
121 scoped_ptr<fileapi::FileSystemOperationRunner> file_system_operation_runner_; | 118 scoped_ptr<fileapi::FileSystemOperationRunner> file_system_operation_runner_; |
122 | 119 |
123 std::string fsid_; // used only for isolated filesystems. | 120 std::string fsid_; // used only for isolated filesystems. |
124 | 121 |
125 base::WeakPtrFactory<PepperFileSystemBrowserHost> weak_factory_; | 122 base::WeakPtrFactory<PepperFileSystemBrowserHost> weak_factory_; |
126 | 123 |
127 DISALLOW_COPY_AND_ASSIGN(PepperFileSystemBrowserHost); | 124 DISALLOW_COPY_AND_ASSIGN(PepperFileSystemBrowserHost); |
128 }; | 125 }; |
129 | 126 |
130 } // namespace content | 127 } // namespace content |
131 | 128 |
132 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_SYSTEM_BROWSER_HOST_
H_ | 129 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FILE_SYSTEM_BROWSER_HOST_
H_ |
OLD | NEW |