OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "remoting/test/chromoting_host_info.h" | |
6 | |
7 #include "base/logging.h" | |
8 | |
9 namespace remoting { | |
10 namespace test { | |
11 | |
12 ChromotingHostInfo::ChromotingHostInfo(const base::DictionaryValue& item) { | |
13 const base::ListValue* listValue = nullptr; | |
14 item.GetList("data.tokenUrlPatterns", &listValue); | |
15 | |
16 // Add TokenUrlPatterns to ChromotingHostInfo | |
17 if(listValue != nullptr) { | |
joedow
2015/07/01 03:39:33
add space between if and open paren
tonychun
2015/07/06 20:11:50
Done.
| |
18 int size = listValue->GetSize(); | |
19 if (size > 0) { | |
20 std::string tokenUrlPattern; | |
21 for(int i = 0; i < size; ++i) { | |
joedow
2015/07/01 03:39:33
add space between for and open paren (please run c
tonychun
2015/07/06 20:11:50
Done.
| |
22 listValue->GetString(i,&tokenUrlPattern); | |
joedow
2015/07/01 03:39:33
add space between comma and ampersand
tonychun
2015/07/06 20:11:50
Done.
| |
23 if(!tokenUrlPattern.empty()) { | |
joedow
2015/07/01 03:39:33
Add space between if and open paren (please run cp
tonychun
2015/07/06 20:11:50
Done.
| |
24 tokenUrlPatterns.push_back(tokenUrlPattern); | |
25 } | |
26 } | |
27 } | |
28 } | |
29 | |
30 item.GetString("hostId", &id); | |
joedow
2015/07/01 03:39:33
tokenUrlPatterns is under 'data' per the code on l
tonychun
2015/07/06 20:11:50
This is a bug. My unit test would have flagged thi
| |
31 item.GetString("jabberId", &jid); | |
32 item.GetString("hostName", &name); | |
33 item.GetString("hostOfflineReason", &offline_reason); | |
34 item.GetString("publicKey", &public_key); | |
35 | |
36 std::string status; | |
37 item.GetString("status", &status); | |
38 is_online = (status == "ONLINE") ? true : false; | |
joedow
2015/07/01 03:39:33
Are there other statuses? I'm thinking that an en
joedow
2015/07/01 03:39:33
"ONLINE" should be a constant in a namespace at th
tonychun
2015/07/06 20:11:50
Done.
| |
39 } | |
40 | |
41 ChromotingHostInfo::~ChromotingHostInfo() { | |
42 } | |
43 | |
44 } // namespace test | |
45 } // namespace remoting | |
OLD | NEW |