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

Side by Side Diff: third_party/WebKit/Source/core/frame/UseCounter.cpp

Issue 2535093003: Worker: Connect UseCounter to workers and worklets (Closed)
Patch Set: 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) 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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 return host->useCounter().isCounted(unresolvedProperty); 1173 return host->useCounter().isCounted(unresolvedProperty);
1174 } 1174 }
1175 1175
1176 void UseCounter::count(const ExecutionContext* context, Feature feature) { 1176 void UseCounter::count(const ExecutionContext* context, Feature feature) {
1177 if (!context) 1177 if (!context)
1178 return; 1178 return;
1179 if (context->isDocument()) { 1179 if (context->isDocument()) {
1180 count(*toDocument(context), feature); 1180 count(*toDocument(context), feature);
1181 return; 1181 return;
1182 } 1182 }
1183 if (context->isWorkerGlobalScope()) 1183 if (context->isWorkerOrWorkletGlobalScope())
1184 toWorkerGlobalScope(context)->countFeature(feature); 1184 toWorkerOrWorkletGlobalScope(context)->countFeature(feature);
1185 } 1185 }
1186 1186
1187 void UseCounter::countIfNotPrivateScript(v8::Isolate* isolate, 1187 void UseCounter::countIfNotPrivateScript(v8::Isolate* isolate,
1188 const Frame* frame, 1188 const Frame* frame,
1189 Feature feature) { 1189 Feature feature) {
1190 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) 1190 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld())
1191 return; 1191 return;
1192 UseCounter::count(frame, feature); 1192 UseCounter::count(frame, feature);
1193 } 1193 }
1194 1194
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 } 1342 }
1343 } 1343 }
1344 1344
1345 if (needsPagesMeasuredUpdate) 1345 if (needsPagesMeasuredUpdate)
1346 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); 1346 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId());
1347 1347
1348 m_CSSBits.clearAll(); 1348 m_CSSBits.clearAll();
1349 } 1349 }
1350 1350
1351 } // namespace blink 1351 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698