| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/proxy/mock_proxy_resolver.h" | 5 #include "net/proxy/mock_proxy_resolver.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 scoped_refptr<MockAsyncProxyResolverFactory::Request> keep_alive(this); | 88 scoped_refptr<MockAsyncProxyResolverFactory::Request> keep_alive(this); |
| 89 factory_->RemovePendingRequest(this); | 89 factory_->RemovePendingRequest(this); |
| 90 factory_ = nullptr; | 90 factory_ = nullptr; |
| 91 callback_.Run(rv); | 91 callback_.Run(rv); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void MockAsyncProxyResolverFactory::Request::CompleteNowWithForwarder( | 94 void MockAsyncProxyResolverFactory::Request::CompleteNowWithForwarder( |
| 95 int rv, | 95 int rv, |
| 96 ProxyResolver* resolver) { | 96 ProxyResolver* resolver) { |
| 97 DCHECK(resolver); | 97 DCHECK(resolver); |
| 98 CompleteNow(rv, base::WrapUnique(new ForwardingProxyResolver(resolver))); | 98 CompleteNow(rv, base::MakeUnique<ForwardingProxyResolver>(resolver)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void MockAsyncProxyResolverFactory::Request::FactoryDestroyed() { | 101 void MockAsyncProxyResolverFactory::Request::FactoryDestroyed() { |
| 102 factory_ = nullptr; | 102 factory_ = nullptr; |
| 103 } | 103 } |
| 104 | 104 |
| 105 class MockAsyncProxyResolverFactory::Job | 105 class MockAsyncProxyResolverFactory::Job |
| 106 : public ProxyResolverFactory::Request { | 106 : public ProxyResolverFactory::Request { |
| 107 public: | 107 public: |
| 108 explicit Job( | 108 explicit Job( |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 void ForwardingProxyResolver::CancelRequest(RequestHandle request) { | 167 void ForwardingProxyResolver::CancelRequest(RequestHandle request) { |
| 168 impl_->CancelRequest(request); | 168 impl_->CancelRequest(request); |
| 169 } | 169 } |
| 170 | 170 |
| 171 LoadState ForwardingProxyResolver::GetLoadState(RequestHandle request) const { | 171 LoadState ForwardingProxyResolver::GetLoadState(RequestHandle request) const { |
| 172 return impl_->GetLoadState(request); | 172 return impl_->GetLoadState(request); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace net | 175 } // namespace net |
| OLD | NEW |