summaryrefslogtreecommitdiffstats
path: root/src/core/net/url_request_custom_job_proxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/net/url_request_custom_job_proxy.cpp')
-rw-r--r--src/core/net/url_request_custom_job_proxy.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp
index 526ac2f8b..b5f10388c 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -41,9 +41,10 @@
#include "url_request_custom_job.h"
#include "url_request_custom_job_delegate.h"
#include "api/qwebengineurlrequestjob.h"
-#include "browser_context_adapter.h"
+#include "profile_adapter.h"
#include "type_conversion.h"
#include "content/public/browser/browser_thread.h"
+#include "web_engine_context.h"
using namespace net;
@@ -51,12 +52,12 @@ namespace QtWebEngineCore {
URLRequestCustomJobProxy::URLRequestCustomJobProxy(URLRequestCustomJob *job,
const std::string &scheme,
- QWeakPointer<const BrowserContextAdapter> adapter)
+ QPointer<ProfileAdapter> profileAdapter)
: m_job(job)
, m_started(false)
, m_scheme(scheme)
, m_delegate(nullptr)
- , m_adapter(adapter)
+ , m_profileAdapter(profileAdapter)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
}
@@ -160,10 +161,11 @@ void URLRequestCustomJobProxy::initialize(GURL url, std::string method, base::Op
if (initiator.has_value())
initiatorOrigin = QUrl::fromEncoded(QByteArray::fromStdString(initiator.value().Serialize()));
- QWebEngineUrlSchemeHandler *schemeHandler = 0;
- QSharedPointer<const BrowserContextAdapter> browserContext = m_adapter.toStrongRef();
- if (browserContext)
- schemeHandler = browserContext->customUrlSchemeHandlers()[toQByteArray(m_scheme)];
+ QWebEngineUrlSchemeHandler *schemeHandler = nullptr;
+
+ if (m_profileAdapter)
+ schemeHandler = m_profileAdapter->customUrlSchemeHandlers()[toQByteArray(m_scheme)];
+
if (schemeHandler) {
m_delegate = new URLRequestCustomJobDelegate(this, toQt(url),
QByteArray::fromStdString(method),