OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_DNS_ADDRESS_SORTER_POSIX_H_ | 5 #ifndef NET_DNS_ADDRESS_SORTER_POSIX_H_ |
6 #define NET_DNS_ADDRESS_SORTER_POSIX_H_ | 6 #define NET_DNS_ADDRESS_SORTER_POSIX_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 bool native; | 58 bool native; |
59 }; | 59 }; |
60 | 60 |
61 typedef std::map<IPAddressNumber, SourceAddressInfo> SourceAddressMap; | 61 typedef std::map<IPAddressNumber, SourceAddressInfo> SourceAddressMap; |
62 | 62 |
63 explicit AddressSorterPosix(ClientSocketFactory* socket_factory); | 63 explicit AddressSorterPosix(ClientSocketFactory* socket_factory); |
64 virtual ~AddressSorterPosix(); | 64 virtual ~AddressSorterPosix(); |
65 | 65 |
66 // AddressSorter: | 66 // AddressSorter: |
67 virtual void Sort(const AddressList& list, | 67 virtual void Sort(const AddressList& list, |
68 const CallbackType& callback) const OVERRIDE; | 68 const CallbackType& callback) const override; |
69 | 69 |
70 private: | 70 private: |
71 friend class AddressSorterPosixTest; | 71 friend class AddressSorterPosixTest; |
72 | 72 |
73 // NetworkChangeNotifier::IPAddressObserver: | 73 // NetworkChangeNotifier::IPAddressObserver: |
74 virtual void OnIPAddressChanged() OVERRIDE; | 74 virtual void OnIPAddressChanged() override; |
75 | 75 |
76 // Fills |info| with values for |address| from policy tables. | 76 // Fills |info| with values for |address| from policy tables. |
77 void FillPolicy(const IPAddressNumber& address, | 77 void FillPolicy(const IPAddressNumber& address, |
78 SourceAddressInfo* info) const; | 78 SourceAddressInfo* info) const; |
79 | 79 |
80 // Mutable to allow using default values for source addresses which were not | 80 // Mutable to allow using default values for source addresses which were not |
81 // found in most recent OnIPAddressChanged. | 81 // found in most recent OnIPAddressChanged. |
82 mutable SourceAddressMap source_map_; | 82 mutable SourceAddressMap source_map_; |
83 | 83 |
84 ClientSocketFactory* socket_factory_; | 84 ClientSocketFactory* socket_factory_; |
85 PolicyTable precedence_table_; | 85 PolicyTable precedence_table_; |
86 PolicyTable label_table_; | 86 PolicyTable label_table_; |
87 PolicyTable ipv4_scope_table_; | 87 PolicyTable ipv4_scope_table_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(AddressSorterPosix); | 89 DISALLOW_COPY_AND_ASSIGN(AddressSorterPosix); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace net | 92 } // namespace net |
93 | 93 |
94 #endif // NET_DNS_ADDRESS_SORTER_POSIX_H_ | 94 #endif // NET_DNS_ADDRESS_SORTER_POSIX_H_ |
OLD | NEW |