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

Side by Side Diff: ipc/mojo/ipc_channel_mojo.cc

Issue 660913002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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_posix.cc ('k') | no next file » | 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/mojo/ipc_channel_mojo.h" 5 #include "ipc/mojo/ipc_channel_mojo.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "ipc/ipc_listener.h" 10 #include "ipc/ipc_listener.h"
(...skipping 14 matching lines...) Expand all
25 MojoChannelFactory(ChannelMojo::Delegate* delegate, 25 MojoChannelFactory(ChannelMojo::Delegate* delegate,
26 ChannelHandle channel_handle, 26 ChannelHandle channel_handle,
27 Channel::Mode mode) 27 Channel::Mode mode)
28 : delegate_(delegate), channel_handle_(channel_handle), mode_(mode) {} 28 : delegate_(delegate), channel_handle_(channel_handle), mode_(mode) {}
29 29
30 virtual std::string GetName() const override { 30 virtual std::string GetName() const override {
31 return channel_handle_.name; 31 return channel_handle_.name;
32 } 32 }
33 33
34 virtual scoped_ptr<Channel> BuildChannel(Listener* listener) override { 34 virtual scoped_ptr<Channel> BuildChannel(Listener* listener) override {
35 return ChannelMojo::Create(delegate_, channel_handle_, mode_, listener) 35 return ChannelMojo::Create(delegate_, channel_handle_, mode_, listener);
36 .PassAs<Channel>();
37 } 36 }
38 37
39 private: 38 private:
40 ChannelMojo::Delegate* delegate_; 39 ChannelMojo::Delegate* delegate_;
41 ChannelHandle channel_handle_; 40 ChannelHandle channel_handle_;
42 Channel::Mode mode_; 41 Channel::Mode mode_;
43 }; 42 };
44 43
45 } // namespace 44 } // namespace
46 45
(...skipping 12 matching lines...) Expand all
59 Mode mode, 58 Mode mode,
60 Listener* listener) { 59 Listener* listener) {
61 return make_scoped_ptr( 60 return make_scoped_ptr(
62 new ChannelMojo(delegate, channel_handle, mode, listener)); 61 new ChannelMojo(delegate, channel_handle, mode, listener));
63 } 62 }
64 63
65 // static 64 // static
66 scoped_ptr<ChannelFactory> ChannelMojo::CreateServerFactory( 65 scoped_ptr<ChannelFactory> ChannelMojo::CreateServerFactory(
67 ChannelMojo::Delegate* delegate, 66 ChannelMojo::Delegate* delegate,
68 const ChannelHandle& channel_handle) { 67 const ChannelHandle& channel_handle) {
69 return make_scoped_ptr(new MojoChannelFactory( 68 return make_scoped_ptr(
70 delegate, channel_handle, Channel::MODE_SERVER)) 69 new MojoChannelFactory(delegate, channel_handle, Channel::MODE_SERVER));
71 .PassAs<ChannelFactory>();
72 } 70 }
73 71
74 // static 72 // static
75 scoped_ptr<ChannelFactory> ChannelMojo::CreateClientFactory( 73 scoped_ptr<ChannelFactory> ChannelMojo::CreateClientFactory(
76 const ChannelHandle& channel_handle) { 74 const ChannelHandle& channel_handle) {
77 return make_scoped_ptr( 75 return make_scoped_ptr(
78 new MojoChannelFactory(NULL, channel_handle, Channel::MODE_CLIENT)) 76 new MojoChannelFactory(NULL, channel_handle, Channel::MODE_CLIENT));
79 .PassAs<ChannelFactory>();
80 } 77 }
81 78
82 ChannelMojo::ChannelMojo(ChannelMojo::Delegate* delegate, 79 ChannelMojo::ChannelMojo(ChannelMojo::Delegate* delegate,
83 const ChannelHandle& handle, 80 const ChannelHandle& handle,
84 Mode mode, 81 Mode mode,
85 Listener* listener) 82 Listener* listener)
86 : mode_(mode), 83 : mode_(mode),
87 listener_(listener), 84 listener_(listener),
88 peer_pid_(base::kNullProcessId), 85 peer_pid_(base::kNullProcessId),
89 weak_factory_(this) { 86 weak_factory_(this) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 275
279 fdset->CommitAll(); 276 fdset->CommitAll();
280 } 277 }
281 278
282 return MOJO_RESULT_OK; 279 return MOJO_RESULT_OK;
283 } 280 }
284 281
285 #endif // defined(OS_POSIX) && !defined(OS_NACL) 282 #endif // defined(OS_POSIX) && !defined(OS_NACL)
286 283
287 } // namespace IPC 284 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698