summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_ipc_server.cc
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 17:14:36 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 17:14:36 +0000
commit56f0f264ff866052ebcb24e75147cb600e6547a1 (patch)
tree8b16bded93f914cacbf3cb130fae3539ad4bb268 /chrome/service/service_ipc_server.cc
parent04a8454da64b62bfad5091efd5cf1143443283f0 (diff)
downloadchromium_src-56f0f264ff866052ebcb24e75147cb600e6547a1.zip
chromium_src-56f0f264ff866052ebcb24e75147cb600e6547a1.tar.gz
chromium_src-56f0f264ff866052ebcb24e75147cb600e6547a1.tar.bz2
Get service process running standalone on the mac by hooking it into launchd.
BUG=NONE TEST=BUILD Review URL: http://codereview.chromium.org/6482016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_ipc_server.cc')
-rw-r--r--chrome/service/service_ipc_server.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/service/service_ipc_server.cc b/chrome/service/service_ipc_server.cc
index 5e503c8..5257eec 100644
--- a/chrome/service/service_ipc_server.cc
+++ b/chrome/service/service_ipc_server.cc
@@ -9,8 +9,8 @@
#include "chrome/service/service_process.h"
#include "ipc/ipc_logging.h"
-ServiceIPCServer::ServiceIPCServer(const std::string& channel_name)
- : channel_name_(channel_name), client_connected_(false) {
+ServiceIPCServer::ServiceIPCServer(const IPC::ChannelHandle& channel_handle)
+ : channel_handle_(channel_handle), client_connected_(false) {
}
bool ServiceIPCServer::Init() {
@@ -24,7 +24,7 @@ bool ServiceIPCServer::Init() {
}
void ServiceIPCServer::CreateChannel() {
- channel_.reset(new IPC::SyncChannel(channel_name_,
+ channel_.reset(new IPC::SyncChannel(channel_handle_,
IPC::Channel::MODE_NAMED_SERVER, this,
g_service_process->io_thread()->message_loop(), true,
g_service_process->shutdown_event()));
@@ -63,8 +63,16 @@ void ServiceIPCServer::OnChannelError() {
client_connected_ = false;
// TODO(sanjeevr): Instead of invoking the service process for such handlers,
// define a Client interface that the ServiceProcess can implement.
- if (client_was_connected && g_service_process->HandleClientDisconnect()) {
- CreateChannel();
+ if (client_was_connected) {
+ if (g_service_process->HandleClientDisconnect()) {
+ CreateChannel();
+ }
+ } else {
+ // If the client was never even connected we had an error connecting.
+ if (!client_connected_) {
+ LOG(ERROR) << "Unable to open service ipc channel "
+ << "named: " << channel_handle_.name;
+ }
}
}