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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 function mycallback(target, error, cookies) { | 377 function mycallback(target, error, cookies) { |
378 if (error) { | 378 if (error) { |
379 console.error(error); | 379 console.error(error); |
380 return; | 380 return; |
381 } | 381 } |
382 for (var i = 0; i < cookies.length; ++i) | 382 for (var i = 0; i < cookies.length; ++i) |
383 allCookies.push(SDK.Cookies._parseProtocolCookie(target, cookies[i])); | 383 allCookies.push(SDK.Cookies._parseProtocolCookie(target, cookies[i])); |
384 } | 384 } |
385 | 385 |
386 var barrier = new CallbackBarrier(); | 386 var barrier = new CallbackBarrier(); |
387 for (var target of SDK.targetManager.targets(SDK.Target.Capability.Network)) | 387 for (var target of SDK.targetManager.targets(SDK.Target.Capability.Network)) { |
388 target.networkAgent().getCookies(barrier.createCallback(mycallback.bind(null
, target))); | 388 var global = false; |
| 389 target.networkAgent().getCookies(global, barrier.createCallback(mycallback.b
ind(null, target))); |
| 390 } |
389 barrier.callWhenDone(callback.bind(null, allCookies)); | 391 barrier.callWhenDone(callback.bind(null, allCookies)); |
390 }; | 392 }; |
391 | 393 |
392 /** | 394 /** |
393 * @param {!SDK.Target} target | 395 * @param {!SDK.Target} target |
394 * @param {!Protocol.Network.Cookie} protocolCookie | 396 * @param {!Protocol.Network.Cookie} protocolCookie |
395 * @return {!SDK.Cookie} | 397 * @return {!SDK.Cookie} |
396 */ | 398 */ |
397 SDK.Cookies._parseProtocolCookie = function(target, protocolCookie) { | 399 SDK.Cookies._parseProtocolCookie = function(target, protocolCookie) { |
398 var cookie = new SDK.Cookie(target, protocolCookie.name, protocolCookie.value,
null); | 400 var cookie = new SDK.Cookie(target, protocolCookie.name, protocolCookie.value,
null); |
(...skipping 29 matching lines...) Expand all Loading... |
428 /** | 430 /** |
429 * @param {string} cookieDomain | 431 * @param {string} cookieDomain |
430 * @param {string} resourceDomain | 432 * @param {string} resourceDomain |
431 * @return {boolean} | 433 * @return {boolean} |
432 */ | 434 */ |
433 SDK.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceD
omain) { | 435 SDK.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceD
omain) { |
434 if (cookieDomain.charAt(0) !== '.') | 436 if (cookieDomain.charAt(0) !== '.') |
435 return resourceDomain === cookieDomain; | 437 return resourceDomain === cookieDomain; |
436 return !!resourceDomain.match(new RegExp('^([^\\.]+\\.)*' + cookieDomain.subst
ring(1).escapeForRegExp() + '$', 'i')); | 438 return !!resourceDomain.match(new RegExp('^([^\\.]+\\.)*' + cookieDomain.subst
ring(1).escapeForRegExp() + '$', 'i')); |
437 }; | 439 }; |
OLD | NEW |