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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 ContentEditableTrueOnHTML = 1131, | 987 ContentEditableTrueOnHTML = 1131, |
988 ContentEditablePlainTextOnly = 1132, | 988 ContentEditablePlainTextOnly = 1132, |
989 V8RegExpPrototypeUnicodeGetter = 1133, | 989 V8RegExpPrototypeUnicodeGetter = 1133, |
990 V8IntlV8Parse = 1134, | 990 V8IntlV8Parse = 1134, |
991 V8IntlPattern = 1135, | 991 V8IntlPattern = 1135, |
992 V8IntlResolved = 1136, | 992 V8IntlResolved = 1136, |
993 V8PromiseChain = 1137, | 993 V8PromiseChain = 1137, |
994 V8PromiseAccept = 1138, | 994 V8PromiseAccept = 1138, |
995 V8PromiseDefer = 1139, | 995 V8PromiseDefer = 1139, |
996 EventScoped = 1140, | 996 EventScoped = 1140, |
| 997 GeolocationInsecureOriginIframe = 1141, |
| 998 GeolocationSecureOriginIframe = 1142, |
| 999 RequestMIDIAccessIframe = 1143, |
| 1000 GetUserMediaInsecureOriginIframe = 1144, |
| 1001 GetUserMediaSecureOriginIframe = 1145, |
| 1002 ElementRequestPointerLockIframe = 1146, |
| 1003 NotificationAPIInsecureOriginIframe = 1147, |
| 1004 NotificationAPISecureOriginIframe = 1148, |
997 | 1005 |
998 // Add new features immediately above this line. Don't change assigned | 1006 // Add new features immediately above this line. Don't change assigned |
999 // numbers of any item, and don't reuse removed slots. | 1007 // numbers of any item, and don't reuse removed slots. |
1000 // Also, run update_use_counter_feature_enum.py in chromium/src/tools/me
trics/histograms/ | 1008 // Also, run update_use_counter_feature_enum.py in chromium/src/tools/me
trics/histograms/ |
1001 // to update the UMA mapping. | 1009 // to update the UMA mapping. |
1002 NumberOfFeatures, // This enum value must be last. | 1010 NumberOfFeatures, // This enum value must be last. |
1003 }; | 1011 }; |
1004 | 1012 |
1005 // "count" sets the bit for this feature to 1. Repeated calls are ignored. | 1013 // "count" sets the bit for this feature to 1. Repeated calls are ignored. |
1006 static void count(const Frame*, Feature); | 1014 static void count(const Frame*, Feature); |
(...skipping 22 matching lines...) Expand all Loading... |
1029 // doesn't count the usage but only sends a console warning. | 1037 // doesn't count the usage but only sends a console warning. |
1030 static void countDeprecation(const LocalFrame*, Feature); | 1038 static void countDeprecation(const LocalFrame*, Feature); |
1031 static void countDeprecation(ExecutionContext*, Feature); | 1039 static void countDeprecation(ExecutionContext*, Feature); |
1032 static void countDeprecation(const Document&, Feature); | 1040 static void countDeprecation(const Document&, Feature); |
1033 // Use countDeprecationIfNotPrivateScript() instead of countDeprecation() | 1041 // Use countDeprecationIfNotPrivateScript() instead of countDeprecation() |
1034 // if you don't want to count metrics in private scripts. You should use | 1042 // if you don't want to count metrics in private scripts. You should use |
1035 // countDeprecationIfNotPrivateScript() in a binding layer. | 1043 // countDeprecationIfNotPrivateScript() in a binding layer. |
1036 static void countDeprecationIfNotPrivateScript(v8::Isolate*, ExecutionContex
t*, Feature); | 1044 static void countDeprecationIfNotPrivateScript(v8::Isolate*, ExecutionContex
t*, Feature); |
1037 static String deprecationMessage(Feature); | 1045 static String deprecationMessage(Feature); |
1038 | 1046 |
| 1047 // Count only features if they're being used in an iframe which does not |
| 1048 // have script access into the top level document. |
| 1049 static void countCrossOriginIframe(const Document&, Feature); |
| 1050 |
1039 // Return whether the Feature was previously counted for this document. | 1051 // Return whether the Feature was previously counted for this document. |
1040 // NOTE: only for use in testing. | 1052 // NOTE: only for use in testing. |
1041 static bool isCounted(Document&, Feature); | 1053 static bool isCounted(Document&, Feature); |
1042 | 1054 |
1043 void didCommitLoad(); | 1055 void didCommitLoad(); |
1044 | 1056 |
1045 static UseCounter* getFrom(const Document*); | 1057 static UseCounter* getFrom(const Document*); |
1046 static UseCounter* getFrom(const CSSStyleSheet*); | 1058 static UseCounter* getFrom(const CSSStyleSheet*); |
1047 static UseCounter* getFrom(const StyleSheetContents*); | 1059 static UseCounter* getFrom(const StyleSheetContents*); |
1048 | 1060 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 | 1103 |
1092 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR
ecordedMeasurement(feature); } | 1104 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR
ecordedMeasurement(feature); } |
1093 | 1105 |
1094 CountBits m_countBits; | 1106 CountBits m_countBits; |
1095 BitVector m_CSSFeatureBits; | 1107 BitVector m_CSSFeatureBits; |
1096 }; | 1108 }; |
1097 | 1109 |
1098 } // namespace blink | 1110 } // namespace blink |
1099 | 1111 |
1100 #endif // UseCounter_h | 1112 #endif // UseCounter_h |
OLD | NEW |