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

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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 kNativeNaClProcessType, 51 kNativeNaClProcessType,
52 // Runs user-provided code that is translated from *bitcode* by an 52 // Runs user-provided code that is translated from *bitcode* by an
53 // in-browser PNaCl translator. 53 // in-browser PNaCl translator.
54 kPNaClProcessType, 54 kPNaClProcessType,
55 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided 55 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided
56 // (not user-provided). 56 // (not user-provided).
57 kPNaClTranslatorProcessType, 57 kPNaClTranslatorProcessType,
58 kNumNaClProcessTypes 58 kNumNaClProcessTypes
59 }; 59 };
60 60
61 // Request to prefetch a resource file.
Mark Seaborn 2015/04/24 00:53:24 Please make the comment match up with NaClResource
hidehiko 2015/04/24 10:05:17 Done.
62 struct NaClResourcePrefetchRequest {
63 NaClResourcePrefetchRequest();
Mark Seaborn 2015/04/24 00:53:25 Not used? Avoiding defining a default ctor would
hidehiko 2015/04/24 10:05:17 Used by IPC framework.
64 NaClResourcePrefetchRequest(const std::string& file_key,
65 const std::string& resource_url);
66 ~NaClResourcePrefetchRequest();
67
68 std::string file_key;
Mark Seaborn 2015/04/24 00:53:24 Add comment "// a key for open_resource" to match
hidehiko 2015/04/24 10:05:17 Done.
69 std::string resource_url;
70 };
71
61 // Represents a single prefetched file that's listed in the "files" section of 72 // Represents a single prefetched file that's listed in the "files" section of
62 // a NaCl manifest file. 73 // a NaCl manifest file.
63 struct NaClResourceFileInfo { 74 struct NaClResourcePrefetchResult {
64 NaClResourceFileInfo(); 75 NaClResourcePrefetchResult();
Mark Seaborn 2015/04/24 00:53:24 Is this default ctor unused now?
hidehiko 2015/04/24 10:05:18 Acknowledged.
65 NaClResourceFileInfo(IPC::PlatformFileForTransit file, 76 NaClResourcePrefetchResult(IPC::PlatformFileForTransit file,
66 const base::FilePath& file_path, 77 const base::FilePath& file_path,
67 const std::string& file_key); 78 const std::string& file_key);
68 ~NaClResourceFileInfo(); 79 ~NaClResourcePrefetchResult();
69 80
70 IPC::PlatformFileForTransit file; 81 IPC::PlatformFileForTransit file;
71 base::FilePath file_path_metadata; // a key for validation caching 82 base::FilePath file_path_metadata; // a key for validation caching
72 std::string file_key; // a key for open_resource 83 std::string file_key; // a key for open_resource
73 }; 84 };
74 85
75 // Parameters sent to the NaCl process when we start it. 86 // Parameters sent to the NaCl process when we start it.
76 struct NaClStartParams { 87 struct NaClStartParams {
77 NaClStartParams(); 88 NaClStartParams();
78 ~NaClStartParams(); 89 ~NaClStartParams();
79 90
80 IPC::PlatformFileForTransit nexe_file; 91 IPC::PlatformFileForTransit nexe_file;
81 // Used only as a key for validation caching. 92 // Used only as a key for validation caching.
82 base::FilePath nexe_file_path_metadata; 93 base::FilePath nexe_file_path_metadata;
83 94
84 std::vector<NaClResourceFileInfo> prefetched_resource_files; 95 std::vector<NaClResourcePrefetchResult> prefetched_resource_files;
85 std::vector<FileDescriptor> handles; 96 IPC::PlatformFileForTransit imc_bootstrap_handle;
86 FileDescriptor debug_stub_server_bound_socket; 97 IPC::PlatformFileForTransit irt_handle;
98 IPC::PlatformFileForTransit mac_shm_fd;
Mark Seaborn 2015/04/24 00:53:24 Can you comment that this is only used on Mac OS X
hidehiko 2015/04/24 10:05:17 Done.
99 IPC::PlatformFileForTransit debug_stub_server_bound_socket;
87 100
88 bool validation_cache_enabled; 101 bool validation_cache_enabled;
89 std::string validation_cache_key; 102 std::string validation_cache_key;
90 // Chrome version string. Sending the version string over IPC avoids linkage 103 // Chrome version string. Sending the version string over IPC avoids linkage
91 // issues in cases where NaCl is not compiled into the main Chromium 104 // issues in cases where NaCl is not compiled into the main Chromium
92 // executable or DLL. 105 // executable or DLL.
93 std::string version; 106 std::string version;
94 107
95 bool enable_debug_stub; 108 bool enable_debug_stub;
96 bool enable_ipc_proxy; 109 bool enable_ipc_proxy;
(...skipping 15 matching lines...) Expand all
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.
123 const std::vector< 135 const std::vector<
124 std::pair<std::string, std::string> >& resource_files_to_prefetch, 136 NaClResourcePrefetchRequest>& resource_prefetch_request_list,
125 int render_view_id, 137 int render_view_id,
126 uint32 permission_bits, 138 uint32 permission_bits,
127 bool uses_nonsfi_mode, 139 bool uses_nonsfi_mode,
128 NaClAppProcessType process_type); 140 NaClAppProcessType process_type);
129 ~NaClLaunchParams(); 141 ~NaClLaunchParams();
130 142
131 std::string manifest_url; 143 std::string manifest_url;
132 // On Windows, the HANDLE passed here is valid in the renderer's context. 144 // 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 145 // It's the responsibility of the browser to duplicate this handle properly
134 // for passing it to the plugin. 146 // for passing it to the plugin.
135 IPC::PlatformFileForTransit nexe_file; 147 IPC::PlatformFileForTransit nexe_file;
136 uint64_t nexe_token_lo; 148 uint64_t nexe_token_lo;
137 uint64_t nexe_token_hi; 149 uint64_t nexe_token_hi;
138 std::vector<std::pair<std::string, std::string> > resource_files_to_prefetch; 150 std::vector<NaClResourcePrefetchRequest> resource_prefetch_request_list;
139 151
140 int render_view_id; 152 int render_view_id;
141 uint32 permission_bits; 153 uint32 permission_bits;
142 bool uses_nonsfi_mode; 154 bool uses_nonsfi_mode;
143 155
144 NaClAppProcessType process_type; 156 NaClAppProcessType process_type;
145 }; 157 };
146 158
147 struct NaClLaunchResult { 159 struct NaClLaunchResult {
148 NaClLaunchResult(); 160 NaClLaunchResult();
(...skipping 23 matching lines...) Expand all
172 base::ProcessId plugin_pid; 184 base::ProcessId plugin_pid;
173 int plugin_child_id; 185 int plugin_child_id;
174 186
175 // For NaCl <-> renderer crash information reporting. 187 // For NaCl <-> renderer crash information reporting.
176 base::SharedMemoryHandle crash_info_shmem_handle; 188 base::SharedMemoryHandle crash_info_shmem_handle;
177 }; 189 };
178 190
179 } // namespace nacl 191 } // namespace nacl
180 192
181 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 193 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698