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/session/assignment_source.h" | 5 #include "blimp/client/session/assignment_source.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 return Assignment(); | 169 return Assignment(); |
170 } | 170 } |
171 | 171 |
172 return assignment; | 172 return assignment; |
173 } | 173 } |
174 | 174 |
175 } // namespace | 175 } // namespace |
176 | 176 |
177 Assignment::Assignment() : transport_protocol(TransportProtocol::UNKNOWN) {} | 177 Assignment::Assignment() : transport_protocol(TransportProtocol::UNKNOWN) {} |
178 | 178 |
| 179 Assignment::Assignment(const Assignment& other) = default; |
| 180 |
179 Assignment::~Assignment() {} | 181 Assignment::~Assignment() {} |
180 | 182 |
181 bool Assignment::IsValid() const { | 183 bool Assignment::IsValid() const { |
182 if (engine_endpoint.address().empty() || engine_endpoint.port() == 0 || | 184 if (engine_endpoint.address().empty() || engine_endpoint.port() == 0 || |
183 transport_protocol == TransportProtocol::UNKNOWN) { | 185 transport_protocol == TransportProtocol::UNKNOWN) { |
184 return false; | 186 return false; |
185 } | 187 } |
186 if (transport_protocol == TransportProtocol::SSL && !cert) { | 188 if (transport_protocol == TransportProtocol::SSL && !cert) { |
187 return false; | 189 return false; |
188 } | 190 } |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 } | 373 } |
372 | 374 |
373 void AssignmentSource::OnJsonParseError(const std::string& error) { | 375 void AssignmentSource::OnJsonParseError(const std::string& error) { |
374 DLOG(ERROR) << "Error while parsing assigner JSON: " << error; | 376 DLOG(ERROR) << "Error while parsing assigner JSON: " << error; |
375 base::ResetAndReturn(&callback_) | 377 base::ResetAndReturn(&callback_) |
376 .Run(AssignmentSource::Result::RESULT_BAD_RESPONSE, Assignment()); | 378 .Run(AssignmentSource::Result::RESULT_BAD_RESPONSE, Assignment()); |
377 } | 379 } |
378 | 380 |
379 } // namespace client | 381 } // namespace client |
380 } // namespace blimp | 382 } // namespace blimp |
OLD | NEW |