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

Side by Side Diff: content/common/child_process_host_impl.cc

Issue 98603007: Launches a privileged utility process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mostly test cleanup. Created 6 years, 11 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 (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 #include "content/common/child_process_host_impl.h" 5 #include "content/common/child_process_host_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 255 }
256 256
257 #ifdef IPC_MESSAGE_LOG_ENABLED 257 #ifdef IPC_MESSAGE_LOG_ENABLED
258 if (logger->Enabled()) 258 if (logger->Enabled())
259 logger->OnPostDispatchMessage(msg, channel_id_); 259 logger->OnPostDispatchMessage(msg, channel_id_);
260 #endif 260 #endif
261 return handled; 261 return handled;
262 } 262 }
263 263
264 void ChildProcessHostImpl::OnChannelConnected(int32 peer_pid) { 264 void ChildProcessHostImpl::OnChannelConnected(int32 peer_pid) {
265 if (!base::OpenPrivilegedProcessHandle(peer_pid, &peer_handle_)) { 265 if (!peer_handle_ &&
266 !base::OpenPrivilegedProcessHandle(peer_pid, &peer_handle_) &&
267 !(peer_handle_ = delegate_->GetHandle())) {
mef 2014/01/10 18:22:55 What if user has cancelled the UAC, wouldn't deleg
Drew Haven 2014/01/16 02:52:05 If the user didn't accept the UAC prompt then the
266 NOTREACHED(); 268 NOTREACHED();
267 } 269 }
268 opening_channel_ = false; 270 opening_channel_ = false;
269 delegate_->OnChannelConnected(peer_pid); 271 delegate_->OnChannelConnected(peer_pid);
270 for (size_t i = 0; i < filters_.size(); ++i) 272 for (size_t i = 0; i < filters_.size(); ++i)
271 filters_[i]->OnChannelConnected(peer_pid); 273 filters_[i]->OnChannelConnected(peer_pid);
272 } 274 }
273 275
274 void ChildProcessHostImpl::OnChannelError() { 276 void ChildProcessHostImpl::OnChannelError() {
275 opening_channel_ = false; 277 opening_channel_ = false;
(...skipping 11 matching lines...) Expand all
287 base::SharedMemoryHandle* handle) { 289 base::SharedMemoryHandle* handle) {
288 AllocateSharedMemory(buffer_size, peer_handle_, handle); 290 AllocateSharedMemory(buffer_size, peer_handle_, handle);
289 } 291 }
290 292
291 void ChildProcessHostImpl::OnShutdownRequest() { 293 void ChildProcessHostImpl::OnShutdownRequest() {
292 if (delegate_->CanShutdown()) 294 if (delegate_->CanShutdown())
293 Send(new ChildProcessMsg_Shutdown()); 295 Send(new ChildProcessMsg_Shutdown());
294 } 296 }
295 297
296 } // namespace content 298 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698