OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
15 #include "content/public/renderer/renderer_ppapi_host.h" | 15 #include "content/public/renderer/renderer_ppapi_host.h" |
16 #include "ppapi/host/host_message_context.h" | 16 #include "ppapi/host/host_message_context.h" |
17 #include "ppapi/host/resource_host.h" | 17 #include "ppapi/host/resource_host.h" |
18 #include "ppapi/shared_impl/file_io_state_manager.h" | 18 #include "ppapi/shared_impl/file_io_state_manager.h" |
19 #include "ppapi/thunk/ppb_file_ref_api.h" | 19 #include "ppapi/thunk/ppb_file_ref_api.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 #include "webkit/common/quota/quota_types.h" | 21 #include "webkit/common/quota/quota_types.h" |
22 | 22 |
23 using ppapi::host::ReplyMessageContext; | 23 using ppapi::host::ReplyMessageContext; |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class PluginDelegate; | |
27 class QuotaFileIO; | 26 class QuotaFileIO; |
28 | 27 |
29 class PepperFileIOHost : public ppapi::host::ResourceHost, | 28 class PepperFileIOHost : public ppapi::host::ResourceHost, |
30 public base::SupportsWeakPtr<PepperFileIOHost> { | 29 public base::SupportsWeakPtr<PepperFileIOHost> { |
31 public: | 30 public: |
32 typedef base::Callback<void (base::PlatformFileError)> | 31 typedef base::Callback<void (base::PlatformFileError)> |
33 NotifyCloseFileCallback; | 32 NotifyCloseFileCallback; |
34 | 33 |
35 PepperFileIOHost(RendererPpapiHost* host, | 34 PepperFileIOHost(RendererPpapiHost* host, |
36 PP_Instance instance, | 35 PP_Instance instance, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void ExecutePlatformQueryCallback(ReplyMessageContext reply_context, | 89 void ExecutePlatformQueryCallback(ReplyMessageContext reply_context, |
91 base::PlatformFileError error_code, | 90 base::PlatformFileError error_code, |
92 const base::PlatformFileInfo& file_info); | 91 const base::PlatformFileInfo& file_info); |
93 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, | 92 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, |
94 base::PlatformFileError error_code, | 93 base::PlatformFileError error_code, |
95 const char* data, int bytes_read); | 94 const char* data, int bytes_read); |
96 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, | 95 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, |
97 base::PlatformFileError error_code, | 96 base::PlatformFileError error_code, |
98 int bytes_written); | 97 int bytes_written); |
99 | 98 |
100 // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. | |
101 PluginDelegate* plugin_delegate_; // Not owned. | |
102 | |
103 base::PlatformFile file_; | 99 base::PlatformFile file_; |
104 | 100 |
105 // The file system type specified in the Open() call. This will be | 101 // The file system type specified in the Open() call. This will be |
106 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not | 102 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not |
107 // indicate that the open command actually succeeded. | 103 // indicate that the open command actually succeeded. |
108 PP_FileSystemType file_system_type_; | 104 PP_FileSystemType file_system_type_; |
109 | 105 |
110 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. | 106 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. |
111 GURL file_system_url_; | 107 GURL file_system_url_; |
112 | 108 |
(...skipping 14 matching lines...) Expand all Loading... |
127 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; | 123 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; |
128 | 124 |
129 ppapi::FileIOStateManager state_manager_; | 125 ppapi::FileIOStateManager state_manager_; |
130 | 126 |
131 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); | 127 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); |
132 }; | 128 }; |
133 | 129 |
134 } // namespace content | 130 } // namespace content |
135 | 131 |
136 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 132 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
OLD | NEW |