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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 */ | 1051 */ |
1052 doRun: function(requests, result, callback, progress) | 1052 doRun: function(requests, result, callback, progress) |
1053 { | 1053 { |
1054 CSSAgent.getAllStyleSheets(sheetsCallback.bind(this)); | 1054 CSSAgent.getAllStyleSheets(sheetsCallback.bind(this)); |
1055 | 1055 |
1056 function sheetsCallback(error, headers) | 1056 function sheetsCallback(error, headers) |
1057 { | 1057 { |
1058 if (error) | 1058 if (error) |
1059 return callback(null); | 1059 return callback(null); |
1060 | 1060 |
| 1061 if (!headers.length) |
| 1062 return callback(null); |
1061 for (var i = 0; i < headers.length; ++i) { | 1063 for (var i = 0; i < headers.length; ++i) { |
1062 var header = headers[i]; | 1064 var header = headers[i]; |
1063 if (header.disabled) | 1065 if (header.disabled) |
1064 continue; // Do not check disabled stylesheets. | 1066 continue; // Do not check disabled stylesheets. |
1065 | 1067 |
1066 this._visitStyleSheet(header.styleSheetId, i === headers.length
- 1 ? finishedCallback : null, result, progress); | 1068 this._visitStyleSheet(header.styleSheetId, i === headers.length
- 1 ? finishedCallback : null, result, progress); |
1067 } | 1069 } |
1068 } | 1070 } |
1069 | 1071 |
1070 function finishedCallback() | 1072 function finishedCallback() |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 result.violationCount = badUrls.length; | 1403 result.violationCount = badUrls.length; |
1402 }, | 1404 }, |
1403 | 1405 |
1404 _collectorCallback: function(matchingResourceData, request, cookie) | 1406 _collectorCallback: function(matchingResourceData, request, cookie) |
1405 { | 1407 { |
1406 matchingResourceData[request.url] = (matchingResourceData[request.url] |
| 0) + cookie.size(); | 1408 matchingResourceData[request.url] = (matchingResourceData[request.url] |
| 0) + cookie.size(); |
1407 }, | 1409 }, |
1408 | 1410 |
1409 __proto__: WebInspector.AuditRules.CookieRuleBase.prototype | 1411 __proto__: WebInspector.AuditRules.CookieRuleBase.prototype |
1410 } | 1412 } |
OLD | NEW |