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 PPAPI_SHARED_IMPL_FILE_REF_CREATE_INFO_H | 5 #ifndef PPAPI_SHARED_IMPL_FILE_REF_CREATE_INFO_H |
6 #define PPAPI_SHARED_IMPL_FILE_REF_CREATE_INFO_H | 6 #define PPAPI_SHARED_IMPL_FILE_REF_CREATE_INFO_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "ppapi/c/pp_file_info.h" | 11 #include "ppapi/c/pp_file_info.h" |
12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "ppapi/shared_impl/ppapi_shared_export.h" | |
13 | 14 |
14 namespace ppapi { | 15 namespace ppapi { |
15 | 16 |
16 // FileRefs are created in a number of places and they include a number of | 17 // FileRefs are created in a number of places and they include a number of |
17 // return values. This struct encapsulates everything in one place. | 18 // return values. This struct encapsulates everything in one place. |
18 struct FileRef_CreateInfo { | 19 struct FileRefCreateInfo { |
20 FileRefCreateInfo() : | |
21 file_system_type(PP_FILESYSTEMTYPE_INVALID), | |
yzshen1
2013/08/08 23:16:21
wrong indent.
teravest
2013/08/09 02:00:08
Done.
| |
22 pending_host_resource_id(0), | |
23 file_system_plugin_resource(0) { } | |
24 | |
25 PPAPI_SHARED_EXPORT bool IsValid() const; | |
yzshen1
2013/08/08 23:16:21
Out of curiosity: why putting PPAPI_SHARED_EXPORT
teravest
2013/08/09 02:00:08
I figured I'd put it minimally per-method; that wa
| |
26 | |
19 PP_FileSystemType file_system_type; | 27 PP_FileSystemType file_system_type; |
20 std::string internal_path; | 28 std::string internal_path; |
21 std::string display_name; | 29 std::string display_name; |
22 | 30 |
23 // Used when a FileRef is created in the Renderer. | 31 // Used when a FileRef is created in the Renderer. |
24 int pending_host_resource_id; | 32 int pending_host_resource_id; |
25 | 33 |
26 // Since FileRef needs to hold a FileSystem reference, we need to pass the | 34 // Since FileRef needs to hold a FileSystem reference, we need to pass the |
yzshen1
2013/08/08 23:16:21
Please comment on whether this struct holds 1 ref
teravest
2013/08/09 02:00:08
Done.
| |
27 // resource in this CreateInfo. | 35 // resource in this CreateInfo. |
28 PP_Resource file_system_plugin_resource; | 36 PP_Resource file_system_plugin_resource; |
29 }; | 37 }; |
30 | 38 |
39 // Used in the renderer when sending a FileRefCreateInfo to a plugin for a | |
40 // FileRef on an external filesystem. | |
41 PPAPI_SHARED_EXPORT FileRefCreateInfo | |
42 MakeExternalFileRefCreateInfo(const base::FilePath& external_path, | |
yzshen1
2013/08/08 23:16:21
Maybe it is better to make it a static function of
teravest
2013/08/09 02:00:08
What would the benefit be?
yzshen1
2013/08/09 17:11:23
(I don't think it is very important, though.)
The
| |
43 const std::string& display_name, | |
44 int pending_host_resource_id); | |
45 | |
31 } // namespace ppapi | 46 } // namespace ppapi |
32 | 47 |
33 #endif // PPAPI_SHARED_IMPL_FILE_REF_CREATE_INFO_H | 48 #endif // PPAPI_SHARED_IMPL_FILE_REF_CREATE_INFO_H |
OLD | NEW |