diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-02 15:16:28 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-17 14:34:34 +0100 |
commit | 09ce1e76716ca660ef6a9b39e4bb0015d03a0793 (patch) | |
tree | 994bd898f11544ffddc10330adc45c06f7b0fd9b /src/core/content_browser_client_qt.cpp | |
parent | b8c6c4a8588374cd0e1830871134d44d0460e0e8 (diff) |
Move pdf interception to URL loader
This should also work with network-service
Change-Id: I1d38112b76f9a656cc50ffbb826db28b41cf2f85
Fixes: QTBUG-80462
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 12d986bb7..e29a161ca 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -165,7 +165,7 @@ #include "extensions/browser/io_thread_extension_message_filter.h" #include "extensions/common/constants.h" #include "common/extensions/extensions_client_qt.h" -#include "renderer_host/resource_dispatcher_host_delegate_qt.h" +#include "net/plugin_response_interceptor_url_loader_throttle.h" #endif #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) @@ -339,11 +339,7 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost* void ContentBrowserClientQt::ResourceDispatcherHostCreated() { -#if BUILDFLAG(ENABLE_EXTENSIONS) - m_resourceDispatcherHostDelegate.reset(new ResourceDispatcherHostDelegateQt); -#else m_resourceDispatcherHostDelegate.reset(new content::ResourceDispatcherHostDelegate); -#endif content::ResourceDispatcherHost::Get()->SetDelegate(m_resourceDispatcherHostDelegate.get()); } @@ -870,27 +866,35 @@ private: std::vector<std::unique_ptr<content::URLLoaderThrottle>> ContentBrowserClientQt::CreateURLLoaderThrottlesOnIO( - const network::ResourceRequest & /*request*/, content::ResourceContext *resource_context, + const network::ResourceRequest &request, content::ResourceContext *resource_context, const base::RepeatingCallback<content::WebContents *()> & /*wc_getter*/, - content::NavigationUIData * /*navigation_ui_data*/, int /*frame_tree_node_id*/) + content::NavigationUIData * /*navigation_ui_data*/, int frame_tree_node_id) { std::vector<std::unique_ptr<content::URLLoaderThrottle>> result; ProfileIODataQt *ioData = ProfileIODataQt::FromResourceContext(resource_context); result.push_back(std::make_unique<ProtocolHandlerThrottle< scoped_refptr<ProtocolHandlerRegistry::IOThreadDelegate>>>( - ioData->protocolHandlerRegistryIOThreadDelegate())); + ioData->protocolHandlerRegistryIOThreadDelegate())); +#if BUILDFLAG(ENABLE_EXTENSIONS) + result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>( + resource_context, request.resource_type, frame_tree_node_id)); +#endif return result; } std::vector<std::unique_ptr<content::URLLoaderThrottle>> ContentBrowserClientQt::CreateURLLoaderThrottles( const network::ResourceRequest &request, content::BrowserContext *browser_context, - const base::RepeatingCallback<content::WebContents *()> &wc_getter, - content::NavigationUIData *navigation_ui_data, int frame_tree_node_id) + const base::RepeatingCallback<content::WebContents *()> & /*wc_getter*/, + content::NavigationUIData * /*navigation_ui_data*/, int frame_tree_node_id) { std::vector<std::unique_ptr<content::URLLoaderThrottle>> result; result.push_back(std::make_unique<ProtocolHandlerThrottle<ProtocolHandlerRegistry *>>( - ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context))); + ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context))); +#if BUILDFLAG(ENABLE_EXTENSIONS) + result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>( + browser_context, request.resource_type, frame_tree_node_id)); +#endif return result; } |