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

Side by Side Diff: chrome/browser/local_discovery/device_description.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/local_discovery/device_description.h" 5 #include "chrome/browser/local_discovery/device_description.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "chrome/browser/local_discovery/privet_constants.h" 11 #include "chrome/browser/local_discovery/privet_constants.h"
12 #include "chrome/common/local_discovery/service_discovery_client.h" 12 #include "chrome/common/local_discovery/service_discovery_client.h"
13 13
14 namespace local_discovery { 14 namespace local_discovery {
15 15
16 namespace { 16 namespace {
17 17
18 std::string GetValueByName(const std::vector<std::string>& metadata, 18 std::string GetValueByName(const std::vector<std::string>& metadata,
19 const std::string& name) { 19 const std::string& name) {
20 std::string prefix(name + "="); 20 std::string prefix(name + "=");
21 for (const std::string& record : metadata) { 21 for (const std::string& record : metadata) {
22 if (StartsWithASCII(record, prefix, false)) { 22 if (base::StartsWithASCII(record, prefix, false)) {
23 return record.substr(prefix.size()); 23 return record.substr(prefix.size());
24 } 24 }
25 } 25 }
26 return std::string(); 26 return std::string();
27 } 27 }
28 28
29 } // namespace 29 } // namespace
30 30
31 DeviceDescription::DeviceDescription() : version(0) { 31 DeviceDescription::DeviceDescription() : version(0) {
32 } 32 }
(...skipping 15 matching lines...) Expand all
48 } else { 48 } else {
49 type = GetValueByName(metadata, kPrivetTxtKeyType); 49 type = GetValueByName(metadata, kPrivetTxtKeyType);
50 id = GetValueByName(metadata, kPrivetTxtKeyID); 50 id = GetValueByName(metadata, kPrivetTxtKeyID);
51 } 51 }
52 } 52 }
53 53
54 DeviceDescription::~DeviceDescription() { 54 DeviceDescription::~DeviceDescription() {
55 } 55 }
56 56
57 } // namespace local_discovery 57 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/google/google_brand.cc ('k') | chrome/browser/media/router/media_source_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698