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

Side by Side Diff: ipc/ipc_channel_mojo.cc

Issue 2255143002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « ipc/ipc_channel_factory.cc ('k') | ipc/ipc_perftest_support.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ipc/ipc_channel_mojo.h" 5 #include "ipc/ipc_channel_mojo.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 Listener* listener, 246 Listener* listener,
247 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) { 247 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
248 return base::WrapUnique( 248 return base::WrapUnique(
249 new ChannelMojo(std::move(handle), mode, listener, ipc_task_runner)); 249 new ChannelMojo(std::move(handle), mode, listener, ipc_task_runner));
250 } 250 }
251 251
252 // static 252 // static
253 std::unique_ptr<ChannelFactory> ChannelMojo::CreateServerFactory( 253 std::unique_ptr<ChannelFactory> ChannelMojo::CreateServerFactory(
254 mojo::ScopedMessagePipeHandle handle, 254 mojo::ScopedMessagePipeHandle handle,
255 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) { 255 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
256 return base::WrapUnique(new MojoChannelFactory( 256 return base::MakeUnique<MojoChannelFactory>(
257 std::move(handle), Channel::MODE_SERVER, ipc_task_runner)); 257 std::move(handle), Channel::MODE_SERVER, ipc_task_runner);
258 } 258 }
259 259
260 // static 260 // static
261 std::unique_ptr<ChannelFactory> ChannelMojo::CreateClientFactory( 261 std::unique_ptr<ChannelFactory> ChannelMojo::CreateClientFactory(
262 mojo::ScopedMessagePipeHandle handle, 262 mojo::ScopedMessagePipeHandle handle,
263 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) { 263 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
264 return base::WrapUnique(new MojoChannelFactory( 264 return base::MakeUnique<MojoChannelFactory>(
265 std::move(handle), Channel::MODE_CLIENT, ipc_task_runner)); 265 std::move(handle), Channel::MODE_CLIENT, ipc_task_runner);
266 } 266 }
267 267
268 ChannelMojo::ChannelMojo( 268 ChannelMojo::ChannelMojo(
269 mojo::ScopedMessagePipeHandle handle, 269 mojo::ScopedMessagePipeHandle handle,
270 Mode mode, 270 Mode mode,
271 Listener* listener, 271 Listener* listener,
272 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) 272 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner)
273 : pipe_(handle.get()), listener_(listener), weak_factory_(this) { 273 : pipe_(handle.get()), listener_(listener), weak_factory_(this) {
274 // Create MojoBootstrap after all members are set as it touches 274 // Create MojoBootstrap after all members are set as it touches
275 // ChannelMojo from a different thread. 275 // ChannelMojo from a different thread.
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 473 }
474 474
475 void ChannelMojo::GetGenericRemoteAssociatedInterface( 475 void ChannelMojo::GetGenericRemoteAssociatedInterface(
476 const std::string& name, 476 const std::string& name,
477 mojo::ScopedInterfaceEndpointHandle handle) { 477 mojo::ScopedInterfaceEndpointHandle handle) {
478 if (message_reader_) 478 if (message_reader_)
479 message_reader_->GetRemoteInterface(name, std::move(handle)); 479 message_reader_->GetRemoteInterface(name, std::move(handle));
480 } 480 }
481 481
482 } // namespace IPC 482 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_factory.cc ('k') | ipc/ipc_perftest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698