diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-05 05:19:27 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-05 05:19:27 +0000 |
commit | d7c6cc2c268b1dec8f3834220f2acb36a1799a76 (patch) | |
tree | bf3c25458670af664f08f70f2161e228b09bba60 /remoting/protocol/fake_session.cc | |
parent | bf59eb89147f0479439f5d0672d9d8627c452758 (diff) | |
download | chromium_src-d7c6cc2c268b1dec8f3834220f2acb36a1799a76.zip chromium_src-d7c6cc2c268b1dec8f3834220f2acb36a1799a76.tar.gz chromium_src-d7c6cc2c268b1dec8f3834220f2acb36a1799a76.tar.bz2 |
Use scoped_ptr<> for channel creation callbacks.
Changed callbacks in Session and ChannelAuthenticator interfaces for
cleaner ownership semantics.
Review URL: https://chromiumcodereview.appspot.com/9316074
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/fake_session.cc')
-rw-r--r-- | remoting/protocol/fake_session.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc index 3499650..ebd5f14 100644 --- a/remoting/protocol/fake_session.cc +++ b/remoting/protocol/fake_session.cc @@ -253,16 +253,16 @@ Session::Error FakeSession::error() { void FakeSession::CreateStreamChannel( const std::string& name, const StreamChannelCallback& callback) { - FakeSocket* channel = new FakeSocket(); - stream_channels_[name] = channel; - callback.Run(channel); + scoped_ptr<FakeSocket> channel(new FakeSocket()); + stream_channels_[name] = channel.get(); + callback.Run(channel.PassAs<net::StreamSocket>()); } void FakeSession::CreateDatagramChannel( const std::string& name, const DatagramChannelCallback& callback) { - FakeUdpSocket* channel = new FakeUdpSocket(); - datagram_channels_[name] = channel; - callback.Run(channel); + scoped_ptr<FakeUdpSocket> channel(new FakeUdpSocket()); + datagram_channels_[name] = channel.get(); + callback.Run(channel.PassAs<net::Socket>()); } void FakeSession::CancelChannelCreation(const std::string& name) { |