Title: [262369] trunk/Source
Revision
262369
Author
commit-qu...@webkit.org
Date
2020-06-01 01:59:56 -0700 (Mon, 01 Jun 2020)

Log Message

Rename ResourceResponseBase::isHTTP to isInHTTPFamily
https://bugs.webkit.org/show_bug.cgi?id=208782

Patch by Rob Buis <rb...@igalia.com> on 2020-06-01
Reviewed by Sam Weinig.

Source/WebCore:

As the comment says, the method name is misleading and the method
is inconsistent with the API of ResourceRequestBase, so rename it
to make it clear the method can be used for both http and https
protocols.

No tests since no change in behavior.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isInHTTPFamily const):
(WebCore::ResourceResponseBase::isHTTP const): Deleted.
* platform/network/ResourceResponseBase.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseMIMEType const):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::externalEntityMimeTypeAllowed):

Source/WebKit:

Adapt to API change.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeStoreDecision):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::buildHTTPHeaders):

Source/WebKitLegacy/win:

Adapt to API change.

* Plugins/PluginStream.cpp:
(WebCore::PluginStream::startStream):
* WebURLResponse.cpp:
(WebURLResponse::QueryInterface):
(WebURLResponse::allHeaderFields):
(WebURLResponse::localizedStringForStatusCode):
(WebURLResponse::statusCode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (262368 => 262369)


--- trunk/Source/WebCore/ChangeLog	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebCore/ChangeLog	2020-06-01 08:59:56 UTC (rev 262369)
@@ -1,3 +1,30 @@
+2020-06-01  Rob Buis  <rb...@igalia.com>
+
+        Rename ResourceResponseBase::isHTTP to isInHTTPFamily
+        https://bugs.webkit.org/show_bug.cgi?id=208782
+
+        Reviewed by Sam Weinig.
+
+        As the comment says, the method name is misleading and the method
+        is inconsistent with the API of ResourceRequestBase, so rename it
+        to make it clear the method can be used for both http and https
+        protocols.
+
+        No tests since no change in behavior.
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::continueAfterContentPolicy):
+        * loader/NetscapePlugInStreamLoader.cpp:
+        (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::isInHTTPFamily const):
+        (WebCore::ResourceResponseBase::isHTTP const): Deleted.
+        * platform/network/ResourceResponseBase.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::responseMIMEType const):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::externalEntityMimeTypeAllowed):
+
 2020-05-31  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Tidy up Source/WebCore/page/DragController.h

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (262368 => 262369)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -1004,7 +1004,7 @@
         return;
     }
 
-    if (m_response.isHTTP()) {
+    if (m_response.isInHTTPFamily()) {
         int status = m_response.httpStatusCode(); // Status may be zero when loading substitute data, in particular from a WebArchive.
         if (status && (status < 200 || status >= 300)) {
             bool hostedByObject = frameLoader()->isHostedByObjectElement();

Modified: trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp (262368 => 262369)


--- trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -126,7 +126,7 @@
         if (!m_client)
             return;
 
-        if (!response.isHTTP())
+        if (!response.isInHTTPFamily())
             return;
 
         if (m_client->wantsAllStreams())

Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp (262368 => 262369)


--- trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -194,8 +194,7 @@
     return filteredResponse;
 }
 
-// FIXME: Name does not make it clear this is true for HTTPS!
-bool ResourceResponseBase::isHTTP() const
+bool ResourceResponseBase::isInHTTPFamily() const
 {
     lazyInit(CommonFieldsOnly);
 

Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.h (262368 => 262369)


--- trunk/Source/WebCore/platform/network/ResourceResponseBase.h	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.h	2020-06-01 08:59:56 UTC (rev 262369)
@@ -83,7 +83,7 @@
     static ResourceResponse fromCrossThreadData(CrossThreadData&&);
 
     bool isNull() const { return m_isNull; }
-    WEBCORE_EXPORT bool isHTTP() const;
+    WEBCORE_EXPORT bool isInHTTPFamily() const;
     WEBCORE_EXPORT bool isSuccessful() const;
 
     WEBCORE_EXPORT const URL& url() const;

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (262368 => 262369)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -178,7 +178,7 @@
 
         // The W3C spec requires the final MIME type to be some valid XML type, or text/html.
         // If it is text/html, then the responseType of "document" must have been supplied explicitly.
-        if ((m_response.isHTTP() && !responseIsXML() && !isHTML)
+        if ((m_response.isInHTTPFamily() && !responseIsXML() && !isHTML)
             || (isHTML && responseType() == ResponseType::EmptyString)) {
             m_responseDocument = nullptr;
         } else {
@@ -854,7 +854,7 @@
     if (mimeType.isEmpty()) {
         // Same logic as externalEntityMimeTypeAllowed() in XMLDocumentParserLibxml2.cpp. Keep them in sync.
         String contentType;
-        if (m_response.isHTTP())
+        if (m_response.isInHTTPFamily())
             contentType = m_response.httpHeaderField(HTTPHeaderName::ContentType);
         else
             contentType = m_response.mimeType();

Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (262368 => 262369)


--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -386,7 +386,7 @@
     String mimeType = extractMIMETypeFromMediaType(contentType);
     if (mimeType.isEmpty()) {
         // Same logic as XMLHttpRequest::responseMIMEType(). Keep them in sync.
-        if (response.isHTTP())
+        if (response.isInHTTPFamily())
             mimeType = contentType;
         else
             mimeType = response.mimeType();

Modified: trunk/Source/WebKit/ChangeLog (262368 => 262369)


--- trunk/Source/WebKit/ChangeLog	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebKit/ChangeLog	2020-06-01 08:59:56 UTC (rev 262369)
@@ -1,3 +1,17 @@
+2020-06-01  Rob Buis  <rb...@igalia.com>
+
+        Rename ResourceResponseBase::isHTTP to isInHTTPFamily
+        https://bugs.webkit.org/show_bug.cgi?id=208782
+
+        Reviewed by Sam Weinig.
+
+        Adapt to API change.
+
+        * NetworkProcess/cache/NetworkCache.cpp:
+        (WebKit::NetworkCache::makeStoreDecision):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::buildHTTPHeaders):
+
 2020-06-01  Michael Catanzaro  <mcatanz...@gnome.org>
 
         [WPE][GTK] pthread_create() fails with EPERM in the second WebKitWebProcess with sandbox on

Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp (262368 => 262369)


--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -265,7 +265,7 @@
 
 static StoreDecision makeStoreDecision(const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceResponse& response, size_t bodySize)
 {
-    if (!originalRequest.url().protocolIsInHTTPFamily() || !response.isHTTP())
+    if (!originalRequest.url().protocolIsInHTTPFamily() || !response.isInHTTPFamily())
         return StoreDecision::NoDueToProtocol;
 
     if (originalRequest.httpMethod() != "GET")

Modified: trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp (262368 => 262369)


--- trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -190,7 +190,7 @@
 
 static String buildHTTPHeaders(const ResourceResponse& response, long long& expectedContentLength)
 {
-    if (!response.isHTTP())
+    if (!response.isInHTTPFamily())
         return String();
 
     StringBuilder header;

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (262368 => 262369)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2020-06-01 08:59:56 UTC (rev 262369)
@@ -1,3 +1,20 @@
+2020-06-01  Rob Buis  <rb...@igalia.com>
+
+        Rename ResourceResponseBase::isHTTP to isInHTTPFamily
+        https://bugs.webkit.org/show_bug.cgi?id=208782
+
+        Reviewed by Sam Weinig.
+
+        Adapt to API change.
+
+        * Plugins/PluginStream.cpp:
+        (WebCore::PluginStream::startStream):
+        * WebURLResponse.cpp:
+        (WebURLResponse::QueryInterface):
+        (WebURLResponse::allHeaderFields):
+        (WebURLResponse::localizedStringForStatusCode):
+        (WebURLResponse::statusCode):
+
 2020-05-19  Fujii Hironori  <hironori.fu...@sony.com>
 
         [WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay()

Modified: trunk/Source/WebKitLegacy/win/Plugins/PluginStream.cpp (262368 => 262369)


--- trunk/Source/WebKitLegacy/win/Plugins/PluginStream.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebKitLegacy/win/Plugins/PluginStream.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -152,7 +152,7 @@
 
     long long expectedContentLength = m_resourceResponse.expectedContentLength();
 
-    if (m_resourceResponse.isHTTP()) {
+    if (m_resourceResponse.isInHTTPFamily()) {
         StringBuilder stringBuilder;
         String separator = ": "_s;
 

Modified: trunk/Source/WebKitLegacy/win/WebURLResponse.cpp (262368 => 262369)


--- trunk/Source/WebKitLegacy/win/WebURLResponse.cpp	2020-06-01 08:46:29 UTC (rev 262368)
+++ trunk/Source/WebKitLegacy/win/WebURLResponse.cpp	2020-06-01 08:59:56 UTC (rev 262369)
@@ -260,7 +260,7 @@
         *ppvObject = static_cast<IWebURLResponse*>(this);
     else if (IsEqualGUID(riid, IID_IWebURLResponsePrivate))
         *ppvObject = static_cast<IWebURLResponsePrivate*>(this);
-    else if (m_response.isHTTP() && IsEqualGUID(riid, IID_IWebHTTPURLResponse))
+    else if (m_response.isInHTTPFamily() && IsEqualGUID(riid, IID_IWebHTTPURLResponse))
         *ppvObject = static_cast<IWebHTTPURLResponse*>(this);
     else
         return E_NOINTERFACE;
@@ -358,7 +358,7 @@
 
 HRESULT WebURLResponse::allHeaderFields(_COM_Outptr_opt_ IPropertyBag** headerFields)
 {
-    ASSERT(m_response.isHTTP());
+    ASSERT(m_response.isInHTTPFamily());
 
     if (!headerFields)
         return E_POINTER;
@@ -373,7 +373,7 @@
 
 HRESULT WebURLResponse::localizedStringForStatusCode(int statusCode, __deref_opt_out BSTR* statusString)
 {
-    ASSERT(m_response.isHTTP());
+    ASSERT(m_response.isInHTTPFamily());
     if (!statusString)
         return E_POINTER;
 
@@ -387,7 +387,7 @@
 
 HRESULT WebURLResponse::statusCode(_Out_ int* statusCode)
 {
-    ASSERT(m_response.isHTTP());
+    ASSERT(m_response.isInHTTPFamily());
     if (statusCode)
         *statusCode = m_response.httpStatusCode();
     return S_OK;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to