WebKit Bugzilla
Attachment 362596 Details for
Bug 194861
: API::HTTPCookieStore should expose setCookies()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194861-20190220233822.patch (text/plain), 3.50 KB, created by
Jiewen Tan
on 2019-02-20 23:38:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jiewen Tan
Created:
2019-02-20 23:38:22 PST
Size:
3.50 KB
patch
obsolete
>Subversion Revision: 241856 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a643abd0c9fc36cbdfb21bf4709157ec1264ac05..f34d81064d51ca467e30d5f8782d40a1738c0254 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-20 Jiewen Tan <jiewen_tan@apple.com> >+ >+ API::HTTPCookieStore should expose setCookies() >+ https://bugs.webkit.org/show_bug.cgi?id=194861 >+ <rdar://problem/48266256> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ LoadOptimizer needs to set a bulk of cookies depending on responses. Therefore, this new API >+ is needed. The API will be tested in the corresponding LoadOptimizer change. >+ >+ * UIProcess/API/APIHTTPCookieStore.cpp: >+ (API::HTTPCookieStore::setCookies): >+ * UIProcess/API/APIHTTPCookieStore.h: >+ > 2019-02-20 Chris Dumez <cdumez@apple.com> > > [PSON] Make sure hung processes are not kept alive by suspended pages or process caching >diff --git a/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp b/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp >index e174ef62909c097a3475231cbe1e9439d81521fb..934d3ac655df7b31b7d0252cc5a50a66017b8773 100644 >--- a/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp >+++ b/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp >@@ -96,6 +96,30 @@ void HTTPCookieStore::setCookie(const WebCore::Cookie& cookie, CompletionHandler > }); > } > >+void HTTPCookieStore::setCookies(const Vector<WebCore::Cookie>& cookies, const WTF::URL& url, const WTF::URL& mainDocumentURL, CompletionHandler<void()>&& completionHandler) >+{ >+ auto* pool = m_owningDataStore->processPoolForCookieStorageOperations(); >+ if (!pool) { >+ for (const auto& cookie : cookies) { >+ // FIXME: pendingCookies used for defaultSession because session cookies cannot be propagated to Network Process with uiProcessCookieStorageIdentifier. >+ if (m_owningDataStore->sessionID() == PAL::SessionID::defaultSessionID() && !cookie.session) >+ setCookieInDefaultUIProcessCookieStore(cookie); >+ else >+ m_owningDataStore->addPendingCookie(cookie); >+ } >+ >+ callOnMainThread([completionHandler = WTFMove(completionHandler)] () mutable { >+ completionHandler(); >+ }); >+ return; >+ } >+ >+ auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>(); >+ cookieManager->setCookies(m_owningDataStore->sessionID(), cookies, url, mainDocumentURL, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)] (CallbackBase::Error error) mutable { >+ completionHandler(); >+ }); >+} >+ > void HTTPCookieStore::deleteCookie(const WebCore::Cookie& cookie, CompletionHandler<void()>&& completionHandler) > { > auto* pool = m_owningDataStore->processPoolForCookieStorageOperations(); >diff --git a/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h b/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h >index df41125b89833cc8f0543f3df6b544a0fdef6bdf..334f50d2f14ec5f90c25be8112141c33e692dd2f 100644 >--- a/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h >+++ b/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h >@@ -60,6 +60,7 @@ public: > > void cookies(CompletionHandler<void(const Vector<WebCore::Cookie>&)>&&); > void setCookie(const WebCore::Cookie&, CompletionHandler<void()>&&); >+ void setCookies(const Vector<WebCore::Cookie>&, const WTF::URL&, const WTF::URL& mainDocumentURL, CompletionHandler<void()>&&); > void deleteCookie(const WebCore::Cookie&, CompletionHandler<void()>&&); > > class Observer {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194861
:
362596
|
362599
|
362622
|
362637