1 // Copyright 2015 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.
5 #ifndef NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_
6 #define NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "net/interfaces/proxy_resolver_service.mojom.h"
15 #include "net/proxy/proxy_resolver.h"
19 class MojoProxyResolverImpl
: public interfaces::ProxyResolver
{
21 MojoProxyResolverImpl(
22 scoped_ptr
<net::ProxyResolver
> resolver
,
24 void(const net::ProxyResolver::LoadStateChangedCallback
&)>&
25 load_state_change_callback_setter
);
27 ~MojoProxyResolverImpl() override
;
32 // interfaces::ProxyResolver overrides.
34 const mojo::String
& url
,
35 interfaces::ProxyResolverRequestClientPtr client
) override
;
37 void DeleteJob(Job
* job
);
39 // Invoked when the LoadState of a request changes.
40 void LoadStateChanged(net::ProxyResolver::RequestHandle handle
,
41 LoadState load_state
);
43 scoped_ptr
<net::ProxyResolver
> resolver_
;
44 std::set
<Job
*> resolve_jobs_
;
45 std::map
<net::ProxyResolver::RequestHandle
, Job
*> request_handle_to_job_
;
47 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverImpl
);
52 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_