summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/CookieParser.js
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-04 12:00:17 -0700
committerJohn Reck <jreck@google.com>2010-11-09 11:35:04 -0800
commite14391e94c850b8bd03680c23b38978db68687a8 (patch)
tree3fed87e6620fecaf3edc7259ae58a11662bedcb2 /WebCore/inspector/front-end/CookieParser.js
parent1bd705833a68f07850cf7e204b26f8d328d16951 (diff)
downloadexternal_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'WebCore/inspector/front-end/CookieParser.js')
-rwxr-xr-xWebCore/inspector/front-end/CookieParser.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/WebCore/inspector/front-end/CookieParser.js b/WebCore/inspector/front-end/CookieParser.js
index 2be5df7..f96be0b 100755
--- a/WebCore/inspector/front-end/CookieParser.js
+++ b/WebCore/inspector/front-end/CookieParser.js
@@ -54,7 +54,7 @@ WebInspector.CookieParser.prototype = {
if (kv.key.charAt(0) === "$" && this._lastCookie)
this._lastCookie.addAttribute(kv.key.slice(1), kv.value);
else if (kv.key.toLowerCase() !== "$version" && typeof kv.value === "string")
- this._addCookie(kv);
+ this._addCookie(kv, WebInspector.Cookie.Type.Request);
this._advanceAndCheckCookieDelimiter();
}
this._flushCookie();
@@ -69,7 +69,7 @@ WebInspector.CookieParser.prototype = {
if (this._lastCookie)
this._lastCookie.addAttribute(kv.key, kv.value);
else
- this._addCookie(kv);
+ this._addCookie(kv, WebInspector.Cookie.Type.Response);
if (this._advanceAndCheckCookieDelimiter())
this._flushCookie();
}
@@ -128,14 +128,14 @@ WebInspector.CookieParser.prototype = {
return match[0].match("\n") !== null;
},
- _addCookie: function(keyValue)
+ _addCookie: function(keyValue, type)
{
if (this._lastCookie)
this._lastCookie.size = keyValue.position - this._lastCookiePosition;
- // Mozilla bug 169091: Mozilla, IE and Chrome treat signle token (w/o "=") as
+ // Mozilla bug 169091: Mozilla, IE and Chrome treat single token (w/o "=") as
// specifying a value for a cookie with empty name.
- this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value) :
- new WebInspector.Cookie("", keyValue.key);
+ this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value, type) :
+ new WebInspector.Cookie("", keyValue.key, type);
this._lastCookiePosition = keyValue.position;
this._cookies.push(this._lastCookie);
}
@@ -151,10 +151,11 @@ WebInspector.CookieParser.parseSetCookie = function(header)
return (new WebInspector.CookieParser()).parseSetCookie(header);
}
-WebInspector.Cookie = function(name, value)
+WebInspector.Cookie = function(name, value, type)
{
this.name = name;
this.value = value;
+ this.type = type;
this._attributes = {};
}
@@ -202,3 +203,8 @@ WebInspector.Cookie.prototype = {
this._attributes[key.toLowerCase()] = value;
}
}
+
+WebInspector.Cookie.Type = {
+ Request: 0,
+ Response: 1
+};