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

Side by Side Diff: headless/lib/browser/headless_url_request_context_getter.h

Issue 2977693003: Use TaskRunner passed in to URLRequestContextBuilder only for the cache (Closed)
Patch Set: Actually, don't need to set the thread everywhere Created 3 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_
6 #define HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ 6 #define HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() 46 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
47 const override; 47 const override;
48 48
49 net::HostResolver* host_resolver() const; 49 net::HostResolver* host_resolver() const;
50 50
51 protected: 51 protected:
52 ~HeadlessURLRequestContextGetter() override; 52 ~HeadlessURLRequestContextGetter() override;
53 53
54 private: 54 private:
55 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 55 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
56 // TODO(eseckler): This should become a SequencedTaskRunner once net:: APIs
57 // accept a SequencedTaskRunner, see https://crbug.com/735368.
58 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
59 56
60 // The |options| object given to the constructor is not guaranteed to outlive 57 // The |options| object given to the constructor is not guaranteed to outlive
61 // this class, so we make copies of the parts we need to access on the IO 58 // this class, so we make copies of the parts we need to access on the IO
62 // thread. 59 // thread.
63 std::string user_agent_; 60 std::string user_agent_;
64 std::string host_resolver_rules_; 61 std::string host_resolver_rules_;
65 const net::ProxyConfig* proxy_config_; // Not owned. 62 const net::ProxyConfig* proxy_config_; // Not owned.
66 63
67 std::unique_ptr<net::ProxyConfigService> proxy_config_service_; 64 std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
68 std::unique_ptr<net::URLRequestContext> url_request_context_; 65 std::unique_ptr<net::URLRequestContext> url_request_context_;
69 content::ProtocolHandlerMap protocol_handlers_; 66 content::ProtocolHandlerMap protocol_handlers_;
70 content::URLRequestInterceptorScopedVector request_interceptors_; 67 content::URLRequestInterceptorScopedVector request_interceptors_;
71 net::NetLog* net_log_; // Not owned. 68 net::NetLog* net_log_; // Not owned.
72 HeadlessBrowserContextImpl* headless_browser_context_; // Not owned. 69 HeadlessBrowserContextImpl* headless_browser_context_; // Not owned.
73 70
74 DISALLOW_COPY_AND_ASSIGN(HeadlessURLRequestContextGetter); 71 DISALLOW_COPY_AND_ASSIGN(HeadlessURLRequestContextGetter);
75 }; 72 };
76 73
77 } // namespace headless 74 } // namespace headless
78 75
79 #endif // HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ 76 #endif // HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698