Web Inspector: Cookies view should use model objects instead of raw payload data
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2018 20:41:31 +0000 (20:41 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2018 20:41:31 +0000 (20:41 +0000)
commite90284d7cb8790bab830689a53bdebc7a4e79cf0
treee5b551465a96b5d4920a926cce3e77a7769951c0
parenta01226b99492a0625e03cad43e6e5eba9baec910
Web Inspector: Cookies view should use model objects instead of raw payload data
https://bugs.webkit.org/show_bug.cgi?id=189533
<rdar://problem/44364183>

Reviewed by Joseph Pecoraro and Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Models/Cookie.js:
(WI.Cookie):
(WI.Cookie.fromPayload):
(WI.Cookie.parseSetCookieResponseHeader):
(WI.Cookie.prototype.get type):
(WI.Cookie.prototype.get name):
(WI.Cookie.prototype.get value):
(WI.Cookie.prototype.get header):
(WI.Cookie.prototype.get expires):
(WI.Cookie.prototype.get maxAge):
(WI.Cookie.prototype.get path):
(WI.Cookie.prototype.get domain):
(WI.Cookie.prototype.get secure):
(WI.Cookie.prototype.get httpOnly):
(WI.Cookie.prototype.get sameSite):
(WI.Cookie.prototype.get size):
(WI.Cookie.prototype.get url):
(WI.Cookie.prototype.expirationDate):
Cleanup Cookie object; add pubic getters for data, `url` property,
static `fromPayload` method, and calculate `_size` if missing.

* UserInterface/Views/CookieStorageContentView.js:
(WI.CookieStorageContentView.prototype.tableDidRemoveRows):
(WI.CookieStorageContentView.prototype._reloadCookies):
Create Cookie objects from the payload instead of using raw payload data.

LayoutTests:

* inspector/unit-tests/cookie-expected.txt:
* inspector/unit-tests/cookie.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/unit-tests/cookie-expected.txt
LayoutTests/inspector/unit-tests/cookie.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/Cookie.js
Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js
Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.js