Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / content / browser / renderer_host / render_sandbox_host_linux.h
bloba9f8a021d0087a4ea1d8f49d2a2a72c7cede2433
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
8 #include <string>
10 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/threading/simple_thread.h"
13 #include "content/browser/renderer_host/sandbox_ipc_linux.h"
14 #include "content/common/content_export.h"
16 namespace base {
17 template <typename T> struct DefaultSingletonTraits;
20 namespace content {
22 // This is a singleton object which handles sandbox requests from the
23 // renderers.
24 class CONTENT_EXPORT RenderSandboxHostLinux {
25 public:
26 // Returns the singleton instance.
27 static RenderSandboxHostLinux* GetInstance();
29 // Get the file descriptor which renderers should be given in order to signal
30 // crashes to the browser.
31 int GetRendererSocket() const {
32 DCHECK(initialized_);
33 return renderer_socket_;
35 void Init();
37 private:
38 friend struct base::DefaultSingletonTraits<RenderSandboxHostLinux>;
39 // This object must be constructed on the main thread.
40 RenderSandboxHostLinux();
41 ~RenderSandboxHostLinux();
43 bool ShutdownIPCChannel();
45 // Whether Init() has been called yet.
46 bool initialized_;
48 int renderer_socket_;
49 int childs_lifeline_fd_;
51 scoped_ptr<SandboxIPCHandler> ipc_handler_;
52 scoped_ptr<base::DelegateSimpleThread> ipc_thread_;
54 DISALLOW_COPY_AND_ASSIGN(RenderSandboxHostLinux);
57 } // namespace content
59 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_