diff options
-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( |