OLD | NEW |
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/fake_ssl_client_socket.h" | 5 #include "jingle/glue/fake_ssl_client_socket.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | |
10 #include <cstdlib> | 9 #include <cstdlib> |
| 10 #include <utility> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
17 | 17 |
18 namespace jingle_glue { | 18 namespace jingle_glue { |
19 | 19 |
20 namespace { | 20 namespace { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 arraysize(kSslClientHello)); | 74 arraysize(kSslClientHello)); |
75 } | 75 } |
76 | 76 |
77 base::StringPiece FakeSSLClientSocket::GetSslServerHello() { | 77 base::StringPiece FakeSSLClientSocket::GetSslServerHello() { |
78 return base::StringPiece(reinterpret_cast<const char*>(kSslServerHello), | 78 return base::StringPiece(reinterpret_cast<const char*>(kSslServerHello), |
79 arraysize(kSslServerHello)); | 79 arraysize(kSslServerHello)); |
80 } | 80 } |
81 | 81 |
82 FakeSSLClientSocket::FakeSSLClientSocket( | 82 FakeSSLClientSocket::FakeSSLClientSocket( |
83 scoped_ptr<net::StreamSocket> transport_socket) | 83 scoped_ptr<net::StreamSocket> transport_socket) |
84 : transport_socket_(transport_socket.Pass()), | 84 : transport_socket_(std::move(transport_socket)), |
85 next_handshake_state_(STATE_NONE), | 85 next_handshake_state_(STATE_NONE), |
86 handshake_completed_(false), | 86 handshake_completed_(false), |
87 write_buf_(NewDrainableIOBufferWithSize(arraysize(kSslClientHello))), | 87 write_buf_(NewDrainableIOBufferWithSize(arraysize(kSslClientHello))), |
88 read_buf_(NewDrainableIOBufferWithSize(arraysize(kSslServerHello))) { | 88 read_buf_(NewDrainableIOBufferWithSize(arraysize(kSslServerHello))) { |
89 CHECK(transport_socket_.get()); | 89 CHECK(transport_socket_.get()); |
90 std::memcpy(write_buf_->data(), kSslClientHello, arraysize(kSslClientHello)); | 90 std::memcpy(write_buf_->data(), kSslClientHello, arraysize(kSslClientHello)); |
91 } | 91 } |
92 | 92 |
93 FakeSSLClientSocket::~FakeSSLClientSocket() {} | 93 FakeSSLClientSocket::~FakeSSLClientSocket() {} |
94 | 94 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 net::ConnectionAttempts* out) const { | 351 net::ConnectionAttempts* out) const { |
352 out->clear(); | 352 out->clear(); |
353 } | 353 } |
354 | 354 |
355 int64_t FakeSSLClientSocket::GetTotalReceivedBytes() const { | 355 int64_t FakeSSLClientSocket::GetTotalReceivedBytes() const { |
356 NOTIMPLEMENTED(); | 356 NOTIMPLEMENTED(); |
357 return 0; | 357 return 0; |
358 } | 358 } |
359 | 359 |
360 } // namespace jingle_glue | 360 } // namespace jingle_glue |
OLD | NEW |