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

Unified Diff: chrome/common/sandbox_init_wrapper.h

Issue 17426: remove chrome dependencies from win sandboxing headers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/sandbox_init_wrapper.h
===================================================================
--- chrome/common/sandbox_init_wrapper.h (revision 0)
+++ chrome/common/sandbox_init_wrapper.h (revision 0)
@@ -0,0 +1,55 @@
+// Copyright (c) 2009 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.
+
+#ifndef CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_
+#define CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_
+
+// Wraps the sandbox initialization and platform variables to consolodate
+// the code and reduce the number of platform ifdefs elsewhere. The POSIX
+// version of this wrapper is basically empty.
+
+#include "build/build_config.h"
+
+#include <string>
+#if defined(OS_WIN)
+#include "sandbox/src/sandbox.h"
+#endif
+
+class CommandLine;
+
+#if defined(OS_WIN)
+
+class SandboxInitWrapper {
+ public:
+ SandboxInitWrapper() : broker_services_(), target_services_() { }
+ // SetServices() needs to be called before InitializeSandbox() on Win32 with
+ // the info received from the chrome exe main.
+ void SetServices(sandbox::SandboxInterfaceInfo* sandbox_info);
+ sandbox::BrokerServices* BrokerServices() const { return broker_services_; }
+ sandbox::TargetServices* TargetServices() const { return target_services_; }
+
+ // Initialize the sandbox for renderer and plug-in processes, depending on
+ // the command line flags. The browser process is not sandboxed.
+ void InitializeSandbox(const CommandLine& parsed_command_line,
+ const std::wstring& process_type);
+ private:
+ sandbox::BrokerServices* broker_services_;
+ sandbox::TargetServices* target_services_;
+};
brettw 2009/01/09 18:10:47 Maybe DISALLOW_COPY_AND_ASSIGN here? (And below.)
+
+#elif defined(OS_POSIX)
+
+class SandboxInitWrapper {
+ public:
+ SandboxInitWrapper() { }
+
+ // Initialize the sandbox for renderer and plug-in processes, depending on
+ // the command line flags. The browser process is not sandboxed.
+ void InitializeSandbox(const CommandLine& parsed_command_line,
+ const std::wstring& process_type);
+};
+
+#endif
+
+#endif // CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_
Property changes on: chrome/common/sandbox_init_wrapper.h
___________________________________________________________________
Name: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698