]> khamidou — GitHub mirrors - electron.git/commitdiff
linux: Fix crash when using protocol module early.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 19 Feb 2014 11:39:01 +0000 (11:39 +0000)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 19 Feb 2014 11:39:01 +0000 (11:39 +0000)
browser/api/atom_api_protocol.cc

index 107477d0eb2984525e49ee209beebce38b20d1a2..1499f38cff7f065e371dcd757328fb55a6929160 100644 (file)
@@ -368,6 +368,12 @@ void Protocol::Initialize(v8::Handle<v8::Object> target) {
   // Remember the protocol object, used for emitting event later.
   g_protocol_object.reset(target);
 
+#if defined(OS_LINUX)
+  // Make sure the job factory has been created.
+  AtomBrowserContext::Get()->url_request_context_getter()->
+      GetURLRequestContext();
+#endif
+
   NODE_SET_METHOD(target, "registerProtocol", RegisterProtocol);
   NODE_SET_METHOD(target, "unregisterProtocol", UnregisterProtocol);
   NODE_SET_METHOD(target, "isHandledProtocol", IsHandledProtocol);