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

Side by Side Diff: remoting/test/host_info.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various builds. Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/test/host_info.h" 5 #include "remoting/test/host_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 namespace test { 10 namespace test {
11 11
12 HostInfo::HostInfo() {} 12 HostInfo::HostInfo() {}
13 HostInfo::HostInfo(const HostInfo& other) = default; 13 HostInfo::HostInfo(const HostInfo& other) = default;
14 14
15 HostInfo::~HostInfo() {} 15 HostInfo::~HostInfo() {}
16 16
17 bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) { 17 bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) {
18 const base::ListValue* list_value = nullptr; 18 const base::ListValue* list_value = nullptr;
19 19
20 // Add TokenUrlPatterns to HostInfo. 20 // Add TokenUrlPatterns to HostInfo.
21 if (host_info.GetList("tokenUrlPatterns", &list_value)) { 21 if (host_info.GetList("tokenUrlPatterns", &list_value)) {
22 if (!list_value->empty()) { 22 if (!list_value->empty()) {
23 for (base::Value* item : *list_value) { 23 for (const auto& item : *list_value) {
24 std::string token_url_pattern; 24 std::string token_url_pattern;
25 if (!item->GetAsString(&token_url_pattern)) { 25 if (!item->GetAsString(&token_url_pattern)) {
26 return false; 26 return false;
27 } 27 }
28 token_url_patterns.push_back(token_url_pattern); 28 token_url_patterns.push_back(token_url_pattern);
29 } 29 }
30 } 30 }
31 } 31 }
32 32
33 std::string response_status; 33 std::string response_status;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 connection_setup_info.host_jid = host_jid; 83 connection_setup_info.host_jid = host_jid;
84 connection_setup_info.host_name = host_name; 84 connection_setup_info.host_name = host_name;
85 connection_setup_info.pin = pin; 85 connection_setup_info.pin = pin;
86 connection_setup_info.public_key = public_key; 86 connection_setup_info.public_key = public_key;
87 connection_setup_info.user_name = user_name; 87 connection_setup_info.user_name = user_name;
88 return connection_setup_info; 88 return connection_setup_info;
89 } 89 }
90 90
91 } // namespace test 91 } // namespace test
92 } // namespace remoting 92 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698