From a67c54869fca3865bd0553bc63e14873790e4d7d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 7 May 2014 09:16:45 +0800 Subject: [PATCH] Make sure the job factory is created when initializing protocol module. Fixes atom/atom#1963, the regression came when moving to use native-mate to reimplment the APIs. --- atom/browser/api/atom_api_protocol.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atom/browser/api/atom_api_protocol.cc b/atom/browser/api/atom_api_protocol.cc index 71da0869c..ccc87db2d 100644 --- a/atom/browser/api/atom_api_protocol.cc +++ b/atom/browser/api/atom_api_protocol.cc @@ -322,6 +322,10 @@ mate::Handle Protocol::Create(v8::Isolate* isolate) { namespace { void Initialize(v8::Handle exports) { + // Make sure the job factory has been created. + atom::AtomBrowserContext::Get()->url_request_context_getter()-> + GetURLRequestContext(); + v8::Isolate* isolate = v8::Isolate::GetCurrent(); mate::Dictionary dict(isolate, exports); dict.Set("protocol", atom::api::Protocol::Create(isolate));