Changeset 200159 in webkit
- Timestamp:
- Apr 27, 2016 4:32:13 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r200158 r200159 1 2016-04-27 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [SOUP] Implement PlatformCookieJar::addCookie 4 https://bugs.webkit.org/show_bug.cgi?id=156295 5 6 Reviewed by Carlos Garcia Campos. 7 8 * platform/network/soup/CookieJarSoup.cpp: 9 (WebCore::msToSoupDate): 10 (WebCore::toSoupCookie): 11 (WebCore::addCookie): 12 1 13 2016-04-27 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp
r199167 r200159 29 29 #include "URL.h" 30 30 #include "NetworkingContext.h" 31 #include "NotImplemented.h"32 31 #include "PlatformCookieJar.h" 33 32 #include "SoupNetworkSession.h" 33 #include <wtf/DateMath.h> 34 34 #include <wtf/glib/GRefPtr.h> 35 35 #include <wtf/text/CString.h> … … 193 193 } 194 194 195 void addCookie(const NetworkStorageSession&, const URL&, const Cookie&) 196 { 197 // FIXME: implement this command. <https://webkit.org/b/156295> 198 notImplemented(); 195 static SoupDate* msToSoupDate(double ms) 196 { 197 int year = msToYear(ms); 198 int dayOfYear = dayInYear(ms, year); 199 bool leapYear = isLeapYear(year); 200 return soup_date_new(year, monthFromDayInYear(dayOfYear, leapYear), dayInMonthFromDayInYear(dayOfYear, leapYear), msToHours(ms), msToMinutes(ms), static_cast<int>(ms / 1000) % 60); 201 } 202 203 static SoupCookie* toSoupCookie(const Cookie& cookie) 204 { 205 SoupCookie* soupCookie = soup_cookie_new(cookie.name.utf8().data(), cookie.value.utf8().data(), 206 cookie.domain.utf8().data(), cookie.path.utf8().data(), -1); 207 soup_cookie_set_http_only(soupCookie, cookie.httpOnly); 208 soup_cookie_set_secure(soupCookie, cookie.secure); 209 if (!cookie.session) { 210 SoupDate* date = msToSoupDate(cookie.expires); 211 soup_cookie_set_expires(soupCookie, date); 212 soup_date_free(date); 213 } 214 return soupCookie; 215 } 216 217 void addCookie(const NetworkStorageSession& session, const URL&, const Cookie& cookie) 218 { 219 soup_cookie_jar_add_cookie(cookieJarForSession(session), toSoupCookie(cookie)); 199 220 } 200 221
Note: See TracChangeset
for help on using the changeset viewer.