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

Side by Side Diff: Source/devtools/front_end/audits/AuditRules.js

Issue 685203003: DevTools: Get rid of synchronous XHRs in the frontend code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 1 month 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 | Annotate | Revision Log
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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 this._styleSheetsParsedCallback(this._styleSheets); 527 this._styleSheetsParsedCallback(this._styleSheets);
528 }, 528 },
529 529
530 _processNextStyleSheet: function() 530 _processNextStyleSheet: function()
531 { 531 {
532 if (!this._styleSheetHeaders.length) { 532 if (!this._styleSheetHeaders.length) {
533 this._finish(); 533 this._finish();
534 return; 534 return;
535 } 535 }
536 this._currentStyleSheetHeader = this._styleSheetHeaders.shift(); 536 this._currentStyleSheetHeader = this._styleSheetHeaders.shift();
537 this._parser.fetchAndParse(this._currentStyleSheetHeader, this._onStyleS heetParsed.bind(this)); 537 this._parser.fetchAndParse(this._currentStyleSheetHeader).then(this._onS tyleSheetParsed.bind(this)).done();
538 }, 538 },
539 539
540 /** 540 /**
541 * @param {!Array.<!WebInspector.CSSParser.Rule>} rules 541 * @param {!Array.<!WebInspector.CSSParser.Rule>} rules
542 */ 542 */
543 _onStyleSheetParsed: function(rules) 543 _onStyleSheetParsed: function(rules)
544 { 544 {
545 if (this._progress.isCanceled()) { 545 if (this._progress.isCanceled()) {
546 this._terminateWorker(); 546 this._terminateWorker();
547 return; 547 return;
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 result.violationCount = badUrls.length; 1597 result.violationCount = badUrls.length;
1598 }, 1598 },
1599 1599
1600 _collectorCallback: function(matchingResourceData, request, cookie) 1600 _collectorCallback: function(matchingResourceData, request, cookie)
1601 { 1601 {
1602 matchingResourceData[request.url] = (matchingResourceData[request.url] | | 0) + cookie.size(); 1602 matchingResourceData[request.url] = (matchingResourceData[request.url] | | 0) + cookie.size();
1603 }, 1603 },
1604 1604
1605 __proto__: WebInspector.AuditRules.CookieRuleBase.prototype 1605 __proto__: WebInspector.AuditRules.CookieRuleBase.prototype
1606 } 1606 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698