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

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: Actually works now. Removes unnecessary logging. Created 7 years 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 peer_handle_ = delegate_->GetHandle();
267 }
268 if (!peer_handle_ && !base::OpenPrivilegedProcessHandle(peer_pid, &peer_handle _)) {
266 NOTREACHED(); 269 NOTREACHED();
267 } 270 }
268 opening_channel_ = false; 271 opening_channel_ = false;
269 delegate_->OnChannelConnected(peer_pid); 272 delegate_->OnChannelConnected(peer_pid);
270 for (size_t i = 0; i < filters_.size(); ++i) 273 for (size_t i = 0; i < filters_.size(); ++i)
271 filters_[i]->OnChannelConnected(peer_pid); 274 filters_[i]->OnChannelConnected(peer_pid);
272 } 275 }
273 276
274 void ChildProcessHostImpl::OnChannelError() { 277 void ChildProcessHostImpl::OnChannelError() {
275 opening_channel_ = false; 278 opening_channel_ = false;
(...skipping 11 matching lines...) Expand all
287 base::SharedMemoryHandle* handle) { 290 base::SharedMemoryHandle* handle) {
288 AllocateSharedMemory(buffer_size, peer_handle_, handle); 291 AllocateSharedMemory(buffer_size, peer_handle_, handle);
289 } 292 }
290 293
291 void ChildProcessHostImpl::OnShutdownRequest() { 294 void ChildProcessHostImpl::OnShutdownRequest() {
292 if (delegate_->CanShutdown()) 295 if (delegate_->CanShutdown())
293 Send(new ChildProcessMsg_Shutdown()); 296 Send(new ChildProcessMsg_Shutdown());
294 } 297 }
295 298
296 } // namespace content 299 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698