Ignore non-active fullscreen windows for shelf state.
[chromium-blink-merge.git] / content / browser / renderer_host / render_sandbox_host_linux.h
blobd9f7edb39e0a9392c7c7a6dc19ec888ee441cf91
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_
10 #include <string>
12 #include "base/logging.h"
13 #include "content/common/content_export.h"
15 template <typename T> struct DefaultSingletonTraits;
17 namespace content {
19 // This is a singleton object which handles sandbox requests from the
20 // renderers.
21 class CONTENT_EXPORT RenderSandboxHostLinux {
22 public:
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 {
29 DCHECK(initialized_);
30 return renderer_socket_;
32 pid_t pid() const {
33 DCHECK(initialized_);
34 return pid_;
36 void Init(const std::string& sandbox_path);
38 private:
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.
45 bool initialized_;
47 int renderer_socket_;
48 int childs_lifeline_fd_;
49 pid_t pid_;
51 DISALLOW_COPY_AND_ASSIGN(RenderSandboxHostLinux);
54 } // namespace content
56 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_