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

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

Issue 1346923006: Refactor the bootstrap sandbox process launching integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RevokeToken Created 5 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 | « base/process/launch_posix.cc ('k') | content/browser/child_process_launcher.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bootstrap_sandbox_mac.h" 5 #include "content/browser/bootstrap_sandbox_mac.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 scoped_ptr<sandbox::BootstrapSandbox> sandbox_; 45 scoped_ptr<sandbox::BootstrapSandbox> sandbox_;
46 }; 46 };
47 47
48 BootstrapSandboxPolicy* BootstrapSandboxPolicy::GetInstance() { 48 BootstrapSandboxPolicy* BootstrapSandboxPolicy::GetInstance() {
49 return base::Singleton<BootstrapSandboxPolicy>::get(); 49 return base::Singleton<BootstrapSandboxPolicy>::get();
50 } 50 }
51 51
52 void BootstrapSandboxPolicy::BrowserChildProcessHostDisconnected( 52 void BootstrapSandboxPolicy::BrowserChildProcessHostDisconnected(
53 const ChildProcessData& data) { 53 const ChildProcessData& data) {
54 sandbox()->ChildDied(data.handle); 54 sandbox()->InvalidateClient(data.handle);
55 } 55 }
56 56
57 void BootstrapSandboxPolicy::BrowserChildProcessCrashed( 57 void BootstrapSandboxPolicy::BrowserChildProcessCrashed(
58 const ChildProcessData& data, 58 const ChildProcessData& data,
59 int exit_code) { 59 int exit_code) {
60 sandbox()->ChildDied(data.handle); 60 sandbox()->InvalidateClient(data.handle);
61 } 61 }
62 62
63 BootstrapSandboxPolicy::BootstrapSandboxPolicy() 63 BootstrapSandboxPolicy::BootstrapSandboxPolicy()
64 : sandbox_(sandbox::BootstrapSandbox::Create()) { 64 : sandbox_(sandbox::BootstrapSandbox::Create()) {
65 CHECK(sandbox_.get()); 65 CHECK(sandbox_.get());
66 BrowserChildProcessObserver::Add(this); 66 BrowserChildProcessObserver::Add(this);
67 RegisterSandboxPolicies(); 67 RegisterSandboxPolicies();
68 } 68 }
69 69
70 BootstrapSandboxPolicy::~BootstrapSandboxPolicy() { 70 BootstrapSandboxPolicy::~BootstrapSandboxPolicy() {
71 BrowserChildProcessObserver::Remove(this); 71 BrowserChildProcessObserver::Remove(this);
72 } 72 }
73 73
74 void BootstrapSandboxPolicy::RegisterSandboxPolicies() { 74 void BootstrapSandboxPolicy::RegisterSandboxPolicies() {
75 } 75 }
76 76
77 } // namespace 77 } // namespace
78 78
79 bool ShouldEnableBootstrapSandbox() { 79 bool ShouldEnableBootstrapSandbox() {
80 // TODO(rsesek): Re-enable when crbug.com/501128 is fixed. 80 // TODO(rsesek): Re-enable when crbug.com/501128 is fixed.
81 return false; 81 return false;
82 } 82 }
83 83
84 sandbox::BootstrapSandbox* GetBootstrapSandbox() { 84 sandbox::BootstrapSandbox* GetBootstrapSandbox() {
85 return BootstrapSandboxPolicy::GetInstance()->sandbox(); 85 return BootstrapSandboxPolicy::GetInstance()->sandbox();
86 } 86 }
87 87
88 } // namespace content 88 } // namespace content
OLDNEW
« no previous file with comments | « base/process/launch_posix.cc ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698