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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 "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 IPC::ChannelHandle& channel_handle) 12 ServiceIPCServer::ServiceIPCServer(const IPC::ChannelHandle& channel_handle)
13 : channel_handle_(channel_handle), client_connected_(false) { 13 : channel_handle_(channel_handle), 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(NULL); // Tear down the existing channel, if any. 27 channel_.reset(NULL); // Tear down the existing channel, if any.
28 channel_.reset(new IPC::SyncChannel(channel_handle_, 28 channel_.reset(new IPC::SyncChannel(channel_handle_,
29 IPC::Channel::MODE_NAMED_SERVER, this, 29 IPC::Channel::MODE_NAMED_SERVER, this,
30 g_service_process->io_thread()->message_loop_proxy(), true, 30 g_service_process->io_thread()->message_loop_proxy().get(), true,
31 g_service_process->shutdown_event())); 31 g_service_process->shutdown_event()));
32 DCHECK(sync_message_filter_.get()); 32 DCHECK(sync_message_filter_.get());
33 channel_->AddFilter(sync_message_filter_.get()); 33 channel_->AddFilter(sync_message_filter_.get());
34 } 34 }
35 35
36 ServiceIPCServer::~ServiceIPCServer() { 36 ServiceIPCServer::~ServiceIPCServer() {
37 #ifdef IPC_MESSAGE_LOG_ENABLED 37 #ifdef IPC_MESSAGE_LOG_ENABLED
38 IPC::Logging::GetInstance()->SetIPCSender(NULL); 38 IPC::Logging::GetInstance()->SetIPCSender(NULL);
39 #endif 39 #endif
40 40
41 channel_->RemoveFilter(sync_message_filter_.get()); 41 channel_->RemoveFilter(sync_message_filter_.get());
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 void ServiceIPCServer::OnShutdown() { 135 void ServiceIPCServer::OnShutdown() {
136 g_service_process->Shutdown(); 136 g_service_process->Shutdown();
137 } 137 }
138 138
139 void ServiceIPCServer::OnUpdateAvailable() { 139 void ServiceIPCServer::OnUpdateAvailable() {
140 g_service_process->SetUpdateAvailable(); 140 g_service_process->SetUpdateAvailable();
141 } 141 }
142 142
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc ('k') | chrome/test/base/ui_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698