diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-09-04 10:18:44 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-09-06 19:26:45 +0000 |
commit | 6ef0a365124d435314113837dc77fa07b02ff86b (patch) | |
tree | 39e4dbe1637f564e61853a40389c38eeda61abfe /src/core/api/qwebengineurlrequestjob.cpp | |
parent | 819279827a4ce05562909994468ec5604392c672 (diff) |
Make request job and request info methods consistent
Changes the method names so the two request representation uses the
same method name and the same style of naming of actions on the
requests.
Change-Id: I409ed1a5f6ac0835878f65ee978b6f224e42aa20
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/core/api/qwebengineurlrequestjob.cpp')
-rw-r--r-- | src/core/api/qwebengineurlrequestjob.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp index f2a7f1619..d9f3833b9 100644 --- a/src/core/api/qwebengineurlrequestjob.cpp +++ b/src/core/api/qwebengineurlrequestjob.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE A QWebEngineUrlRequestJob is given to QWebEngineUrlSchemeHandler::requestStarted() and must be handled by the derived implementations of the class. - A job can be handled by calling either setReply(), redirect() or setError(). + A job can be handled by calling either reply(), redirect() or fail(). The class is owned by QtWebEngine and does not need to be deleted. Note QtWebEngine may delete the job when it is no longer needed, so the signal QObject::destroyed() must be monitored if @@ -76,17 +76,25 @@ QWebEngineUrlRequestJob::~QWebEngineUrlRequestJob() } /*! - Returns the url requested. - */ + Returns the requested URL. +*/ QUrl QWebEngineUrlRequestJob::requestUrl() const { return d_ptr->url(); } /*! - Sets the reply for the request to \a device with the mime-type \a contentType. + Returns the HTTP method of the request (for example, GET or POST). +*/ +QByteArray QWebEngineUrlRequestJob::requestMethod() const +{ + return d_ptr->method(); +} + +/*! + Replies the request with \a device with the mime-type \a contentType. */ -void QWebEngineUrlRequestJob::setReply(const QByteArray &contentType, QIODevice *device) +void QWebEngineUrlRequestJob::reply(const QByteArray &contentType, QIODevice *device) { d_ptr->setReply(contentType, device); } @@ -94,7 +102,7 @@ void QWebEngineUrlRequestJob::setReply(const QByteArray &contentType, QIODevice /*! Fails the request with error \a error. */ -void QWebEngineUrlRequestJob::setError(Error r) +void QWebEngineUrlRequestJob::fail(Error r) { d_ptr->fail((URLRequestCustomJobDelegate::Error)r); } @@ -102,7 +110,7 @@ void QWebEngineUrlRequestJob::setError(Error r) /*! Tell the request is redirected to \a url. */ -void QWebEngineUrlRequestJob::setRedirect(const QUrl &url) +void QWebEngineUrlRequestJob::redirect(const QUrl &url) { d_ptr->redirect(url); } |