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

Side by Side Diff: content/browser/child_process_launcher.cc

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compile Created 5 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser/child_process_launcher.h" 5 #include "content/browser/child_process_launcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 11 matching lines...) Expand all
22 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
23 #include "content/public/common/result_codes.h" 23 #include "content/public/common/result_codes.h"
24 #include "content/public/common/sandboxed_process_launcher_delegate.h" 24 #include "content/public/common/sandboxed_process_launcher_delegate.h"
25 25
26 #if defined(OS_WIN) 26 #if defined(OS_WIN)
27 #include "base/files/file_path.h" 27 #include "base/files/file_path.h"
28 #include "content/common/sandbox_win.h" 28 #include "content/common/sandbox_win.h"
29 #include "content/public/common/sandbox_init.h" 29 #include "content/public/common/sandbox_init.h"
30 #elif defined(OS_MACOSX) 30 #elif defined(OS_MACOSX)
31 #include "content/browser/bootstrap_sandbox_manager_mac.h" 31 #include "content/browser/bootstrap_sandbox_manager_mac.h"
32 #include "content/browser/browser_io_surface_manager_mac.h"
33 #include "content/browser/mach_broker_mac.h" 32 #include "content/browser/mach_broker_mac.h"
34 #include "sandbox/mac/bootstrap_sandbox.h" 33 #include "sandbox/mac/bootstrap_sandbox.h"
35 #include "sandbox/mac/pre_exec_delegate.h" 34 #include "sandbox/mac/pre_exec_delegate.h"
36 #elif defined(OS_ANDROID) 35 #elif defined(OS_ANDROID)
37 #include "base/android/jni_android.h" 36 #include "base/android/jni_android.h"
38 #include "content/browser/android/child_process_launcher_android.h" 37 #include "content/browser/android/child_process_launcher_android.h"
39 #elif defined(OS_POSIX) 38 #elif defined(OS_POSIX)
40 #include "base/memory/singleton.h" 39 #include "base/memory/singleton.h"
41 #include "content/browser/renderer_host/render_sandbox_host_linux.h" 40 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
42 #include "content/browser/zygote_host/zygote_host_impl_linux.h" 41 #include "content/browser/zygote_host/zygote_host_impl_linux.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // inserted below. This ensures that while the child process may send its 234 // inserted below. This ensures that while the child process may send its
236 // port to the parent prior to the parent leaving LaunchProcess, the 235 // port to the parent prior to the parent leaving LaunchProcess, the
237 // order in which the record in MachBroker is updated is correct. 236 // order in which the record in MachBroker is updated is correct.
238 MachBroker* broker = MachBroker::GetInstance(); 237 MachBroker* broker = MachBroker::GetInstance();
239 broker->GetLock().Acquire(); 238 broker->GetLock().Acquire();
240 239
241 // Make sure the MachBroker is running, and inform it to expect a 240 // Make sure the MachBroker is running, and inform it to expect a
242 // check-in from the new process. 241 // check-in from the new process.
243 broker->EnsureRunning(); 242 broker->EnsureRunning();
244 243
245 // Make sure the IOSurfaceManager service is running.
246 BrowserIOSurfaceManager::GetInstance()->EnsureRunning();
247
248 const SandboxType sandbox_type = delegate->GetSandboxType(); 244 const SandboxType sandbox_type = delegate->GetSandboxType();
249 scoped_ptr<sandbox::PreExecDelegate> pre_exec_delegate; 245 scoped_ptr<sandbox::PreExecDelegate> pre_exec_delegate;
250 if (BootstrapSandboxManager::ShouldEnable()) { 246 if (BootstrapSandboxManager::ShouldEnable()) {
251 BootstrapSandboxManager* sandbox_manager = 247 BootstrapSandboxManager* sandbox_manager =
252 BootstrapSandboxManager::GetInstance(); 248 BootstrapSandboxManager::GetInstance();
253 if (sandbox_manager->EnabledForSandbox(sandbox_type)) { 249 if (sandbox_manager->EnabledForSandbox(sandbox_type)) {
254 pre_exec_delegate = 250 pre_exec_delegate =
255 sandbox_manager->sandbox()->NewClient(sandbox_type).Pass(); 251 sandbox_manager->sandbox()->NewClient(sandbox_type).Pass();
256 } 252 }
257 } 253 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 520 }
525 521
526 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( 522 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest(
527 Client* client) { 523 Client* client) {
528 Client* ret = client_; 524 Client* ret = client_;
529 client_ = client; 525 client_ = client;
530 return ret; 526 return ret;
531 } 527 }
532 528
533 } // namespace content 529 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698