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

Side by Side Diff: chrome/browser/media/router/discovery/discovery_network_list.h

Issue 2750453002: Add DiscoveryNetworkMonitor implementation (Closed)
Patch Set: Temporarily fix Windows and Mac compilation Created 3 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
(Empty)
1 // Copyright (c) 2017 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DISCOVERY_NETWORK_LIST_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DISCOVERY_NETWORK_LIST_H_
7
8 #include <algorithm>
9 #include <vector>
10
11 #include "chrome/browser/media/router/discovery/discovery_network_info.h"
12
13 // Returns a list of information about each network to which the host is
14 // connected, stable-sorted by network ID (stable relative to the order they are
15 // returned by the OS during enumeration).
16 std::vector<DiscoveryNetworkInfo> GetDiscoveryNetworkInfoList();
17
18 // Stable sort a sequence of DiscoveryNetworkInfo objects given by the iterators
19 // [first, last).
20 template <typename InputIt>
21 void StableSortDiscoveryNetworkInfo(InputIt first, InputIt last) {
22 std::stable_sort(
23 first, last,
24 [](const DiscoveryNetworkInfo& info1, const DiscoveryNetworkInfo& info2) {
25 return info1.network_id < info2.network_id;
26 });
27 }
28
29 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DISCOVERY_NETWORK_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698