OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 * @return {boolean} | 253 * @return {boolean} |
254 */ | 254 */ |
255 secure: function() | 255 secure: function() |
256 { | 256 { |
257 return "secure" in this._attributes; | 257 return "secure" in this._attributes; |
258 }, | 258 }, |
259 | 259 |
260 /** | 260 /** |
261 * @return {boolean} | 261 * @return {boolean} |
262 */ | 262 */ |
| 263 firstPartyOnly: function () |
| 264 { |
| 265 return "first-party-only" in this._attributes; |
| 266 }, |
| 267 |
| 268 /** |
| 269 * @return {boolean} |
| 270 */ |
263 session: function() | 271 session: function() |
264 { | 272 { |
265 // RFC 2965 suggests using Discard attribute to mark session cookies, bu
t this does not seem to be widely used. | 273 // RFC 2965 suggests using Discard attribute to mark session cookies, bu
t this does not seem to be widely used. |
266 // Check for absence of explicitly max-age or expiry date instead. | 274 // Check for absence of explicitly max-age or expiry date instead. |
267 return !("expires" in this._attributes || "max-age" in this._attributes)
; | 275 return !("expires" in this._attributes || "max-age" in this._attributes)
; |
268 }, | 276 }, |
269 | 277 |
270 /** | 278 /** |
271 * @return {string} | 279 * @return {string} |
272 */ | 280 */ |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 var cookie = new WebInspector.Cookie(target, protocolCookie.name, protocolCo
okie.value, null); | 421 var cookie = new WebInspector.Cookie(target, protocolCookie.name, protocolCo
okie.value, null); |
414 cookie.addAttribute("domain", protocolCookie["domain"]); | 422 cookie.addAttribute("domain", protocolCookie["domain"]); |
415 cookie.addAttribute("path", protocolCookie["path"]); | 423 cookie.addAttribute("path", protocolCookie["path"]); |
416 cookie.addAttribute("port", protocolCookie["port"]); | 424 cookie.addAttribute("port", protocolCookie["port"]); |
417 if (protocolCookie["expires"]) | 425 if (protocolCookie["expires"]) |
418 cookie.addAttribute("expires", protocolCookie["expires"]); | 426 cookie.addAttribute("expires", protocolCookie["expires"]); |
419 if (protocolCookie["httpOnly"]) | 427 if (protocolCookie["httpOnly"]) |
420 cookie.addAttribute("httpOnly"); | 428 cookie.addAttribute("httpOnly"); |
421 if (protocolCookie["secure"]) | 429 if (protocolCookie["secure"]) |
422 cookie.addAttribute("secure"); | 430 cookie.addAttribute("secure"); |
| 431 if (protocolCookie["firstPartyOnly"]) |
| 432 cookie.addAttribute("first-party-only"); |
423 cookie.setSize(protocolCookie["size"]); | 433 cookie.setSize(protocolCookie["size"]); |
424 return cookie; | 434 return cookie; |
425 } | 435 } |
426 | 436 |
427 /** | 437 /** |
428 * @param {!WebInspector.Cookie} cookie | 438 * @param {!WebInspector.Cookie} cookie |
429 * @param {string} resourceURL | 439 * @param {string} resourceURL |
430 * @return {boolean} | 440 * @return {boolean} |
431 */ | 441 */ |
432 WebInspector.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL) | 442 WebInspector.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL) |
(...skipping 10 matching lines...) Expand all Loading... |
443 * @param {string} cookieDomain | 453 * @param {string} cookieDomain |
444 * @param {string} resourceDomain | 454 * @param {string} resourceDomain |
445 * @return {boolean} | 455 * @return {boolean} |
446 */ | 456 */ |
447 WebInspector.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain,
resourceDomain) | 457 WebInspector.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain,
resourceDomain) |
448 { | 458 { |
449 if (cookieDomain.charAt(0) !== '.') | 459 if (cookieDomain.charAt(0) !== '.') |
450 return resourceDomain === cookieDomain; | 460 return resourceDomain === cookieDomain; |
451 return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)*" + cookieDomain.sub
string(1).escapeForRegExp() + "$", "i")); | 461 return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)*" + cookieDomain.sub
string(1).escapeForRegExp() + "$", "i")); |
452 } | 462 } |
OLD | NEW |