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

Unified Diff: headless/lib/browser/headless_url_request_context_getter.cc

Issue 2092773002: headless: Allow per-context protocol handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: headless/lib/browser/headless_url_request_context_getter.cc
diff --git a/headless/lib/browser/headless_url_request_context_getter.cc b/headless/lib/browser/headless_url_request_context_getter.cc
index 40e58a1107d6dc7dfe33ef38d87622949e811094..d253e5c267f6fe21dcb316e5ad632bd19642c2ba 100644
--- a/headless/lib/browser/headless_url_request_context_getter.cc
+++ b/headless/lib/browser/headless_url_request_context_getter.cc
@@ -20,6 +20,7 @@ HeadlessURLRequestContextGetter::HeadlessURLRequestContextGetter(
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
content::ProtocolHandlerMap* protocol_handlers,
+ ProtocolHandlerMap context_protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors,
HeadlessBrowser::Options* options)
: io_task_runner_(std::move(io_task_runner)),
@@ -38,6 +39,12 @@ HeadlessURLRequestContextGetter::HeadlessURLRequestContextGetter(
pair.second.release());
}
options->protocol_handlers.clear();
+ for (auto& pair : context_protocol_handlers) {
+ protocol_handlers_[pair.first] =
+ linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
+ pair.second.release());
+ }
+ context_protocol_handlers.clear();
// We must create the proxy config service on the UI loop on Linux because it
// must synchronously run on the glib message loop. This will be passed to
« no previous file with comments | « headless/lib/browser/headless_url_request_context_getter.h ('k') | headless/lib/headless_browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698