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

Unified Diff: sync/internal_api/http_bridge.cc

Issue 311393002: Add URLRequestJobFactories to URLRequestContexts without one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add two more that aren't tested Created 6 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: sync/internal_api/http_bridge.cc
diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc
index ffcaf9a9c2e5cc728322c1b83306df60a9693fd4..c4e096ca09e4d2ed55ae2c6b090809a44297e73a 100644
--- a/sync/internal_api/http_bridge.cc
+++ b/sync/internal_api/http_bridge.cc
@@ -16,6 +16,7 @@
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_job_factory_impl.h"
#include "net/url_request/url_request_status.h"
#include "sync/internal_api/public/base/cancelation_signal.h"
@@ -122,7 +123,8 @@ HttpBridge::RequestContext::RequestContext(
network_task_runner,
const std::string& user_agent)
: baseline_context_(baseline_context),
- network_task_runner_(network_task_runner) {
+ network_task_runner_(network_task_runner),
+ job_factory_(new net::URLRequestJobFactoryImpl()) {
DCHECK(!user_agent.empty());
// Create empty, in-memory cookie store.
@@ -133,6 +135,9 @@ HttpBridge::RequestContext::RequestContext(
set_proxy_service(baseline_context->proxy_service());
set_ssl_config_service(baseline_context->ssl_config_service());
+ // Use its own job factory, which only supports http and https.
+ set_job_factory(job_factory_.get());
+
// We want to share the HTTP session data with the network layer factory,
// which includes auth_cache for proxies.
// Session is not refcounted so we need to be careful to not lose the parent

Powered by Google App Engine
This is Rietveld 408576698