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

Side by Side Diff: components/nacl/browser/nacl_process_host.h

Issue 552183004: NaCl: Use RAII for sockets in NaClProcessHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up namespace/#if nesting Created 6 years, 3 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
« no previous file with comments | « no previous file | components/nacl/browser/nacl_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ 5 #ifndef COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_
6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ 6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void OnProcessLaunchedByBroker(base::ProcessHandle handle); 100 void OnProcessLaunchedByBroker(base::ProcessHandle handle);
101 void OnDebugExceptionHandlerLaunchedByBroker(bool success); 101 void OnDebugExceptionHandlerLaunchedByBroker(bool success);
102 #endif 102 #endif
103 103
104 bool Send(IPC::Message* msg); 104 bool Send(IPC::Message* msg);
105 105
106 content::BrowserChildProcessHost* process() { return process_.get(); } 106 content::BrowserChildProcessHost* process() { return process_.get(); }
107 content::BrowserPpapiHost* browser_ppapi_host() { return ppapi_host_.get(); } 107 content::BrowserPpapiHost* browser_ppapi_host() { return ppapi_host_.get(); }
108 108
109 private: 109 private:
110 // Internal class that holds the NaClHandle objecs so that
111 // nacl_process_host.h doesn't include NaCl headers. Needed since it's
112 // included by src\content, which can't depend on the NaCl gyp file because it
113 // depends on chrome.gyp (circular dependency).
114 struct NaClInternal;
115
116 bool LaunchNaClGdb(); 110 bool LaunchNaClGdb();
117 111
118 // Mark the process as using a particular GDB debug stub port and notify 112 // Mark the process as using a particular GDB debug stub port and notify
119 // listeners (if the port is not kGdbDebugStubPortUnknown). 113 // listeners (if the port is not kGdbDebugStubPortUnknown).
120 void SetDebugStubPort(int port); 114 void SetDebugStubPort(int port);
121 115
122 #if defined(OS_POSIX) 116 #if defined(OS_POSIX)
123 // Create bound TCP socket in the browser process so that the NaCl GDB debug 117 // Create bound TCP socket in the browser process so that the NaCl GDB debug
124 // stub can use it to accept incoming connections even when the Chrome sandbox 118 // stub can use it to accept incoming connections even when the Chrome sandbox
125 // is enabled. 119 // is enabled.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 IPC::Message* reply_msg_; 211 IPC::Message* reply_msg_;
218 #if defined(OS_WIN) 212 #if defined(OS_WIN)
219 bool debug_exception_handler_requested_; 213 bool debug_exception_handler_requested_;
220 scoped_ptr<IPC::Message> attach_debug_exception_handler_reply_msg_; 214 scoped_ptr<IPC::Message> attach_debug_exception_handler_reply_msg_;
221 #endif 215 #endif
222 216
223 // The file path to the manifest is passed to nacl-gdb when it is used to 217 // The file path to the manifest is passed to nacl-gdb when it is used to
224 // debug the NaCl loader. 218 // debug the NaCl loader.
225 base::FilePath manifest_path_; 219 base::FilePath manifest_path_;
226 220
227 // Socket pairs for the NaCl process and renderer.
228 scoped_ptr<NaClInternal> internal_;
229
230 scoped_ptr<content::BrowserChildProcessHost> process_; 221 scoped_ptr<content::BrowserChildProcessHost> process_;
231 222
232 bool uses_irt_; 223 bool uses_irt_;
233 bool uses_nonsfi_mode_; 224 bool uses_nonsfi_mode_;
234 225
235 bool enable_debug_stub_; 226 bool enable_debug_stub_;
236 bool enable_dyncode_syscalls_; 227 bool enable_dyncode_syscalls_;
237 bool enable_exception_handling_; 228 bool enable_exception_handling_;
238 bool enable_crash_throttling_; 229 bool enable_crash_throttling_;
239 230
240 bool off_the_record_; 231 bool off_the_record_;
241 232
242 const base::FilePath profile_directory_; 233 const base::FilePath profile_directory_;
243 234
244 // Channel proxy to terminate the NaCl-Browser PPAPI channel. 235 // Channel proxy to terminate the NaCl-Browser PPAPI channel.
245 scoped_ptr<IPC::ChannelProxy> ipc_proxy_channel_; 236 scoped_ptr<IPC::ChannelProxy> ipc_proxy_channel_;
246 // Browser host for plugin process. 237 // Browser host for plugin process.
247 scoped_ptr<content::BrowserPpapiHost> ppapi_host_; 238 scoped_ptr<content::BrowserPpapiHost> ppapi_host_;
248 239
249 int render_view_id_; 240 int render_view_id_;
250 241
251 // Throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. 242 // Throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs.
252 static unsigned keepalive_throttle_interval_milliseconds_; 243 static unsigned keepalive_throttle_interval_milliseconds_;
253 244
254 // Shared memory provided to the plugin and renderer for 245 // Shared memory provided to the plugin and renderer for
255 // reporting crash information. 246 // reporting crash information.
256 base::SharedMemory crash_info_shmem_; 247 base::SharedMemory crash_info_shmem_;
257 248
249 base::File socket_for_renderer_;
250 base::File socket_for_sel_ldr_;
251
258 base::WeakPtrFactory<NaClProcessHost> weak_factory_; 252 base::WeakPtrFactory<NaClProcessHost> weak_factory_;
259 253
260 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); 254 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost);
261 }; 255 };
262 256
263 } // namespace nacl 257 } // namespace nacl
264 258
265 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ 259 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | components/nacl/browser/nacl_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698