]> khamidou — GitHub mirrors - electron.git/commitdiff
Force request context to initialize beforing incepting protocol
authorCheng Zhao <zcbenz@gmail.com>
Mon, 10 Aug 2015 07:31:29 +0000 (15:31 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 10 Aug 2015 07:31:29 +0000 (15:31 +0800)
atom/browser/api/atom_api_protocol.cc

index fdc5ba422bd33d3c1c0c861bbab12f33271ad2e7..d7d308b306edfed69e6225f4629a7be6abb6b42d 100644 (file)
@@ -355,6 +355,10 @@ int Protocol::InterceptProtocolInIO(const std::string& scheme,
                                     const JsProtocolHandler& handler) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
+  // Force the request context to initialize, otherwise we might have nothing
+  // to intercept.
+  request_context_getter_->GetURLRequestContext();
+
   if (!job_factory_->HasProtocolHandler(scheme))
     return ERR_NO_SCHEME;