summaryrefslogtreecommitdiffstats
path: root/src/core/url_request_context_getter_qt.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-05-09 14:40:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-09 16:57:25 +0200
commit15ca2336302e21da3e11c8607f6f3ff4e433d09e (patch)
tree35502b542537330559bc53a228c17e941b965c16 /src/core/url_request_context_getter_qt.cpp
parent3a96f1a674778ecd79745db7fc5dbff3236a0853 (diff)
Fix Google Maps not showing tiles when panning/zooming
The issue is that the web worker that fetches and pre-process the map tiles couldn't be started successfully from a Blob. We were missing the blob: scheme handler that was passed to us in the ignored protocol_handlers argument of BrowserContextQt::CreateRequestContext. Change-Id: I24b726a1577e7092d53b1821efd3e4aa2a66c7d9 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/url_request_context_getter_qt.cpp')
-rw-r--r--src/core/url_request_context_getter_qt.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index cfa6b0ae6..ce67bb23d 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -73,10 +73,11 @@ static const char kQrcSchemeQt[] = "qrc";
using content::BrowserThread;
-URLRequestContextGetterQt::URLRequestContextGetterQt(const base::FilePath &basePath)
+URLRequestContextGetterQt::URLRequestContextGetterQt(const base::FilePath &basePath, content::ProtocolHandlerMap *protocolHandlers)
: m_ignoreCertificateErrors(false)
, m_basePath(basePath)
{
+ std::swap(m_protocolHandlers, *protocolHandlers);
// We must create the proxy config service on the UI loop on Linux because it
// must synchronously run on the glib message loop. This will be passed to
@@ -161,16 +162,21 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
network_session_params, main_backend);
m_storage->set_http_transaction_factory(main_cache);
- // FIXME: add protocol handling
m_jobFactory.reset(new net::URLRequestJobFactoryImpl());
+
+ // Chromium has a few protocol handlers ready for us, only pick blob: and throw away the rest.
+ content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(chrome::kBlobScheme);
+ Q_ASSERT(it != m_protocolHandlers.end());
+ m_jobFactory->SetProtocolHandler(it->first, it->second.release());
+ m_protocolHandlers.clear();
+
m_jobFactory->SetProtocolHandler(chrome::kDataScheme, new net::DataProtocolHandler());
- m_jobFactory->SetProtocolHandler(
- chrome::kFileScheme,
- new net::FileProtocolHandler(content::BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
+ m_jobFactory->SetProtocolHandler(chrome::kFileScheme, new net::FileProtocolHandler(
+ content::BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
m_jobFactory->SetProtocolHandler(kQrcSchemeQt, new QrcProtocolHandlerQt());
m_jobFactory->SetProtocolHandler(content::kFtpScheme, new net::FtpProtocolHandler(
- new net::FtpNetworkLayer(m_urlRequestContext->host_resolver())));
+ new net::FtpNetworkLayer(m_urlRequestContext->host_resolver())));
m_urlRequestContext->set_job_factory(m_jobFactory.get());
}