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

Side by Side Diff: chrome/service/service_ipc_server.cc

Issue 6349029: Get service processes working on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up small typo in comment Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/service_process_util_win.cc ('k') | chrome/service/service_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/service/service_ipc_server.h" 5 #include "chrome/service/service_ipc_server.h"
6 6
7 #include "chrome/common/service_messages.h" 7 #include "chrome/common/service_messages.h"
8 #include "chrome/service/cloud_print/cloud_print_proxy.h" 8 #include "chrome/service/cloud_print/cloud_print_proxy.h"
9 #include "chrome/service/service_process.h" 9 #include "chrome/service/service_process.h"
10 #include "ipc/ipc_logging.h" 10 #include "ipc/ipc_logging.h"
11 11
12 ServiceIPCServer::ServiceIPCServer(const std::string& channel_name) 12 ServiceIPCServer::ServiceIPCServer(const std::string& channel_name)
13 : channel_name_(channel_name), client_connected_(false) { 13 : channel_name_(channel_name), client_connected_(false) {
14 } 14 }
15 15
16 bool ServiceIPCServer::Init() { 16 bool ServiceIPCServer::Init() {
17 #ifdef IPC_MESSAGE_LOG_ENABLED 17 #ifdef IPC_MESSAGE_LOG_ENABLED
18 IPC::Logging::GetInstance()->SetIPCSender(this); 18 IPC::Logging::GetInstance()->SetIPCSender(this);
19 #endif 19 #endif
20 sync_message_filter_ = 20 sync_message_filter_ =
21 new IPC::SyncMessageFilter(g_service_process->shutdown_event()); 21 new IPC::SyncMessageFilter(g_service_process->shutdown_event());
22 CreateChannel(); 22 CreateChannel();
23 return true; 23 return true;
24 } 24 }
25 25
26 void ServiceIPCServer::CreateChannel() { 26 void ServiceIPCServer::CreateChannel() {
27 channel_.reset(new IPC::SyncChannel(channel_name_, 27 channel_.reset(new IPC::SyncChannel(channel_name_,
28 IPC::Channel::MODE_SERVER, this, 28 IPC::Channel::MODE_NAMED_SERVER, this,
29 g_service_process->io_thread()->message_loop(), true, 29 g_service_process->io_thread()->message_loop(), true,
30 g_service_process->shutdown_event())); 30 g_service_process->shutdown_event()));
31 DCHECK(sync_message_filter_.get()); 31 DCHECK(sync_message_filter_.get());
32 channel_->AddFilter(sync_message_filter_.get()); 32 channel_->AddFilter(sync_message_filter_.get());
33 } 33 }
34 34
35 ServiceIPCServer::~ServiceIPCServer() { 35 ServiceIPCServer::~ServiceIPCServer() {
36 #ifdef IPC_MESSAGE_LOG_ENABLED 36 #ifdef IPC_MESSAGE_LOG_ENABLED
37 IPC::Logging::GetInstance()->SetIPCSender(NULL); 37 IPC::Logging::GetInstance()->SetIPCSender(NULL);
38 #endif 38 #endif
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 g_service_process->GetCloudPrintProxy()->DisableForUser(); 155 g_service_process->GetCloudPrintProxy()->DisableForUser();
156 } 156 }
157 157
158 void ServiceIPCServer::OnShutdown() { 158 void ServiceIPCServer::OnShutdown() {
159 g_service_process->Shutdown(); 159 g_service_process->Shutdown();
160 } 160 }
161 161
162 void ServiceIPCServer::OnUpdateAvailable() { 162 void ServiceIPCServer::OnUpdateAvailable() {
163 g_service_process->SetUpdateAvailable(); 163 g_service_process->SetUpdateAvailable();
164 } 164 }
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_win.cc ('k') | chrome/service/service_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698