Initialize job factory as early as possible.

Fixes atom/atom#3255.
This commit is contained in:
Cheng Zhao 2014-08-15 11:35:13 +08:00
parent e8d1c69ea8
commit 1b70ca2098
2 changed files with 2 additions and 7 deletions

View file

@ -19,7 +19,7 @@ using content::BrowserThread;
namespace atom {
AtomBrowserContext::AtomBrowserContext()
: job_factory_(NULL) {
: job_factory_(new AtomURLRequestJobFactory) {
}
AtomBrowserContext::~AtomBrowserContext() {
@ -29,7 +29,6 @@ scoped_ptr<net::URLRequestJobFactory>
AtomBrowserContext::CreateURLRequestJobFactory(
content::ProtocolHandlerMap* handlers,
content::ProtocolHandlerScopedVector* interceptors) {
job_factory_ = new AtomURLRequestJobFactory;
scoped_ptr<AtomURLRequestJobFactory> job_factory(job_factory_);
for (content::ProtocolHandlerMap::iterator it = handlers->begin();