Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js

Issue 2137773002: [DevTools] Replace the target type with capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 { 399 {
400 if (error) { 400 if (error) {
401 console.error(error); 401 console.error(error);
402 return; 402 return;
403 } 403 }
404 for (var i = 0; i < cookies.length; ++i) 404 for (var i = 0; i < cookies.length; ++i)
405 allCookies.push(WebInspector.Cookies._parseProtocolCookie(target, co okies[i])); 405 allCookies.push(WebInspector.Cookies._parseProtocolCookie(target, co okies[i]));
406 } 406 }
407 407
408 var barrier = new CallbackBarrier(); 408 var barrier = new CallbackBarrier();
409 for (var target of WebInspector.targetManager.targets(WebInspector.Target.Ty pe.Page)) 409 for (var target of WebInspector.targetManager.targets(WebInspector.Target.Ca pability.Network))
410 target.networkAgent().getCookies(barrier.createCallback(mycallback.bind( null, target))); 410 target.networkAgent().getCookies(barrier.createCallback(mycallback.bind( null, target)));
411 barrier.callWhenDone(callback.bind(null, allCookies)); 411 barrier.callWhenDone(callback.bind(null, allCookies));
412 } 412 }
413 413
414 /** 414 /**
415 * @param {!WebInspector.Target} target 415 * @param {!WebInspector.Target} target
416 * @param {!NetworkAgent.Cookie} protocolCookie 416 * @param {!NetworkAgent.Cookie} protocolCookie
417 * @return {!WebInspector.Cookie} 417 * @return {!WebInspector.Cookie}
418 */ 418 */
419 WebInspector.Cookies._parseProtocolCookie = function(target, protocolCookie) 419 WebInspector.Cookies._parseProtocolCookie = function(target, protocolCookie)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 * @param {string} cookieDomain 453 * @param {string} cookieDomain
454 * @param {string} resourceDomain 454 * @param {string} resourceDomain
455 * @return {boolean} 455 * @return {boolean}
456 */ 456 */
457 WebInspector.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain) 457 WebInspector.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain)
458 { 458 {
459 if (cookieDomain.charAt(0) !== ".") 459 if (cookieDomain.charAt(0) !== ".")
460 return resourceDomain === cookieDomain; 460 return resourceDomain === cookieDomain;
461 return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)*" + cookieDomain.sub string(1).escapeForRegExp() + "$", "i")); 461 return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)*" + cookieDomain.sub string(1).escapeForRegExp() + "$", "i"));
462 } 462 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698