Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: chrome/common/local_discovery/service_discovery_client.cc

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
6
5 #include "chrome/common/local_discovery/service_discovery_client.h" 7 #include "chrome/common/local_discovery/service_discovery_client.h"
6 8
7 namespace local_discovery { 9 namespace local_discovery {
8 10
9 ServiceDescription::ServiceDescription() { 11 ServiceDescription::ServiceDescription() {
10 } 12 }
11 13
12 ServiceDescription::~ServiceDescription() { 14 ServiceDescription::~ServiceDescription() {
13 } 15 }
14 16
15 std::string ServiceDescription::instance_name() const { 17 std::string ServiceDescription::instance_name() const {
16 // TODO(noamsml): Once we have escaping working, get this to 18 // TODO(noamsml): Once we have escaping working, get this to
17 // parse escaped domains. 19 // parse escaped domains.
18 size_t first_period = service_name.find_first_of('.'); 20 size_t first_period = service_name.find_first_of('.');
19 return service_name.substr(0, first_period); 21 return service_name.substr(0, first_period);
20 } 22 }
21 23
22 std::string ServiceDescription::service_type() const { 24 std::string ServiceDescription::service_type() const {
23 // TODO(noamsml): Once we have escaping working, get this to 25 // TODO(noamsml): Once we have escaping working, get this to
24 // parse escaped domains. 26 // parse escaped domains.
25 size_t first_period = service_name.find_first_of('.'); 27 size_t first_period = service_name.find_first_of('.');
26 if (first_period == std::string::npos) 28 if (first_period == std::string::npos)
27 return ""; 29 return "";
28 return service_name.substr(first_period+1); 30 return service_name.substr(first_period+1);
29 } 31 }
30 32
31 } // namespace local_discovery 33 } // namespace local_discovery
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698