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

Side by Side Diff: remoting/client/ios/facade/host_list_fetcher.cc

Issue 2809793002: Build Chrome Remote Desktop for iOS in Chromium trybots. (Closed)
Patch Set: Second fixup from CL 2809023003. Created 3 years, 8 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
« no previous file with comments | « remoting/client/ios/facade/host_info.cc ('k') | remoting/remoting_enable.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/client/ios/facade/host_list_fetcher.h" 5 #include "remoting/client/ios/facade/host_list_fetcher.h"
6 6
7 #include <thread> 7 #include <thread>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return false; 78 return false;
79 } 79 }
80 80
81 const base::ListValue* hosts = nullptr; 81 const base::ListValue* hosts = nullptr;
82 if (!data->GetList("items", &hosts)) { 82 if (!data->GetList("items", &hosts)) {
83 LOG(ERROR) << "Failed to find hosts in Hostlist response data"; 83 LOG(ERROR) << "Failed to find hosts in Hostlist response data";
84 return false; 84 return false;
85 } 85 }
86 86
87 // Any host_info with malformed data will not be added to the hostlist. 87 // Any host_info with malformed data will not be added to the hostlist.
88 base::DictionaryValue* host_dict; 88 const base::DictionaryValue* host_dict;
89 for (const auto& host_info : *hosts) { 89 for (const auto& host_info : *hosts) {
90 remoting::HostInfo host; 90 remoting::HostInfo host;
91 if (host_info->GetAsDictionary(&host_dict) && 91 if (host_info.GetAsDictionary(&host_dict) &&
92 host.ParseHostInfo(*host_dict)) { 92 host.ParseHostInfo(*host_dict)) {
93 hostlist->push_back(host); 93 hostlist->push_back(host);
94 } 94 }
95 } 95 }
96 return true; 96 return true;
97 } 97 }
98 98
99 void HostListFetcher::OnURLFetchComplete(const net::URLFetcher* source) { 99 void HostListFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
100 DCHECK(source); 100 DCHECK(source);
101 101
102 std::vector<HostInfo> hostlist; 102 std::vector<HostInfo> hostlist;
103 if (!ProcessResponse(&hostlist)) { 103 if (!ProcessResponse(&hostlist)) {
104 hostlist.clear(); 104 hostlist.clear();
105 } 105 }
106 base::ResetAndReturn(&hostlist_callback_).Run(hostlist); 106 base::ResetAndReturn(&hostlist_callback_).Run(hostlist);
107 } 107 }
108 108
109 } // namespace remoting 109 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/ios/facade/host_info.cc ('k') | remoting/remoting_enable.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698