Chromium Code Reviews| Index: net/dns/dns_client.cc |
| diff --git a/net/dns/dns_client.cc b/net/dns/dns_client.cc |
| index 274cefa19d0af2c892ad5f6715cf838e15b1ceec..d4390ba490e2bc659c579c470f12d3f60978d1dc 100644 |
| --- a/net/dns/dns_client.cc |
| +++ b/net/dns/dns_client.cc |
| @@ -21,6 +21,7 @@ namespace net { |
| namespace { |
| +#if !defined(OS_IOS) |
|
Charlie Harrison
2016/07/26 13:49:42
Why is this necessary?
Julia Tuttle
2016/07/26 21:10:13
It's not! Fixed.
|
| class DnsClientImpl : public DnsClient { |
| public: |
| DnsClientImpl(NetLog* net_log, |
| @@ -56,6 +57,18 @@ class DnsClientImpl : public DnsClient { |
| AddressSorter* GetAddressSorter() override { return address_sorter_.get(); } |
| + std::unique_ptr<const base::Value> GetPersistentData() const override { |
| + if (!session_) |
| + return std::unique_ptr<const base::Value>(); |
| + return session_->GetPersistentData(); |
| + } |
| + |
| + void ApplyPersistentData(const base::Value& data) override { |
| + if (!session_) |
| + return; |
| + session_->ApplyPersistentData(data); |
| + } |
| + |
| private: |
| scoped_refptr<DnsSession> session_; |
| std::unique_ptr<DnsTransactionFactory> factory_; |
| @@ -68,14 +81,26 @@ class DnsClientImpl : public DnsClient { |
| DISALLOW_COPY_AND_ASSIGN(DnsClientImpl); |
| }; |
| +#endif // !defined(OS_IOS) |
| } // namespace |
| +void DnsClient::ApplyPersistentData(const base::Value& data) {} |
| + |
| +std::unique_ptr<const base::Value> DnsClient::GetPersistentData() const { |
| + return std::unique_ptr<const base::Value>(); |
| +} |
| + |
| // static |
| std::unique_ptr<DnsClient> DnsClient::CreateClient(NetLog* net_log) { |
| +#if !defined(OS_IOS) |
| return base::WrapUnique( |
| new DnsClientImpl(net_log, ClientSocketFactory::GetDefaultFactory(), |
| base::Bind(&base::RandInt))); |
| +#else // defined(OS_IOS) |
| + NOTIMPLEMENTED(); |
| + return std::unique_ptr<DnsClient>(nullptr); |
| +#endif // defined(OS_IOS) |
| } |
| // static |
| @@ -83,8 +108,13 @@ std::unique_ptr<DnsClient> DnsClient::CreateClientForTesting( |
| NetLog* net_log, |
| ClientSocketFactory* socket_factory, |
| const RandIntCallback& rand_int_callback) { |
| +#if !defined(OS_IOS) |
| return base::WrapUnique( |
| new DnsClientImpl(net_log, socket_factory, rand_int_callback)); |
| +#else // defined(OS_IOS) |
| + NOTIMPLEMENTED(); |
| + return std::unique_ptr<DnsClient>(nullptr); |
| +#endif // defined(OS_IOS) |
| } |
| } // namespace net |