Changeset 220351 in webkit
- Timestamp:
- Aug 7, 2017 1:58:50 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220344 r220351 1 2017-08-07 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 3 [Curl] Add abstraction layer of cookie jar implementation for Curl port 4 https://bugs.webkit.org/show_bug.cgi?id=174943 5 6 Reviewed by Brent Fulgham. 7 8 * platform/network/curl/CookieJarCurl.cpp: 9 (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM): 10 (WebCore::CookieJarCurlFileSystem::cookiesForDOM): 11 (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue): 12 (WebCore::CookieJarCurlFileSystem::cookiesEnabled): 13 (WebCore::CookieJarCurlFileSystem::getRawCookies): 14 (WebCore::CookieJarCurlFileSystem::deleteCookie): 15 (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies): 16 (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames): 17 (WebCore::CookieJarCurlFileSystem::deleteAllCookies): 18 (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince): 19 (WebCore::cookiesForDOM): 20 (WebCore::setCookiesFromDOM): 21 (WebCore::cookieRequestHeaderFieldValue): 22 (WebCore::cookiesEnabled): 23 (WebCore::getRawCookies): 24 (WebCore::deleteCookie): 25 (WebCore::getHostnamesWithCookies): 26 (WebCore::deleteCookiesForHostnames): 27 (WebCore::deleteAllCookies): 28 (WebCore::deleteAllCookiesModifiedSince): 29 * platform/network/curl/CookieJarCurl.h: Added. 30 * platform/network/curl/CurlContext.cpp: 31 * platform/network/curl/CurlContext.h: 32 (WebCore::CurlContext::cookieJar): 33 1 34 2017-08-07 Brady Eidson <beidson@apple.com> 2 35 -
trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp
r219606 r220351 18 18 19 19 #include "config.h" 20 #include " PlatformCookieJar.h"20 #include "CookieJarCurl.h" 21 21 22 22 #if USE(CURL) 23 24 23 #include "Cookie.h" 25 24 #include "CurlContext.h" … … 241 240 } 242 241 243 void setCookiesFromDOM(const NetworkStorageSession&, const URL&, const URL& url, const String& value)242 void CookieJarCurlFileSystem::setCookiesFromDOM(const NetworkStorageSession&, const URL& firstParty, const URL& url, const String& value) 244 243 { 245 244 CurlHandle curlHandle; … … 289 288 } 290 289 291 String cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url)290 String CookieJarCurlFileSystem::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url) 292 291 { 293 292 return cookiesForSession(session, firstParty, url, false); 294 293 } 295 294 296 String cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const URL& url)295 String CookieJarCurlFileSystem::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const URL& url) 297 296 { 298 297 return cookiesForSession(session, firstParty, url, true); 299 298 } 300 299 301 bool cookiesEnabled(const NetworkStorageSession&, const URL& /*firstParty*/, const URL& /*url*/)300 bool CookieJarCurlFileSystem::cookiesEnabled(const NetworkStorageSession&, const URL& firstParty, const URL&) 302 301 { 303 302 return true; 304 303 } 305 304 306 bool getRawCookies(const NetworkStorageSession&, const URL& /*firstParty*/, const URL& /*url*/, Vector<Cookie>& rawCookies)305 bool CookieJarCurlFileSystem::getRawCookies(const NetworkStorageSession&, const URL& firstParty, const URL&, Vector<Cookie>& rawCookies) 307 306 { 308 307 // FIXME: Not yet implemented … … 311 310 } 312 311 313 void deleteCookie(const NetworkStorageSession&, const URL&, const String&) 314 { 315 // FIXME: Not yet implemented 316 } 317 318 void getHostnamesWithCookies(const NetworkStorageSession&, HashSet<String>&) 319 { 320 // FIXME: Not yet implemented 321 } 322 323 void deleteCookiesForHostnames(const NetworkStorageSession&, const Vector<String>&) 324 { 325 // FIXME: Not yet implemented 326 } 327 328 void deleteAllCookies(const NetworkStorageSession&) 329 { 330 // FIXME: Not yet implemented 331 } 332 333 void deleteAllCookiesModifiedSince(const NetworkStorageSession&, std::chrono::system_clock::time_point) 334 { 335 // FIXME: Not yet implemented 312 void CookieJarCurlFileSystem::deleteCookie(const NetworkStorageSession&, const URL&, const String&) 313 { 314 // FIXME: Not yet implemented 315 } 316 317 void CookieJarCurlFileSystem::getHostnamesWithCookies(const NetworkStorageSession&, HashSet<String>& hostnames) 318 { 319 // FIXME: Not yet implemented 320 } 321 322 void CookieJarCurlFileSystem::deleteCookiesForHostnames(const NetworkStorageSession&, const Vector<String>& cookieHostNames) 323 { 324 // FIXME: Not yet implemented 325 } 326 327 void CookieJarCurlFileSystem::deleteAllCookies(const NetworkStorageSession&) 328 { 329 // FIXME: Not yet implemented 330 } 331 332 void CookieJarCurlFileSystem::deleteAllCookiesModifiedSince(const NetworkStorageSession&, std::chrono::system_clock::time_point) 333 { 334 // FIXME: Not yet implemented 335 } 336 337 // dispatcher functions 338 339 String cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url) 340 { 341 return CurlContext::singleton().cookieJar().cookiesForDOM(session, firstParty, url); 342 } 343 344 void setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url, const String& value) 345 { 346 CurlContext::singleton().cookieJar().setCookiesFromDOM(session, firstParty, url, value); 347 } 348 349 String cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const URL& url) 350 { 351 return CurlContext::singleton().cookieJar().cookieRequestHeaderFieldValue(session, firstParty, url); 352 } 353 354 bool cookiesEnabled(const NetworkStorageSession& session, const URL& firstParty, const URL& url) 355 { 356 return CurlContext::singleton().cookieJar().cookiesEnabled(session, firstParty, url); 357 } 358 359 bool getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const URL& url, Vector<Cookie>& rawCookies) 360 { 361 return CurlContext::singleton().cookieJar().getRawCookies(session, firstParty, url, rawCookies); 362 } 363 364 void deleteCookie(const NetworkStorageSession& session, const URL& url, const String& cookie) 365 { 366 CurlContext::singleton().cookieJar().deleteCookie(session, url, cookie); 367 } 368 369 void getHostnamesWithCookies(const NetworkStorageSession& session, HashSet<String>& hostnames) 370 { 371 CurlContext::singleton().cookieJar().getHostnamesWithCookies(session, hostnames); 372 } 373 374 void deleteCookiesForHostnames(const NetworkStorageSession& session, const Vector<String>& cookieHostNames) 375 { 376 CurlContext::singleton().cookieJar().deleteCookiesForHostnames(session, cookieHostNames); 377 } 378 379 void deleteAllCookies(const NetworkStorageSession& session) 380 { 381 CurlContext::singleton().cookieJar().deleteAllCookies(session); 382 } 383 384 void deleteAllCookiesModifiedSince(const NetworkStorageSession& session, std::chrono::system_clock::time_point since) 385 { 386 CurlContext::singleton().cookieJar().deleteAllCookiesModifiedSince(session, since); 336 387 } 337 388 -
trunk/Source/WebCore/platform/network/curl/CurlContext.cpp
r219606 r220351 107 107 : m_cookieJarFileName { cookieJarPath() } 108 108 , m_certificatePath { certificatePath() } 109 , m_cookieJar { std::make_unique<CookieJarCurlFileSystem>() } 109 110 { 110 111 initCookieSession(); -
trunk/Source/WebCore/platform/network/curl/CurlContext.h
r219948 r220351 27 27 #pragma once 28 28 29 #include "CookieJarCurl.h" 29 30 #include "URL.h" 30 31 … … 118 119 const char* getCookieJarFileName() const { return m_cookieJarFileName.data(); } 119 120 void setCookieJarFileName(const char* cookieJarFileName) { m_cookieJarFileName = CString(cookieJarFileName); } 121 CookieJarCurl& cookieJar() { return *m_cookieJar; } 120 122 121 123 // Certificate … … 138 140 CString m_certificatePath; 139 141 CurlShareHandle m_shareHandle; 142 std::unique_ptr<CookieJarCurl> m_cookieJar; 140 143 bool m_ignoreSSLErrors { false }; 141 144
Note: See TracChangeset
for help on using the changeset viewer.