Index: content/browser/bootstrap_sandbox_mac.cc |
diff --git a/content/browser/bootstrap_sandbox_mac.cc b/content/browser/bootstrap_sandbox_mac.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..52fa2a5ad61165f68c7aee4094a5273a798e4021 |
--- /dev/null |
+++ b/content/browser/bootstrap_sandbox_mac.cc |
@@ -0,0 +1,59 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/bootstrap_sandbox_mac.h" |
+ |
+#include "base/logging.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/memory/singleton.h" |
+#include "sandbox/mac/bootstrap_sandbox.h" |
+ |
+namespace content { |
+ |
+namespace { |
+ |
+// This class is responsible for creating the BootstrapSandbox global |
+// singleton, as well as registering all associated policies with it. |
+class BootstrapSandboxPolicy { |
+ public: |
+ static BootstrapSandboxPolicy* GetInstance(); |
+ |
+ sandbox::BootstrapSandbox* sandbox() const { |
+ return sandbox_.get(); |
+ } |
+ |
+ private: |
+ friend struct DefaultSingletonTraits<BootstrapSandboxPolicy>; |
+ BootstrapSandboxPolicy(); |
+ ~BootstrapSandboxPolicy(); |
+ |
+ void RegisterSandboxPolicies(); |
+ |
+ scoped_ptr<sandbox::BootstrapSandbox> sandbox_; |
+}; |
+ |
+BootstrapSandboxPolicy* BootstrapSandboxPolicy::GetInstance() { |
+ return Singleton<BootstrapSandboxPolicy>::get(); |
+} |
+ |
+BootstrapSandboxPolicy::BootstrapSandboxPolicy() |
+ : sandbox_(sandbox::BootstrapSandbox::Create()) { |
+ CHECK(sandbox_.get()); |
+ RegisterSandboxPolicies(); |
+} |
+ |
+BootstrapSandboxPolicy::~BootstrapSandboxPolicy() { |
+} |
+ |
+void BootstrapSandboxPolicy::RegisterSandboxPolicies() { |
+ // TODO(rsesek): Implement me. |
+} |
+ |
+} // namespace |
+ |
+sandbox::BootstrapSandbox* GetBootstrapSandbox() { |
+ return BootstrapSandboxPolicy::GetInstance()->sandbox(); |
+} |
+ |
+} // namespace content |