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

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

Issue 2568503002: devtools: Split Network.getCookies into Network.get{All,}Cookies (Closed)
Patch Set: Rebased Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/inspector/inspector_protocol_config.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 var global = false; 388 target.networkAgent().getCookies(barrier.createCallback(mycallback.bind(null , target)));
389 target.networkAgent().getCookies(global, barrier.createCallback(mycallback.b ind(null, target)));
390 }
391 barrier.callWhenDone(callback.bind(null, allCookies)); 389 barrier.callWhenDone(callback.bind(null, allCookies));
392 }; 390 };
393 391
394 /** 392 /**
395 * @param {!SDK.Target} target 393 * @param {!SDK.Target} target
396 * @param {!Protocol.Network.Cookie} protocolCookie 394 * @param {!Protocol.Network.Cookie} protocolCookie
397 * @return {!SDK.Cookie} 395 * @return {!SDK.Cookie}
398 */ 396 */
399 SDK.Cookies._parseProtocolCookie = function(target, protocolCookie) { 397 SDK.Cookies._parseProtocolCookie = function(target, protocolCookie) {
400 var cookie = new SDK.Cookie(target, protocolCookie.name, protocolCookie.value, null); 398 var cookie = new SDK.Cookie(target, protocolCookie.name, protocolCookie.value, null);
(...skipping 29 matching lines...) Expand all
430 /** 428 /**
431 * @param {string} cookieDomain 429 * @param {string} cookieDomain
432 * @param {string} resourceDomain 430 * @param {string} resourceDomain
433 * @return {boolean} 431 * @return {boolean}
434 */ 432 */
435 SDK.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceD omain) { 433 SDK.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceD omain) {
436 if (cookieDomain.charAt(0) !== '.') 434 if (cookieDomain.charAt(0) !== '.')
437 return resourceDomain === cookieDomain; 435 return resourceDomain === cookieDomain;
438 return !!resourceDomain.match(new RegExp('^([^\\.]+\\.)*' + cookieDomain.subst ring(1).escapeForRegExp() + '$', 'i')); 436 return !!resourceDomain.match(new RegExp('^([^\\.]+\\.)*' + cookieDomain.subst ring(1).escapeForRegExp() + '$', 'i'));
439 }; 437 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/inspector_protocol_config.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698