diff options
Diffstat (limited to 'src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp')
-rw-r--r-- | src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp index 53d3e88ba..421b3167b 100644 --- a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp +++ b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp @@ -61,11 +61,14 @@ ResourceDispatcherHostLoginDelegateQt::ResourceDispatcherHostLoginDelegateQt(net , m_request(request) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); - content::ResourceRequestInfo::GetRenderFrameForRequest(request, &m_renderProcessId, &m_renderFrameId); + const content::ResourceRequestInfo *requestInfo = content::ResourceRequestInfo::ForRequest(request); + Q_ASSERT(requestInfo); content::BrowserThread::PostTask( - content::BrowserThread::UI, FROM_HERE, - base::Bind(&ResourceDispatcherHostLoginDelegateQt::triggerDialog, this)); + content::BrowserThread::UI, FROM_HERE, + base::Bind(&ResourceDispatcherHostLoginDelegateQt::triggerDialog, + this, + requestInfo->GetWebContentsGetterForRequest())); } ResourceDispatcherHostLoginDelegateQt::~ResourceDispatcherHostLoginDelegateQt() @@ -100,14 +103,13 @@ bool ResourceDispatcherHostLoginDelegateQt::isProxy() const return m_authInfo->is_proxy; } -void ResourceDispatcherHostLoginDelegateQt::triggerDialog() +void ResourceDispatcherHostLoginDelegateQt::triggerDialog(const content::ResourceRequestInfo::WebContentsGetter &webContentsGetter) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - content::RenderFrameHost *renderFrameHost = content::RenderFrameHost::FromID(m_renderProcessId, m_renderFrameId); - if (!renderFrameHost) + content::WebContentsImpl *webContents = + static_cast<content::WebContentsImpl *>(webContentsGetter.Run()); + if (!webContents) return; - content::RenderViewHost *renderViewHost = renderFrameHost->GetRenderViewHost(); - content::WebContentsImpl *webContents = static_cast<content::WebContentsImpl *>(content::WebContents::FromRenderViewHost(renderViewHost)); WebContentsAdapterClient *client = WebContentsViewQt::from(webContents->GetView())->client(); AuthenticationDialogControllerPrivate *dialogControllerData = new AuthenticationDialogControllerPrivate(this); |