| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "chrome/browser/local_discovery/service_discovery_client.h" | 7 #include "chrome/browser/local_discovery/service_discovery_client.h" |
| 8 | 8 |
| 9 namespace local_discovery { | 9 namespace local_discovery { |
| 10 | 10 |
| 11 ServiceDescription::ServiceDescription() { | 11 ServiceDescription::ServiceDescription() { |
| 12 } | 12 } |
| 13 | 13 |
| 14 ServiceDescription::ServiceDescription(const ServiceDescription& other) = |
| 15 default; |
| 16 |
| 14 ServiceDescription::~ServiceDescription() { | 17 ServiceDescription::~ServiceDescription() { |
| 15 } | 18 } |
| 16 | 19 |
| 17 std::string ServiceDescription::instance_name() const { | 20 std::string ServiceDescription::instance_name() const { |
| 18 // TODO(noamsml): Once we have escaping working, get this to | 21 // TODO(noamsml): Once we have escaping working, get this to |
| 19 // parse escaped domains. | 22 // parse escaped domains. |
| 20 size_t first_period = service_name.find_first_of('.'); | 23 size_t first_period = service_name.find_first_of('.'); |
| 21 return service_name.substr(0, first_period); | 24 return service_name.substr(0, first_period); |
| 22 } | 25 } |
| 23 | 26 |
| 24 std::string ServiceDescription::service_type() const { | 27 std::string ServiceDescription::service_type() const { |
| 25 // TODO(noamsml): Once we have escaping working, get this to | 28 // TODO(noamsml): Once we have escaping working, get this to |
| 26 // parse escaped domains. | 29 // parse escaped domains. |
| 27 size_t first_period = service_name.find_first_of('.'); | 30 size_t first_period = service_name.find_first_of('.'); |
| 28 if (first_period == std::string::npos) | 31 if (first_period == std::string::npos) |
| 29 return ""; | 32 return ""; |
| 30 return service_name.substr(first_period+1); | 33 return service_name.substr(first_period+1); |
| 31 } | 34 } |
| 32 | 35 |
| 33 } // namespace local_discovery | 36 } // namespace local_discovery |
| OLD | NEW |