diff options
Diffstat (limited to 'src/core/url_request_custom_job_delegate.cpp')
-rw-r--r-- | src/core/url_request_custom_job_delegate.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/url_request_custom_job_delegate.cpp b/src/core/url_request_custom_job_delegate.cpp index 0650242c8..1a3e08e52 100644 --- a/src/core/url_request_custom_job_delegate.cpp +++ b/src/core/url_request_custom_job_delegate.cpp @@ -44,39 +44,40 @@ namespace QtWebEngineCore { -URLRequestCustomJobDelegate::URLRequestCustomJobDelegate(URLRequestCustomJob *job) - : m_job(job) +URLRequestCustomJobDelegate::URLRequestCustomJobDelegate(URLRequestCustomJobShared *shared) + : m_shared(shared) { } URLRequestCustomJobDelegate::~URLRequestCustomJobDelegate() { + m_shared->unsetJobDelegate(); } QUrl URLRequestCustomJobDelegate::url() const { - return toQt(m_job->request()->url()); + return toQt(m_shared->requestUrl()); } QByteArray URLRequestCustomJobDelegate::method() const { - return QByteArray::fromStdString(m_job->request()->method()); + return QByteArray::fromStdString(m_shared->requestMethod()); } void URLRequestCustomJobDelegate::setReply(const QByteArray &contentType, QIODevice *device) { - m_job->setReplyMimeType(contentType.toStdString()); - m_job->setReplyDevice(device); + m_shared->setReplyMimeType(contentType.toStdString()); + m_shared->setReplyDevice(device); } void URLRequestCustomJobDelegate::abort() { - m_job->abort(); + m_shared->abort(); } void URLRequestCustomJobDelegate::redirect(const QUrl &url) { - m_job->redirect(toGurl(url)); + m_shared->redirect(toGurl(url)); } void URLRequestCustomJobDelegate::fail(Error error) @@ -102,7 +103,7 @@ void URLRequestCustomJobDelegate::fail(Error error) break; } if (net_error) - m_job->fail(net_error); + m_shared->fail(net_error); } } // namespace |