| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/core/session/client_network_components.h" | 5 #include "blimp/client/core/session/client_network_components.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 io_thread_checker_.DetachFromThread(); | 26 io_thread_checker_.DetachFromThread(); |
| 27 DCHECK(!connection_manager_); | 27 DCHECK(!connection_manager_); |
| 28 connection_manager_ = base::MakeUnique<ClientConnectionManager>(this); | 28 connection_manager_ = base::MakeUnique<ClientConnectionManager>(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void ClientNetworkComponents::ConnectWithAssignment( | 31 void ClientNetworkComponents::ConnectWithAssignment( |
| 32 const Assignment& assignment) { | 32 const Assignment& assignment) { |
| 33 DCHECK(io_thread_checker_.CalledOnValidThread()); | 33 DCHECK(io_thread_checker_.CalledOnValidThread()); |
| 34 DCHECK(connection_manager_); | 34 DCHECK(connection_manager_); |
| 35 | 35 |
| 36 connection_manager_->set_client_token(assignment.client_token); | 36 connection_manager_->set_client_auth_token(assignment.client_auth_token); |
| 37 const char* transport_type = "UNKNOWN"; | 37 const char* transport_type = "UNKNOWN"; |
| 38 switch (assignment.transport_protocol) { | 38 switch (assignment.transport_protocol) { |
| 39 case Assignment::SSL: | 39 case Assignment::SSL: |
| 40 DCHECK(assignment.cert); | 40 DCHECK(assignment.cert); |
| 41 connection_manager_->AddTransport(base::MakeUnique<SSLClientTransport>( | 41 connection_manager_->AddTransport(base::MakeUnique<SSLClientTransport>( |
| 42 assignment.engine_endpoint, std::move(assignment.cert), nullptr)); | 42 assignment.engine_endpoint, std::move(assignment.cert), nullptr)); |
| 43 transport_type = "SSL"; | 43 transport_type = "SSL"; |
| 44 break; | 44 break; |
| 45 case Assignment::TCP: | 45 case Assignment::TCP: |
| 46 connection_manager_->AddTransport(base::MakeUnique<TCPClientTransport>( | 46 connection_manager_->AddTransport(base::MakeUnique<TCPClientTransport>( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (result >= 0) { | 78 if (result >= 0) { |
| 79 VLOG(1) << "Disconnected with reason: " << result; | 79 VLOG(1) << "Disconnected with reason: " << result; |
| 80 } else { | 80 } else { |
| 81 VLOG(1) << "Connection error: " << net::ErrorToString(result); | 81 VLOG(1) << "Connection error: " << net::ErrorToString(result); |
| 82 } | 82 } |
| 83 network_observer_->OnDisconnected(result); | 83 network_observer_->OnDisconnected(result); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace client | 86 } // namespace client |
| 87 } // namespace blimp | 87 } // namespace blimp |
| OLD | NEW |