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

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

Issue 1899083002: Convert //chrome from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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
« no previous file with comments | « chrome/service/service_ipc_server.h ('k') | chrome/service/service_ipc_server_unittest.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) 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 "base/metrics/histogram_delta_serialization.h" 7 #include "base/metrics/histogram_delta_serialization.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/common/service_messages.h" 9 #include "chrome/common/service_messages.h"
10 #include "ipc/ipc_logging.h" 10 #include "ipc/ipc_logging.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 bool ServiceIPCServer::Send(IPC::Message* msg) { 80 bool ServiceIPCServer::Send(IPC::Message* msg) {
81 if (!channel_.get()) { 81 if (!channel_.get()) {
82 delete msg; 82 delete msg;
83 return false; 83 return false;
84 } 84 }
85 85
86 return channel_->Send(msg); 86 return channel_->Send(msg);
87 } 87 }
88 88
89 void ServiceIPCServer::AddMessageHandler(scoped_ptr<MessageHandler> handler) { 89 void ServiceIPCServer::AddMessageHandler(
90 std::unique_ptr<MessageHandler> handler) {
90 message_handlers_.push_back(handler.release()); 91 message_handlers_.push_back(handler.release());
91 } 92 }
92 93
93 bool ServiceIPCServer::OnMessageReceived(const IPC::Message& msg) { 94 bool ServiceIPCServer::OnMessageReceived(const IPC::Message& msg) {
94 bool handled = true; 95 bool handled = true;
95 // When we get a message, always mark the IPC client as connected. The 96 // When we get a message, always mark the IPC client as connected. The
96 // ChannelProxy::Context is only letting OnChannelConnected get called once, 97 // ChannelProxy::Context is only letting OnChannelConnected get called once,
97 // so on Mac and Linux, we never would set ipc_client_connected_ to true 98 // so on Mac and Linux, we never would set ipc_client_connected_ to true
98 // again on subsequent connections. 99 // again on subsequent connections.
99 ipc_client_connected_ = true; 100 ipc_client_connected_ = true;
(...skipping 30 matching lines...) Expand all
130 channel_->Send(new ServiceHostMsg_Histograms(deltas)); 131 channel_->Send(new ServiceHostMsg_Histograms(deltas));
131 } 132 }
132 133
133 void ServiceIPCServer::OnShutdown() { 134 void ServiceIPCServer::OnShutdown() {
134 client_->OnShutdown(); 135 client_->OnShutdown();
135 } 136 }
136 137
137 void ServiceIPCServer::OnUpdateAvailable() { 138 void ServiceIPCServer::OnUpdateAvailable() {
138 client_->OnUpdateAvailable(); 139 client_->OnUpdateAvailable();
139 } 140 }
OLDNEW
« no previous file with comments | « chrome/service/service_ipc_server.h ('k') | chrome/service/service_ipc_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698