| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google, Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 if (!context) | 1183 if (!context) |
| 1184 return; | 1184 return; |
| 1185 if (context->isDocument()) { | 1185 if (context->isDocument()) { |
| 1186 count(*toDocument(context), feature); | 1186 count(*toDocument(context), feature); |
| 1187 return; | 1187 return; |
| 1188 } | 1188 } |
| 1189 if (context->isWorkerOrWorkletGlobalScope()) | 1189 if (context->isWorkerOrWorkletGlobalScope()) |
| 1190 toWorkerOrWorkletGlobalScope(context)->countFeature(feature); | 1190 toWorkerOrWorkletGlobalScope(context)->countFeature(feature); |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 void UseCounter::countIfNotPrivateScript(v8::Isolate* isolate, | |
| 1194 const Frame* frame, | |
| 1195 Feature feature) { | |
| 1196 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) | |
| 1197 return; | |
| 1198 UseCounter::count(frame, feature); | |
| 1199 } | |
| 1200 | |
| 1201 void UseCounter::countIfNotPrivateScript(v8::Isolate* isolate, | |
| 1202 const Document& document, | |
| 1203 Feature feature) { | |
| 1204 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) | |
| 1205 return; | |
| 1206 UseCounter::count(document, feature); | |
| 1207 } | |
| 1208 | |
| 1209 void UseCounter::countIfNotPrivateScript(v8::Isolate* isolate, | |
| 1210 ExecutionContext* context, | |
| 1211 Feature feature) { | |
| 1212 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) | |
| 1213 return; | |
| 1214 UseCounter::count(context, feature); | |
| 1215 } | |
| 1216 | |
| 1217 void UseCounter::countCrossOriginIframe(const Document& document, | 1193 void UseCounter::countCrossOriginIframe(const Document& document, |
| 1218 Feature feature) { | 1194 Feature feature) { |
| 1219 LocalFrame* frame = document.frame(); | 1195 LocalFrame* frame = document.frame(); |
| 1220 if (frame && frame->isCrossOriginSubframe()) | 1196 if (frame && frame->isCrossOriginSubframe()) |
| 1221 count(frame, feature); | 1197 count(frame, feature); |
| 1222 } | 1198 } |
| 1223 | 1199 |
| 1224 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID property) { | 1200 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID property) { |
| 1225 DCHECK(isCSSPropertyIDWithName(property)); | 1201 DCHECK(isCSSPropertyIDWithName(property)); |
| 1226 | 1202 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1349 } | 1325 } |
| 1350 } | 1326 } |
| 1351 | 1327 |
| 1352 if (needsPagesMeasuredUpdate) | 1328 if (needsPagesMeasuredUpdate) |
| 1353 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); | 1329 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); |
| 1354 | 1330 |
| 1355 m_CSSBits.clearAll(); | 1331 m_CSSBits.clearAll(); |
| 1356 } | 1332 } |
| 1357 | 1333 |
| 1358 } // namespace blink | 1334 } // namespace blink |
| OLD | NEW |