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

Side by Side Diff: jingle/glue/chrome_async_socket.cc

Issue 1550693002: Global conversion of Pass()→std::move() on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/mojo/ipc_mojo_message_helper.cc ('k') | jingle/glue/chrome_async_socket_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 "jingle/glue/chrome_async_socket.h" 5 #include "jingle/glue/chrome_async_socket.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8
9 #include <algorithm> 8 #include <algorithm>
10 #include <cstdlib> 9 #include <cstdlib>
11 #include <cstring> 10 #include <cstring>
11 #include <utility>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/message_loop/message_loop.h" 16 #include "base/message_loop/message_loop.h"
17 #include "jingle/glue/resolving_client_socket_factory.h" 17 #include "jingle/glue/resolving_client_socket_factory.h"
18 #include "net/base/address_list.h" 18 #include "net/base/address_list.h"
19 #include "net/base/host_port_pair.h" 19 #include "net/base/host_port_pair.h"
20 #include "net/base/io_buffer.h" 20 #include "net/base/io_buffer.h"
21 #include "net/base/net_util.h" 21 #include "net/base/net_util.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 read_start_ = 0U; 398 read_start_ = 0U;
399 read_end_ = 0U; 399 read_end_ = 0U;
400 DCHECK_EQ(write_end_, 0U); 400 DCHECK_EQ(write_end_, 0U);
401 401
402 // Clear out any posted DoRead() tasks. 402 // Clear out any posted DoRead() tasks.
403 weak_ptr_factory_.InvalidateWeakPtrs(); 403 weak_ptr_factory_.InvalidateWeakPtrs();
404 404
405 DCHECK(transport_socket_.get()); 405 DCHECK(transport_socket_.get());
406 scoped_ptr<net::ClientSocketHandle> socket_handle( 406 scoped_ptr<net::ClientSocketHandle> socket_handle(
407 new net::ClientSocketHandle()); 407 new net::ClientSocketHandle());
408 socket_handle->SetSocket(transport_socket_.Pass()); 408 socket_handle->SetSocket(std::move(transport_socket_));
409 transport_socket_ = 409 transport_socket_ = resolving_client_socket_factory_->CreateSSLClientSocket(
410 resolving_client_socket_factory_->CreateSSLClientSocket( 410 std::move(socket_handle), net::HostPortPair(domain_name, 443));
411 socket_handle.Pass(), net::HostPortPair(domain_name, 443));
412 int status = transport_socket_->Connect( 411 int status = transport_socket_->Connect(
413 base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone, 412 base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone,
414 weak_ptr_factory_.GetWeakPtr())); 413 weak_ptr_factory_.GetWeakPtr()));
415 if (status != net::ERR_IO_PENDING) { 414 if (status != net::ERR_IO_PENDING) {
416 base::MessageLoop* message_loop = base::MessageLoop::current(); 415 base::MessageLoop* message_loop = base::MessageLoop::current();
417 CHECK(message_loop); 416 CHECK(message_loop);
418 message_loop->PostTask( 417 message_loop->PostTask(
419 FROM_HERE, 418 FROM_HERE,
420 base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone, 419 base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone,
421 weak_ptr_factory_.GetWeakPtr(), status)); 420 weak_ptr_factory_.GetWeakPtr(), status));
(...skipping 20 matching lines...) Expand all
442 } 441 }
443 state_ = STATE_TLS_OPEN; 442 state_ = STATE_TLS_OPEN;
444 PostDoRead(); 443 PostDoRead();
445 if (write_end_ > 0U) { 444 if (write_end_ > 0U) {
446 PostDoWrite(); 445 PostDoWrite();
447 } 446 }
448 SignalSSLConnected(); 447 SignalSSLConnected();
449 } 448 }
450 449
451 } // namespace jingle_glue 450 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_mojo_message_helper.cc ('k') | jingle/glue/chrome_async_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698