Add QNetworkRequest::ResourceTypeAttribute for use in QtWebKit

Often requested feature in QtWebKit is reporting what kind of resource
corresponds to particular QNetworkRequest, similarly to
QWebEngineUrlRequestInfo::resourceType(). This information can be used
to modify or block certain request types in user's implementation of
QNAM::createRequest().

The only clean way to pass this data is via attributes of QNetworkRequest,
so enum value needs to be reserved. It's unlikely to be used anywhere
outside of QtWebKit, however this is already the case for
SynchronousRequestAttribute.

Change-Id: I51a258e5e4b78e6e823c30c48d0c644356de6b17
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Konstantin Tokarev 2017-11-20 11:57:14 +03:00
parent c3632d8036
commit 4d0add31fd
2 changed files with 3 additions and 0 deletions

View File

@ -310,6 +310,8 @@ QT_BEGIN_NAMESPACE
Http2DirectAttribute are set, Http2DirectAttribute takes priority.
(This value was introduced in 5.10.)
\omitvalue ResourceTypeAttribute
\value User
Special type. Additional information can be passed in
QVariants with types ranging from User to UserMax. The default

View File

@ -93,6 +93,7 @@ public:
OriginalContentLengthAttribute,
RedirectPolicyAttribute,
Http2DirectAttribute,
ResourceTypeAttribute, // internal
User = 1000,
UserMax = 32767