1 // Copyright (c) 2012 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.
5 // http://code.google.com/p/chromium/wiki/LinuxSandboxIPC
7 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
8 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
12 #include "base/logging.h"
13 #include "content/common/content_export.h"
15 template <typename T
> struct DefaultSingletonTraits
;
19 // This is a singleton object which handles sandbox requests from the
21 class CONTENT_EXPORT RenderSandboxHostLinux
{
23 // Returns the singleton instance.
24 static RenderSandboxHostLinux
* GetInstance();
26 // Get the file descriptor which renderers should be given in order to signal
27 // crashes to the browser.
28 int GetRendererSocket() const {
30 return renderer_socket_
;
36 void Init(const std::string
& sandbox_path
);
39 friend struct DefaultSingletonTraits
<RenderSandboxHostLinux
>;
40 // This object must be constructed on the main thread.
41 RenderSandboxHostLinux();
42 ~RenderSandboxHostLinux();
44 // Whether Init() has been called yet.
48 int childs_lifeline_fd_
;
51 DISALLOW_COPY_AND_ASSIGN(RenderSandboxHostLinux
);
54 } // namespace content
56 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_