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

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

Issue 303293002: Initialize the bootstrap sandbox in the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SandboxType Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/bootstrap_sandbox_mac.h"
6
7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/singleton.h"
10 #include "sandbox/mac/bootstrap_sandbox.h"
11
12 namespace content {
13
14 namespace {
15
16 // This class is responsible for creating the BootstrapSandbox global
17 // singleton, as well as registering all associated policies with it.
18 class BootstrapSandboxPolicy {
19 public:
20 static BootstrapSandboxPolicy* GetInstance();
21
22 sandbox::BootstrapSandbox* sandbox() const {
23 return sandbox_.get();
24 }
25
26 private:
27 friend struct DefaultSingletonTraits<BootstrapSandboxPolicy>;
28 BootstrapSandboxPolicy();
29 ~BootstrapSandboxPolicy();
30
31 void RegisterSandboxPolicies();
32
33 scoped_ptr<sandbox::BootstrapSandbox> sandbox_;
34 };
35
36 BootstrapSandboxPolicy* BootstrapSandboxPolicy::GetInstance() {
37 return Singleton<BootstrapSandboxPolicy>::get();
38 }
39
40 BootstrapSandboxPolicy::BootstrapSandboxPolicy()
41 : sandbox_(sandbox::BootstrapSandbox::Create()) {
42 CHECK(sandbox_.get());
43 RegisterSandboxPolicies();
44 }
45
46 BootstrapSandboxPolicy::~BootstrapSandboxPolicy() {
47 }
48
49 void BootstrapSandboxPolicy::RegisterSandboxPolicies() {
50 // TODO(rsesek): Implement me.
51 }
52
53 } // namespace
54
55 sandbox::BootstrapSandbox* GetBootstrapSandbox() {
56 return BootstrapSandboxPolicy::GetInstance()->sandbox();
57 }
58
59 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698