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

Side by Side Diff: content/browser/renderer_host/render_sandbox_host_linux.h

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/threading/simple_thread.h" 12 #include "base/threading/simple_thread.h"
13 #include "content/browser/renderer_host/sandbox_ipc_linux.h" 13 #include "content/browser/renderer_host/sandbox_ipc_linux.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 15
16 namespace base {
16 template <typename T> struct DefaultSingletonTraits; 17 template <typename T> struct DefaultSingletonTraits;
18 }
17 19
18 namespace content { 20 namespace content {
19 21
20 // This is a singleton object which handles sandbox requests from the 22 // This is a singleton object which handles sandbox requests from the
21 // renderers. 23 // renderers.
22 class CONTENT_EXPORT RenderSandboxHostLinux { 24 class CONTENT_EXPORT RenderSandboxHostLinux {
23 public: 25 public:
24 // Returns the singleton instance. 26 // Returns the singleton instance.
25 static RenderSandboxHostLinux* GetInstance(); 27 static RenderSandboxHostLinux* GetInstance();
26 28
27 // Get the file descriptor which renderers should be given in order to signal 29 // Get the file descriptor which renderers should be given in order to signal
28 // crashes to the browser. 30 // crashes to the browser.
29 int GetRendererSocket() const { 31 int GetRendererSocket() const {
30 DCHECK(initialized_); 32 DCHECK(initialized_);
31 return renderer_socket_; 33 return renderer_socket_;
32 } 34 }
33 void Init(); 35 void Init();
34 36
35 private: 37 private:
36 friend struct DefaultSingletonTraits<RenderSandboxHostLinux>; 38 friend struct base::DefaultSingletonTraits<RenderSandboxHostLinux>;
37 // This object must be constructed on the main thread. 39 // This object must be constructed on the main thread.
38 RenderSandboxHostLinux(); 40 RenderSandboxHostLinux();
39 ~RenderSandboxHostLinux(); 41 ~RenderSandboxHostLinux();
40 42
41 bool ShutdownIPCChannel(); 43 bool ShutdownIPCChannel();
42 44
43 // Whether Init() has been called yet. 45 // Whether Init() has been called yet.
44 bool initialized_; 46 bool initialized_;
45 47
46 int renderer_socket_; 48 int renderer_socket_;
47 int childs_lifeline_fd_; 49 int childs_lifeline_fd_;
48 50
49 scoped_ptr<SandboxIPCHandler> ipc_handler_; 51 scoped_ptr<SandboxIPCHandler> ipc_handler_;
50 scoped_ptr<base::DelegateSimpleThread> ipc_thread_; 52 scoped_ptr<base::DelegateSimpleThread> ipc_thread_;
51 53
52 DISALLOW_COPY_AND_ASSIGN(RenderSandboxHostLinux); 54 DISALLOW_COPY_AND_ASSIGN(RenderSandboxHostLinux);
53 }; 55 };
54 56
55 } // namespace content 57 } // namespace content
56 58
57 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ 59 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698