Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: components/nacl/common/nacl_types.h

Issue 1085583005: Refactor params of NaClProcessMsg_Start. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 5 #ifndef COMPONENTS_NACL_COMMON_NACL_TYPES_H_
6 #define COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 6 #define COMPONENTS_NACL_COMMON_NACL_TYPES_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Parameters sent to the NaCl process when we start it. 75 // Parameters sent to the NaCl process when we start it.
76 struct NaClStartParams { 76 struct NaClStartParams {
77 NaClStartParams(); 77 NaClStartParams();
78 ~NaClStartParams(); 78 ~NaClStartParams();
79 79
80 IPC::PlatformFileForTransit nexe_file; 80 IPC::PlatformFileForTransit nexe_file;
81 // Used only as a key for validation caching. 81 // Used only as a key for validation caching.
82 base::FilePath nexe_file_path_metadata; 82 base::FilePath nexe_file_path_metadata;
83 83
84 std::vector<NaClResourceFileInfo> prefetched_resource_files; 84 std::vector<NaClResourceFileInfo> prefetched_resource_files;
85 std::vector<FileDescriptor> handles; 85 IPC::PlatformFileForTransit imc_bootstrap_handle;
Mark Seaborn 2015/04/23 00:10:11 Splitting up 'handles' seems reasonable but the re
hidehiko 2015/04/23 11:51:29 For cleaner handle check in nacl_listener.cc. Upda
86 FileDescriptor debug_stub_server_bound_socket; 86 IPC::PlatformFileForTransit irt_handle;
87 IPC::PlatformFileForTransit mac_shm_fd;
Mark Seaborn 2015/04/23 00:10:11 If I understand this correctly, there's a subtle b
hidehiko 2015/04/23 11:51:29 Ah, right. Fixed (including existing debug_stub_se
88 IPC::PlatformFileForTransit debug_stub_server_bound_socket;
87 89
88 bool validation_cache_enabled; 90 bool validation_cache_enabled;
89 std::string validation_cache_key; 91 std::string validation_cache_key;
90 // Chrome version string. Sending the version string over IPC avoids linkage 92 // Chrome version string. Sending the version string over IPC avoids linkage
91 // issues in cases where NaCl is not compiled into the main Chromium 93 // issues in cases where NaCl is not compiled into the main Chromium
92 // executable or DLL. 94 // executable or DLL.
93 std::string version; 95 std::string version;
94 96
95 bool enable_debug_stub; 97 bool enable_debug_stub;
96 bool enable_ipc_proxy; 98 bool enable_ipc_proxy;
97 99
98 // Enables plugin code to use Mojo APIs. See mojo/nacl for details. 100 // Enables plugin code to use Mojo APIs. See mojo/nacl for details.
99 bool enable_mojo; 101 bool enable_mojo;
100 102
101 NaClAppProcessType process_type; 103 NaClAppProcessType process_type;
102 104
103 // For NaCl <-> renderer crash information reporting. 105 // For NaCl <-> renderer crash information reporting.
104 base::SharedMemoryHandle crash_info_shmem_handle; 106 base::SharedMemoryHandle crash_info_shmem_handle;
105 107
106 // NOTE: Any new fields added here must also be added to the IPC 108 // NOTE: Any new fields added here must also be added to the IPC
107 // serialization in nacl_messages.h and (for POD fields) the constructor 109 // serialization in nacl_messages.h and (for POD fields) the constructor
108 // in nacl_types.cc. 110 // in nacl_types.cc.
109 }; 111 };
110 112
113 // Metadata to prefetch a resource file.
Mark Seaborn 2015/04/23 00:10:10 Similarly, using a struct with names fields instea
hidehiko 2015/04/23 11:51:29 Bonus, but I was unhappy to distribute std::vector
114 struct NaClResourcePrefetchInfo {
Mark Seaborn 2015/04/23 00:10:11 How about putting this next to NaClResourceFileInf
hidehiko 2015/04/23 11:51:29 Done.
115 NaClResourcePrefetchInfo();
116 NaClResourcePrefetchInfo(const std::string& manifest_key,
117 const std::string& resource_url);
118 ~NaClResourcePrefetchInfo();
119
120 std::string manifest_key;
Mark Seaborn 2015/04/23 00:10:11 In NaClResourceFileInfo, this is called "file_key"
hidehiko 2015/04/23 11:51:29 Done.
121 std::string resource_url;
122 };
123
111 // Parameters sent to the browser process to have it launch a NaCl process. 124 // Parameters sent to the browser process to have it launch a NaCl process.
112 // 125 //
113 // If you change this, you will also need to update the IPC serialization in 126 // If you change this, you will also need to update the IPC serialization in
114 // nacl_host_messages.h. 127 // nacl_host_messages.h.
115 struct NaClLaunchParams { 128 struct NaClLaunchParams {
116 NaClLaunchParams(); 129 NaClLaunchParams();
117 NaClLaunchParams( 130 NaClLaunchParams(
118 const std::string& manifest_url, 131 const std::string& manifest_url,
119 const IPC::PlatformFileForTransit& nexe_file, 132 const IPC::PlatformFileForTransit& nexe_file,
120 uint64_t nexe_token_lo, 133 uint64_t nexe_token_lo,
121 uint64_t nexe_token_hi, 134 uint64_t nexe_token_hi,
122 // A pair of a manifest key and its resource URL. 135 const std::vector<NaClResourcePrefetchInfo>& resource_prefetch_info_list,
Mark Seaborn 2015/04/23 00:10:11 Hmm, "files_to_prefetch" seems more descriptive to
hidehiko 2015/04/23 11:51:29 Renamed to resource_prefetch_request_list. Note th
Mark Seaborn 2015/04/24 00:53:24 That reason seems a bit pedantic to me. Files are
123 const std::vector<
124 std::pair<std::string, std::string> >& resource_files_to_prefetch,
125 int render_view_id, 136 int render_view_id,
126 uint32 permission_bits, 137 uint32 permission_bits,
127 bool uses_nonsfi_mode, 138 bool uses_nonsfi_mode,
128 NaClAppProcessType process_type); 139 NaClAppProcessType process_type);
129 ~NaClLaunchParams(); 140 ~NaClLaunchParams();
130 141
131 std::string manifest_url; 142 std::string manifest_url;
132 // On Windows, the HANDLE passed here is valid in the renderer's context. 143 // On Windows, the HANDLE passed here is valid in the renderer's context.
133 // It's the responsibility of the browser to duplicate this handle properly 144 // It's the responsibility of the browser to duplicate this handle properly
134 // for passing it to the plugin. 145 // for passing it to the plugin.
135 IPC::PlatformFileForTransit nexe_file; 146 IPC::PlatformFileForTransit nexe_file;
136 uint64_t nexe_token_lo; 147 uint64_t nexe_token_lo;
137 uint64_t nexe_token_hi; 148 uint64_t nexe_token_hi;
138 std::vector<std::pair<std::string, std::string> > resource_files_to_prefetch; 149 std::vector<NaClResourcePrefetchInfo> resource_prefetch_info_list;
139 150
140 int render_view_id; 151 int render_view_id;
141 uint32 permission_bits; 152 uint32 permission_bits;
142 bool uses_nonsfi_mode; 153 bool uses_nonsfi_mode;
143 154
144 NaClAppProcessType process_type; 155 NaClAppProcessType process_type;
145 }; 156 };
146 157
147 struct NaClLaunchResult { 158 struct NaClLaunchResult {
148 NaClLaunchResult(); 159 NaClLaunchResult();
(...skipping 23 matching lines...) Expand all
172 base::ProcessId plugin_pid; 183 base::ProcessId plugin_pid;
173 int plugin_child_id; 184 int plugin_child_id;
174 185
175 // For NaCl <-> renderer crash information reporting. 186 // For NaCl <-> renderer crash information reporting.
176 base::SharedMemoryHandle crash_info_shmem_handle; 187 base::SharedMemoryHandle crash_info_shmem_handle;
177 }; 188 };
178 189
179 } // namespace nacl 190 } // namespace nacl
180 191
181 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 192 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698