From 84818e9ec2de7346183fd46d8ff56b57d2902bda Mon Sep 17 00:00:00 2001 From: "abeera@google.com" Date: Fri, 24 Jun 2011 18:57:24 +0000 Subject: Fix to bug 75303 Makes the sun_path an absolute path("/tmp/pipe_name") to allow IPC between processes with different working directories BUG=75303 TEST=NONE Review URL: http://codereview.chromium.org/7167017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90400 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/service_process_util_linux.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'chrome/common/service_process_util_linux.cc') diff --git a/chrome/common/service_process_util_linux.cc b/chrome/common/service_process_util_linux.cc index d51654b..fe3d04f 100644 --- a/chrome/common/service_process_util_linux.cc +++ b/chrome/common/service_process_util_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,9 +7,11 @@ #include #include +#include "base/base_paths.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" +#include "base/path_service.h" #include "base/threading/platform_thread.h" #include "chrome/common/auto_start_linux.h" #include "chrome/common/multi_process_lock.h" @@ -67,6 +69,18 @@ bool ForceServiceProcessShutdown(const std::string& version, return true; } +// Gets the name of the service process IPC channel. +// Returns an absolute path as required. +IPC::ChannelHandle GetServiceProcessChannel() { + FilePath temp_dir; + PathService::Get(base::DIR_TEMP, &temp_dir); + std::string pipe_name = GetServiceProcessScopedVersionedName("_service_ipc"); + std::string pipe_path = temp_dir.Append(pipe_name).value(); + return pipe_path; +} + + + bool CheckServiceProcessReady() { scoped_ptr running_lock(TakeServiceRunningLock(false)); return running_lock.get() == NULL; -- cgit v1.1