Title: [228250] trunk/Source/WebCore
Revision
228250
Author
[email protected]
Date
2018-02-07 16:39:17 -0800 (Wed, 07 Feb 2018)

Log Message

[Curl] Cookie Database has some warnings when compiled in clang
https://bugs.webkit.org/show_bug.cgi?id=182583

Patch by Christopher Reid <[email protected]> on 2018-02-07
Reviewed by Alex Christensen.

No new tests, no change in behavior.

Fixing unused-parameter, missing-field-initializers, reorder, and pragma-once-outside-header warnings.

* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/NetworkStorageSessionCurl.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228249 => 228250)


--- trunk/Source/WebCore/ChangeLog	2018-02-08 00:11:54 UTC (rev 228249)
+++ trunk/Source/WebCore/ChangeLog	2018-02-08 00:39:17 UTC (rev 228250)
@@ -1,3 +1,19 @@
+2018-02-07  Christopher Reid  <[email protected]>
+
+        [Curl] Cookie Database has some warnings when compiled in clang
+        https://bugs.webkit.org/show_bug.cgi?id=182583
+
+        Reviewed by Alex Christensen.
+
+        No new tests, no change in behavior.
+
+        Fixing unused-parameter, missing-field-initializers, reorder, and pragma-once-outside-header warnings.
+
+        * platform/network/NetworkStorageSession.h:
+        * platform/network/curl/CookieJarCurlDatabase.cpp:
+        * platform/network/curl/CookieJarDB.cpp:
+        * platform/network/curl/NetworkStorageSessionCurl.cpp:
+
 2018-02-07  Ryosuke Niwa  <[email protected]>
 
         Remove unused CSSParserContext in CSSParser::parseInlineStyleDeclaration

Modified: trunk/Source/WebCore/platform/network/NetworkStorageSession.h (228249 => 228250)


--- trunk/Source/WebCore/platform/network/NetworkStorageSession.h	2018-02-08 00:11:54 UTC (rev 228249)
+++ trunk/Source/WebCore/platform/network/NetworkStorageSession.h	2018-02-08 00:39:17 UTC (rev 228250)
@@ -162,10 +162,10 @@
     GRefPtr<GCancellable> m_persisentStorageCancellable;
 #endif
 #elif USE(CURL)
+    RefPtr<NetworkingContext> m_context;
+
     UniqueRef<CookieJarCurl> m_cookieStorage;
     mutable CookieJarDB m_cookieDatabase;
-
-    RefPtr<NetworkingContext> m_context;
 #else
     RefPtr<NetworkingContext> m_context;
 #endif

Modified: trunk/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp (228249 => 228250)


--- trunk/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp	2018-02-08 00:11:54 UTC (rev 228249)
+++ trunk/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp	2018-02-08 00:39:17 UTC (rev 228250)
@@ -22,8 +22,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
-
 #include "config.h"
 #include "CookieJarCurlDatabase.h"
 
@@ -65,6 +63,7 @@
 {
     UNUSED_PARAM(frameID);
     UNUSED_PARAM(pageID);
+    UNUSED_PARAM(firstParty);
 
     CookieJarDB& cookieJarDB = session.cookieDatabase();
     cookieJarDB.setCookie(url.string(), value, true);
@@ -96,7 +95,7 @@
 
 bool CookieJarCurlDatabase::cookiesEnabled(const NetworkStorageSession& session) const
 {
-    return true;
+    return session.cookieDatabase().isEnabled();
 }
 
 bool CookieJarCurlDatabase::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const
@@ -108,17 +107,17 @@
     return cookieJarDB.searchCookies(firstParty.string(), std::nullopt, std::nullopt, std::nullopt, rawCookies);
 }
 
-void CookieJarCurlDatabase::deleteCookie(const NetworkStorageSession&, const URL& url, const String& cookieName) const
+void CookieJarCurlDatabase::deleteCookie(const NetworkStorageSession&, const URL&, const String&) const
 {
     // FIXME: Not yet implemented
 }
 
-void CookieJarCurlDatabase::getHostnamesWithCookies(const NetworkStorageSession&, HashSet<String>& hostnames) const
+void CookieJarCurlDatabase::getHostnamesWithCookies(const NetworkStorageSession&, HashSet<String>&) const
 {
     // FIXME: Not yet implemented
 }
 
-void CookieJarCurlDatabase::deleteCookiesForHostnames(const NetworkStorageSession&, const Vector<String>& cookieHostNames) const
+void CookieJarCurlDatabase::deleteCookiesForHostnames(const NetworkStorageSession&, const Vector<String>&) const
 {
     // FIXME: Not yet implemented
 }

Modified: trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp (228249 => 228250)


--- trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp	2018-02-08 00:11:54 UTC (rev 228249)
+++ trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp	2018-02-08 00:39:17 UTC (rev 228250)
@@ -172,7 +172,7 @@
     if (isOnMemory())
         return false;
 
-    struct stat st = { 0 };
+    struct stat st;
     int ret = stat(getCorruptionMarkerPath().utf8().data(), &st);
     if (!ret)
         return false;
@@ -445,7 +445,7 @@
     return statement->step();
 }
 
-int CookieJarDB::deleteCookies(const String& url)
+int CookieJarDB::deleteCookies(const String&)
 {
     // NOT IMPLEMENTED
     // TODO: this function will be called if application calls WKCookieManagerDeleteCookiesForHostname() in WKCookieManager.h.

Modified: trunk/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp (228249 => 228250)


--- trunk/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp	2018-02-08 00:11:54 UTC (rev 228249)
+++ trunk/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp	2018-02-08 00:39:17 UTC (rev 228250)
@@ -59,8 +59,8 @@
 NetworkStorageSession::NetworkStorageSession(PAL::SessionID sessionID, NetworkingContext* context)
     : m_sessionID(sessionID)
     , m_context(context)
+    , m_cookieStorage(makeUniqueRef<CookieJarCurlDatabase>())
     , m_cookieDatabase(defaultCookieJarPath())
-    , m_cookieStorage(makeUniqueRef<CookieJarCurlDatabase>())
 {
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to