Make sure the job factory is created when initializing protocol module.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 7 May 2014 01:16:45 +0000 (09:16 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 7 May 2014 01:17:46 +0000 (09:17 +0800)
Fixes atom/atom#1963, the regression came when moving to use native-mate
to reimplment the APIs.

atom/browser/api/atom_api_protocol.cc

index 71da086..ccc87db 100644 (file)
@@ -322,6 +322,10 @@ mate::Handle<Protocol> Protocol::Create(v8::Isolate* isolate) {
 namespace {
 
 void Initialize(v8::Handle<v8::Object> 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));