summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 00:41:29 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 00:41:29 +0000
commit2944afa8913462c5a6a873a8acb9d54a1741e627 (patch)
tree4ff0c5e953ca4cadc1dd4106b9c056a44f9e251e /sync
parent7e885e72f21fdeb77895f67ca086286e85347807 (diff)
downloadchromium_src-2944afa8913462c5a6a873a8acb9d54a1741e627.zip
chromium_src-2944afa8913462c5a6a873a8acb9d54a1741e627.tar.gz
chromium_src-2944afa8913462c5a6a873a8acb9d54a1741e627.tar.bz2
Add URLRequestJobFactories to URLRequestContexts without one.
Currently a URLRequestJobFactory is optional, as the global URLRequestJobManager passes jobs on to the URLRequestFilter and global http/https/ws/wss factories. In order to be able to eliminate the global URLRequestJobManager object, first have to give all contexts their own URLRequestJobFactory. BUG=81979 TBR=ajwong@chromium.org (Who actually signed off on this, but Rietveld ignored his email). Review URL: https://codereview.chromium.org/311393002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/internal_api/http_bridge.cc7
-rw-r--r--sync/internal_api/public/http_bridge.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc
index ffcaf9a..c4e096c 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
diff --git a/sync/internal_api/public/http_bridge.h b/sync/internal_api/public/http_bridge.h
index 145e36f..3988c7c 100644
--- a/sync/internal_api/public/http_bridge.h
+++ b/sync/internal_api/public/http_bridge.h
@@ -33,6 +33,7 @@ namespace net {
class HttpResponseHeaders;
class HttpUserAgentSettings;
class URLFetcher;
+class URLRequestJobFactory;
}
namespace syncer {
@@ -72,6 +73,7 @@ class SYNC_EXPORT_PRIVATE HttpBridge
net::URLRequestContext* const baseline_context_;
const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
scoped_ptr<net::HttpUserAgentSettings> http_user_agent_settings_;
+ scoped_ptr<net::URLRequestJobFactory> job_factory_;
DISALLOW_COPY_AND_ASSIGN(RequestContext);
};