Force request context to initialize beforing incepting protocol

This commit is contained in:
Cheng Zhao 2015-08-10 15:31:29 +08:00
parent 0644129fbe
commit 3379641fe2

View 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;