ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / net / proxy / mojo_proxy_resolver_impl.h
blob2cbf8bbe70fba3a3bc6f372feffb446dc5136528
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_
8 #include <queue>
9 #include <set>
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "net/interfaces/proxy_resolver_service.mojom.h"
15 namespace net {
17 class ProxyResolver;
18 class ProxyResolverScriptData;
20 class MojoProxyResolverImpl : public interfaces::ProxyResolver {
21 public:
22 explicit MojoProxyResolverImpl(scoped_ptr<net::ProxyResolver> resolver);
24 ~MojoProxyResolverImpl() override;
26 private:
27 class Job;
29 struct SetPacScriptRequest {
30 SetPacScriptRequest(
31 const scoped_refptr<ProxyResolverScriptData>& script_data,
32 const mojo::Callback<void(int32_t)>& callback);
33 ~SetPacScriptRequest();
35 // The script data for this request.
36 scoped_refptr<ProxyResolverScriptData> script_data;
38 // The callback to run to report the result of this request.
39 const mojo::Callback<void(int32_t)> callback;
42 // interfaces::ProxyResolver overrides.
43 void SetPacScript(const mojo::String& data,
44 const mojo::Callback<void(int32_t)>& callback) override;
45 void GetProxyForUrl(
46 const mojo::String& url,
47 interfaces::ProxyResolverRequestClientPtr client) override;
49 void DeleteJob(Job* job);
51 void StartSetPacScript();
52 void SetPacScriptDone(int result);
54 scoped_ptr<net::ProxyResolver> resolver_;
55 std::set<Job*> resolve_jobs_;
57 std::queue<SetPacScriptRequest> set_pac_script_requests_;
59 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverImpl);
62 } // namespace net
64 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_