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

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

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 #include "content/browser/renderer_host/render_sandbox_host_linux.h" 5 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
6 6
7 #include <sys/socket.h> 7 #include <sys/socket.h>
8 8
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/posix/eintr_wrapper.h" 10 #include "base/posix/eintr_wrapper.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 // Runs on the main thread at startup. 14 // Runs on the main thread at startup.
15 RenderSandboxHostLinux::RenderSandboxHostLinux() 15 RenderSandboxHostLinux::RenderSandboxHostLinux()
16 : initialized_(false), renderer_socket_(0), childs_lifeline_fd_(0) { 16 : initialized_(false), renderer_socket_(0), childs_lifeline_fd_(0) {
17 } 17 }
18 18
19 // static 19 // static
20 RenderSandboxHostLinux* RenderSandboxHostLinux::GetInstance() { 20 RenderSandboxHostLinux* RenderSandboxHostLinux::GetInstance() {
21 return Singleton<RenderSandboxHostLinux>::get(); 21 return base::Singleton<RenderSandboxHostLinux>::get();
22 } 22 }
23 23
24 void RenderSandboxHostLinux::Init() { 24 void RenderSandboxHostLinux::Init() {
25 DCHECK(!initialized_); 25 DCHECK(!initialized_);
26 initialized_ = true; 26 initialized_ = true;
27 27
28 int fds[2]; 28 int fds[2];
29 // We use SOCK_SEQPACKET rather than SOCK_DGRAM to prevent the renderer from 29 // We use SOCK_SEQPACKET rather than SOCK_DGRAM to prevent the renderer from
30 // sending datagrams to other sockets on the system. The sandbox may prevent 30 // sending datagrams to other sockets on the system. The sandbox may prevent
31 // the renderer from calling socket() to create new sockets, but it'll still 31 // the renderer from calling socket() to create new sockets, but it'll still
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (!ShutdownIPCChannel()) 65 if (!ShutdownIPCChannel())
66 LOG(ERROR) << "ShutdownIPCChannel failed"; 66 LOG(ERROR) << "ShutdownIPCChannel failed";
67 if (IGNORE_EINTR(close(renderer_socket_)) < 0) 67 if (IGNORE_EINTR(close(renderer_socket_)) < 0)
68 PLOG(ERROR) << "close"; 68 PLOG(ERROR) << "close";
69 69
70 ipc_thread_->Join(); 70 ipc_thread_->Join();
71 } 71 }
72 } 72 }
73 73
74 } // namespace content 74 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_sandbox_host_linux.h ('k') | content/browser/renderer_host/renderer_frame_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698