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 29 matching lines...) Expand all Loading... | |
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>( |
47 assignment.engine_endpoint, nullptr)); | 47 assignment.engine_endpoint, nullptr)); |
48 transport_type = "TCP"; | 48 transport_type = "TCP"; |
49 break; | 49 break; |
50 case Assignment::GRPC: | |
51 // TODO(perumaal): Unimplemented as yet. | |
52 // connection_manager_->AddTransport( | |
53 // base::MakeUnique<GrpcClientTransport>(endpoint)); | |
54 transport_type = "GRPC"; | |
55 NOTIMPLEMENTED(); | |
Wez
2016/11/09 22:47:17
nit: For future CLs, please don't add flags for un
perumaal
2016/11/10 02:05:05
Got it.
| |
56 break; | |
50 case Assignment::UNKNOWN: | 57 case Assignment::UNKNOWN: |
51 LOG(FATAL) << "Unknown transport type."; | 58 LOG(FATAL) << "Unknown transport type."; |
52 break; | 59 break; |
53 } | 60 } |
54 | 61 |
55 VLOG(1) << "Connecting to " << assignment.engine_endpoint.ToString() << " (" | 62 VLOG(1) << "Connecting to " << assignment.engine_endpoint.ToString() << " (" |
56 << transport_type << ")"; | 63 << transport_type << ")"; |
57 | 64 |
58 connection_manager_->Connect(); | 65 connection_manager_->Connect(); |
59 } | 66 } |
(...skipping 18 matching lines...) Expand all Loading... | |
78 if (result >= 0) { | 85 if (result >= 0) { |
79 VLOG(1) << "Disconnected with reason: " << result; | 86 VLOG(1) << "Disconnected with reason: " << result; |
80 } else { | 87 } else { |
81 VLOG(1) << "Connection error: " << net::ErrorToString(result); | 88 VLOG(1) << "Connection error: " << net::ErrorToString(result); |
82 } | 89 } |
83 network_observer_->OnDisconnected(result); | 90 network_observer_->OnDisconnected(result); |
84 } | 91 } |
85 | 92 |
86 } // namespace client | 93 } // namespace client |
87 } // namespace blimp | 94 } // namespace blimp |
OLD | NEW |