OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_PLUGINS_PPAPI_PPB_FILE_SYSTEM_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_SYSTEM_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_SYSTEM_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_SYSTEM_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "ppapi/c/pp_file_info.h" | 11 #include "ppapi/c/pp_file_info.h" |
| 12 #include "ppapi/shared_impl/resource.h" |
12 #include "ppapi/thunk/ppb_file_system_api.h" | 13 #include "ppapi/thunk/ppb_file_system_api.h" |
13 #include "webkit/plugins/ppapi/resource.h" | |
14 | 14 |
15 struct PPB_FileSystem; | 15 struct PPB_FileSystem; |
16 | 16 |
17 namespace webkit { | 17 namespace webkit { |
18 namespace ppapi { | 18 namespace ppapi { |
19 | 19 |
20 class PluginInstance; | 20 class PPB_FileSystem_Impl : public ::ppapi::Resource, |
21 | |
22 class PPB_FileSystem_Impl : public Resource, | |
23 public ::ppapi::thunk::PPB_FileSystem_API { | 21 public ::ppapi::thunk::PPB_FileSystem_API { |
24 public: | 22 public: |
25 PPB_FileSystem_Impl(PluginInstance* instance, PP_FileSystemType type); | |
26 virtual ~PPB_FileSystem_Impl(); | 23 virtual ~PPB_FileSystem_Impl(); |
27 | 24 |
28 static PP_Resource Create(PluginInstance* instance, | 25 static PP_Resource Create(PP_Instance instance, PP_FileSystemType type); |
29 PP_FileSystemType type); | |
30 | 26 |
31 // Resource overrides. | 27 // Resource overrides. |
32 virtual ::ppapi::thunk::PPB_FileSystem_API* AsPPB_FileSystem_API() OVERRIDE; | 28 virtual ::ppapi::thunk::PPB_FileSystem_API* AsPPB_FileSystem_API() OVERRIDE; |
33 | 29 |
34 PluginInstance* instance() { return instance_; } | |
35 PP_FileSystemType type() const { return type_; } | 30 PP_FileSystemType type() const { return type_; } |
36 const GURL& root_url() const { return root_url_; } | 31 const GURL& root_url() const { return root_url_; } |
37 void set_root_url(const GURL& root_url) { root_url_ = root_url; } | 32 void set_root_url(const GURL& root_url) { root_url_ = root_url; } |
38 bool opened() const { return opened_; } | 33 bool opened() const { return opened_; } |
39 void set_opened(bool opened) { opened_ = opened; } | 34 void set_opened(bool opened) { opened_ = opened; } |
40 | 35 |
41 // PPB_FileSystem_API implementation. | 36 // PPB_FileSystem_API implementation. |
42 virtual int32_t Open(int64_t expected_size, | 37 virtual int32_t Open(int64_t expected_size, |
43 PP_CompletionCallback callback) OVERRIDE; | 38 PP_CompletionCallback callback) OVERRIDE; |
44 virtual PP_FileSystemType GetType() OVERRIDE; | 39 virtual PP_FileSystemType GetType() OVERRIDE; |
45 | 40 |
46 private: | 41 private: |
47 PluginInstance* instance_; | 42 PPB_FileSystem_Impl(PP_Instance instance, PP_FileSystemType type); |
| 43 |
48 PP_FileSystemType type_; | 44 PP_FileSystemType type_; |
49 GURL root_url_; | 45 GURL root_url_; |
50 bool opened_; | 46 bool opened_; |
51 bool called_open_; | 47 bool called_open_; |
52 | 48 |
53 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Impl); | 49 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Impl); |
54 }; | 50 }; |
55 | 51 |
56 } // namespace ppapi | 52 } // namespace ppapi |
57 } // namespace webkit | 53 } // namespace webkit |
58 | 54 |
59 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_SYSTEM_IMPL_H_ | 55 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_SYSTEM_IMPL_H_ |
OLD | NEW |