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 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 // Add new features immediately above this line. Don't change assigned | 1388 // Add new features immediately above this line. Don't change assigned |
1389 // numbers of any item, and don't reuse removed slots. | 1389 // numbers of any item, and don't reuse removed slots. |
1390 // Also, run update_use_counter_feature_enum.py in | 1390 // Also, run update_use_counter_feature_enum.py in |
1391 // chromium/src/tools/metrics/histograms/ to update the UMA mapping. | 1391 // chromium/src/tools/metrics/histograms/ to update the UMA mapping. |
1392 NumberOfFeatures, // This enum value must be last. | 1392 NumberOfFeatures, // This enum value must be last. |
1393 }; | 1393 }; |
1394 | 1394 |
1395 // "count" sets the bit for this feature to 1. Repeated calls are ignored. | 1395 // "count" sets the bit for this feature to 1. Repeated calls are ignored. |
1396 static void count(const Frame*, Feature); | 1396 static void count(const Frame*, Feature); |
1397 static void count(const Document&, Feature); | 1397 static void count(const Document&, Feature); |
1398 // This doesn't count for ExecutionContexts for shared workers and service | 1398 static void count(ExecutionContext*, Feature); |
1399 // workers. | |
1400 static void count(const ExecutionContext*, Feature); | |
1401 // Use countIfNotPrivateScript() instead of count() if you don't want | 1399 // Use countIfNotPrivateScript() instead of count() if you don't want |
1402 // to count metrics in private scripts. You should use | 1400 // to count metrics in private scripts. You should use |
1403 // countIfNotPrivateScript() in a binding layer. | 1401 // countIfNotPrivateScript() in a binding layer. |
1404 static void countIfNotPrivateScript(v8::Isolate*, const Frame*, Feature); | 1402 static void countIfNotPrivateScript(v8::Isolate*, const Frame*, Feature); |
1405 static void countIfNotPrivateScript(v8::Isolate*, const Document&, Feature); | 1403 static void countIfNotPrivateScript(v8::Isolate*, const Document&, Feature); |
1406 static void countIfNotPrivateScript(v8::Isolate*, | 1404 static void countIfNotPrivateScript(v8::Isolate*, ExecutionContext*, Feature); |
1407 const ExecutionContext*, | |
1408 Feature); | |
1409 | 1405 |
1410 void count(CSSParserMode, CSSPropertyID); | 1406 void count(CSSParserMode, CSSPropertyID); |
1411 void count(Feature); | 1407 void count(Feature); |
1412 | 1408 |
1413 // Count only features if they're being used in an iframe which does not | 1409 // Count only features if they're being used in an iframe which does not |
1414 // have script access into the top level document. | 1410 // have script access into the top level document. |
1415 static void countCrossOriginIframe(const Document&, Feature); | 1411 static void countCrossOriginIframe(const Document&, Feature); |
1416 | 1412 |
1417 // Return whether the Feature was previously counted for this document. | 1413 // Return whether the Feature was previously counted for this document. |
1418 // NOTE: only for use in testing. | 1414 // NOTE: only for use in testing. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 // Tracks what features/properties need to be reported to the legacy | 1461 // Tracks what features/properties need to be reported to the legacy |
1466 // histograms. | 1462 // histograms. |
1467 BitVector m_featureBits; | 1463 BitVector m_featureBits; |
1468 BitVector m_CSSBits; | 1464 BitVector m_CSSBits; |
1469 } m_legacyCounter; | 1465 } m_legacyCounter; |
1470 }; | 1466 }; |
1471 | 1467 |
1472 } // namespace blink | 1468 } // namespace blink |
1473 | 1469 |
1474 #endif // UseCounter_h | 1470 #endif // UseCounter_h |
OLD | NEW |