summaryrefslogtreecommitdiffstats
path: root/chrome/browser/child_process_launcher.cc
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 08:15:04 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 08:15:04 +0000
commitd3c6c0d77db083fbb68f81589acf4fc7c58a1fad (patch)
treec4f00bd9c7205cd3ec60533e86e2e2023acc6b83 /chrome/browser/child_process_launcher.cc
parentee16679f293ca27ce3d822a97efad7d3fa8a049e (diff)
downloadchromium_src-d3c6c0d77db083fbb68f81589acf4fc7c58a1fad.zip
chromium_src-d3c6c0d77db083fbb68f81589acf4fc7c58a1fad.tar.gz
chromium_src-d3c6c0d77db083fbb68f81589acf4fc7c58a1fad.tar.bz2
Add a new GetInstance() method for singleton classes used in chrome/browser files.
This CL includes half of the files under chrome/browser using Singleton<T>. The rest of the files will be sent in a second CL. In one case I used a LazyInstance<T> instead of Singleton<T> as that was simpler and necessary since T was a typedef and can't add member functions to it. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5519016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_launcher.cc')
-rw-r--r--chrome/browser/child_process_launcher.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/child_process_launcher.cc b/chrome/browser/child_process_launcher.cc
index f215084..2586826 100644
--- a/chrome/browser/child_process_launcher.cc
+++ b/chrome/browser/child_process_launcher.cc
@@ -115,12 +115,13 @@ class ChildProcessLauncher::Context
base::GlobalDescriptors::Mapping mapping;
mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd));
const int crash_signal_fd =
- Singleton<RendererCrashHandlerHostLinux>()->GetDeathSignalSocket();
+ RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
if (crash_signal_fd >= 0) {
mapping.push_back(std::pair<uint32_t, int>(kCrashDumpSignal,
crash_signal_fd));
}
- handle = Singleton<ZygoteHost>()->ForkRenderer(cmd_line->argv(), mapping);
+ handle = ZygoteHost::GetInstance()->ForkRenderer(cmd_line->argv(),
+ mapping);
} else
// Fall through to the normal posix case below when we're not zygoting.
#endif
@@ -143,10 +144,10 @@ class ChildProcessLauncher::Context
if (is_renderer || is_plugin) {
int crash_signal_fd;
if (is_renderer) {
- crash_signal_fd = Singleton<RendererCrashHandlerHostLinux>()->
+ crash_signal_fd = RendererCrashHandlerHostLinux::GetInstance()->
GetDeathSignalSocket();
} else {
- crash_signal_fd = Singleton<PluginCrashHandlerHostLinux>()->
+ crash_signal_fd = PluginCrashHandlerHostLinux::GetInstance()->
GetDeathSignalSocket();
}
if (crash_signal_fd >= 0) {
@@ -157,7 +158,7 @@ class ChildProcessLauncher::Context
}
if (is_renderer) {
const int sandbox_fd =
- Singleton<RenderSandboxHostLinux>()->GetRendererSocket();
+ RenderSandboxHostLinux::GetInstance()->GetRendererSocket();
fds_to_map.push_back(std::make_pair(
sandbox_fd,
kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
@@ -253,7 +254,7 @@ class ChildProcessLauncher::Context
if (zygote) {
// If the renderer was created via a zygote, we have to proxy the reaping
// through the zygote process.
- Singleton<ZygoteHost>()->EnsureProcessTerminated(handle);
+ ZygoteHost::GetInstance()->EnsureProcessTerminated(handle);
} else
#endif // OS_LINUX
{
@@ -315,7 +316,8 @@ bool ChildProcessLauncher::DidProcessCrash() {
base::ProcessHandle handle = context_->process_.handle();
#if defined(OS_LINUX)
if (context_->zygote_) {
- did_crash = Singleton<ZygoteHost>()->DidProcessCrash(handle, &child_exited);
+ did_crash = ZygoteHost::GetInstance()->DidProcessCrash(handle,
+ &child_exited);
} else
#endif
{