diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-29 13:51:39 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-10-16 10:48:52 +0000 |
commit | 7013cd858c1f2c84ad0e178f68c6cbfb6aed2530 (patch) | |
tree | df8f3eb4cddaa22b8b92aeac9057029395a1b775 | |
parent | 067e46c2b3371b7b4f952276ddcfc3e5af0d9551 (diff) |
Clean setting protocols from Chromium
We are actually setting all of them now, so do it simpler.
Qrc was however passed to us incorrectly because we pretended
it was a webui to make view-source on it work, we can do that
better.
Change-Id: I5aeb75666af81d2e857ae9c6eb999049a34a5f0f
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 2 | ||||
-rw-r--r-- | src/core/content_browser_client_qt.h | 2 | ||||
-rw-r--r-- | src/core/url_request_context_getter_qt.cpp | 17 |
3 files changed, 5 insertions, 16 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 85cca235a..1b2f155c9 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -505,7 +505,7 @@ void ContentBrowserClientQt::AppendExtraCommandLineSwitches(base::CommandLine* c command_line->AppendSwitchASCII(switches::kLang, GetApplicationLocale()); } -void ContentBrowserClientQt::GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes) +void ContentBrowserClientQt::GetAdditionalViewSourceSchemes(std::vector<std::string>* additional_schemes) { additional_schemes->push_back(kQrcSchemeQt); } diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index eab8e42ab..be7511755 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -117,7 +117,7 @@ public: std::string GetApplicationLocale() override; std::string GetAcceptLangs(content::BrowserContext* context) override; void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) override; - void GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes) override; + void GetAdditionalViewSourceSchemes(std::vector<std::string>* additional_schemes) override; void ExposeInterfacesToFrame(service_manager::BinderRegistry* registry, content::RenderFrameHost* render_frame_host) override; diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index 8a6717e91..cb8c3c093 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -538,20 +538,9 @@ void URLRequestContextGetterQt::generateJobFactory() m_updateJobFactory = false; std::unique_ptr<net::URLRequestJobFactoryImpl> jobFactory(new net::URLRequestJobFactoryImpl()); - - { - // Chromium has transferred a few protocol handlers to us, only pick blob:, chrome: and filesystem:. - content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(url::kBlobScheme); - Q_ASSERT(it != m_protocolHandlers.end()); - jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release())); - it = m_protocolHandlers.find(content::kChromeUIScheme); - Q_ASSERT(it != m_protocolHandlers.end()); - jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release())); - it = m_protocolHandlers.find(url::kFileSystemScheme); - Q_ASSERT(it != m_protocolHandlers.end()); - jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release())); - m_protocolHandlers.clear(); - } + for (auto &it : m_protocolHandlers) + jobFactory->SetProtocolHandler(it.first, base::WrapUnique(it.second.release())); + m_protocolHandlers.clear(); jobFactory->SetProtocolHandler(url::kDataScheme, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(new net::DataProtocolHandler())); jobFactory->SetProtocolHandler(url::kFileScheme, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(new net::FileProtocolHandler( |