Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Side by Side Diff: net/proxy/mojo_proxy_resolver_impl.h

Issue 896203003: Implement utility-side proxy resolver Mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy-diffbase
Patch Set: fix windows compile Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/net.gypi ('k') | net/proxy/mojo_proxy_resolver_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_
6 #define NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_
7
8 #include <queue>
9 #include <set>
10
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "net/interfaces/proxy_resolver_service.mojom.h"
14
15 namespace net {
16
17 class ProxyResolver;
18 class ProxyResolverScriptData;
19
20 class MojoProxyResolverImpl : public interfaces::ProxyResolver {
21 public:
22 explicit MojoProxyResolverImpl(scoped_ptr<net::ProxyResolver> resolver);
23
24 ~MojoProxyResolverImpl() override;
25
26 private:
27 class Job;
28
29 struct SetPacScriptRequest {
30 SetPacScriptRequest(
31 const scoped_refptr<ProxyResolverScriptData>& script_data,
32 const mojo::Callback<void(int32_t)>& callback);
33 ~SetPacScriptRequest();
34
35 // The script data for this request.
36 scoped_refptr<ProxyResolverScriptData> script_data;
37
38 // The callback to run to report the result of this request.
39 const mojo::Callback<void(int32_t)> callback;
40 };
41
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;
48
49 void DeleteJob(Job* job);
50
51 void StartSetPacScript();
52 void SetPacScriptDone(int result);
53
54 scoped_ptr<net::ProxyResolver> resolver_;
55 std::set<Job*> resolve_jobs_;
56
57 std::queue<SetPacScriptRequest> set_pac_script_requests_;
58
59 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverImpl);
60 };
61
62 } // namespace net
63
64 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | net/proxy/mojo_proxy_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698