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

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

Issue 2563553002: DevTools: Disallow console.log statements with eslint (Closed)
Patch Set: merge 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
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 _extractKeyValue() { 134 _extractKeyValue() {
135 if (!this._input || !this._input.length) 135 if (!this._input || !this._input.length)
136 return null; 136 return null;
137 // Note: RFCs offer an option for quoted values that may contain commas and semicolons. 137 // Note: RFCs offer an option for quoted values that may contain commas and semicolons.
138 // Many browsers/platforms do not support this, however (see http://webkit.o rg/b/16699 138 // Many browsers/platforms do not support this, however (see http://webkit.o rg/b/16699
139 // and http://crbug.com/12361). The logic below matches latest versions of I E, Firefox, 139 // and http://crbug.com/12361). The logic below matches latest versions of I E, Firefox,
140 // Chrome and Safari on some old platforms. The latest version of Safari sup ports quoted 140 // Chrome and Safari on some old platforms. The latest version of Safari sup ports quoted
141 // cookie values, though. 141 // cookie values, though.
142 var keyValueMatch = /^[ \t]*([^\s=;]+)[ \t]*(?:=[ \t]*([^;\n]*))?/.exec(this ._input); 142 var keyValueMatch = /^[ \t]*([^\s=;]+)[ \t]*(?:=[ \t]*([^;\n]*))?/.exec(this ._input);
143 if (!keyValueMatch) { 143 if (!keyValueMatch) {
144 console.log('Failed parsing cookie header before: ' + this._input); 144 console.error('Failed parsing cookie header before: ' + this._input);
145 return null; 145 return null;
146 } 146 }
147 147
148 var result = new SDK.CookieParser.KeyValue( 148 var result = new SDK.CookieParser.KeyValue(
149 keyValueMatch[1], keyValueMatch[2] && keyValueMatch[2].trim(), this._ori ginalInputLength - this._input.length); 149 keyValueMatch[1], keyValueMatch[2] && keyValueMatch[2].trim(), this._ori ginalInputLength - this._input.length);
150 this._input = this._input.slice(keyValueMatch[0].length); 150 this._input = this._input.slice(keyValueMatch[0].length);
151 return result; 151 return result;
152 } 152 }
153 153
154 /** 154 /**
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 /** 430 /**
431 * @param {string} cookieDomain 431 * @param {string} cookieDomain
432 * @param {string} resourceDomain 432 * @param {string} resourceDomain
433 * @return {boolean} 433 * @return {boolean}
434 */ 434 */
435 SDK.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceD omain) { 435 SDK.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceD omain) {
436 if (cookieDomain.charAt(0) !== '.') 436 if (cookieDomain.charAt(0) !== '.')
437 return resourceDomain === cookieDomain; 437 return resourceDomain === cookieDomain;
438 return !!resourceDomain.match(new RegExp('^([^\\.]+\\.)*' + cookieDomain.subst ring(1).escapeForRegExp() + '$', 'i')); 438 return !!resourceDomain.match(new RegExp('^([^\\.]+\\.)*' + cookieDomain.subst ring(1).escapeForRegExp() + '$', 'i'));
439 }; 439 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698