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

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

Issue 1578263006: Add metrics for usage of permission features from iframes in blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 SVG1DOMMaskElement = 1108, 964 SVG1DOMMaskElement = 1108,
965 V8SVGAElement_Target_AttributeGetter = 1109, 965 V8SVGAElement_Target_AttributeGetter = 1109,
966 V8SVGClipPathElement_ClipPathUnits_AttributeGetter = 1110, 966 V8SVGClipPathElement_ClipPathUnits_AttributeGetter = 1110,
967 SVG1DOMFitToViewBox = 1111, 967 SVG1DOMFitToViewBox = 1111,
968 SVG1DOMCursorElement = 1112, 968 SVG1DOMCursorElement = 1112,
969 V8SVGPathElement_PathLength_AttributeGetter = 1113, 969 V8SVGPathElement_PathLength_AttributeGetter = 1113,
970 SVG1DOMSVGElement = 1114, 970 SVG1DOMSVGElement = 1114,
971 SVG1DOMImageElement = 1115, 971 SVG1DOMImageElement = 1115,
972 SVG1DOMForeignObjectElement = 1116, 972 SVG1DOMForeignObjectElement = 1116,
973 AudioContextCreateIIRFilter = 1117, 973 AudioContextCreateIIRFilter = 1117,
974 GeolocationInsecureOriginIframe = 1118,
975 GeolocationSecureOriginIframe = 1119,
976 RequestMIDIAccessIframe = 1120,
977 GetUserMediaSecureOriginIframe = 1121,
978 ElementRequestPointerLockIframe = 1122,
979 NotificationAPIInsecureOriginIframe = 1123,
980 NotificationAPISecureOriginIframe = 1124,
974 981
975 // Add new features immediately above this line. Don't change assigned 982 // Add new features immediately above this line. Don't change assigned
976 // numbers of any item, and don't reuse removed slots. 983 // numbers of any item, and don't reuse removed slots.
977 // Also, run update_use_counter_feature_enum.py in chromium/src/tools/me trics/histograms/ 984 // Also, run update_use_counter_feature_enum.py in chromium/src/tools/me trics/histograms/
978 // to update the UMA mapping. 985 // to update the UMA mapping.
979 NumberOfFeatures, // This enum value must be last. 986 NumberOfFeatures, // This enum value must be last.
980 }; 987 };
981 988
982 // "count" sets the bit for this feature to 1. Repeated calls are ignored. 989 // "count" sets the bit for this feature to 1. Repeated calls are ignored.
983 static void count(const Frame*, Feature); 990 static void count(const Frame*, Feature);
(...skipping 22 matching lines...) Expand all
1006 // doesn't count the usage but only sends a console warning. 1013 // doesn't count the usage but only sends a console warning.
1007 static void countDeprecation(const LocalFrame*, Feature); 1014 static void countDeprecation(const LocalFrame*, Feature);
1008 static void countDeprecation(ExecutionContext*, Feature); 1015 static void countDeprecation(ExecutionContext*, Feature);
1009 static void countDeprecation(const Document&, Feature); 1016 static void countDeprecation(const Document&, Feature);
1010 // Use countDeprecationIfNotPrivateScript() instead of countDeprecation() 1017 // Use countDeprecationIfNotPrivateScript() instead of countDeprecation()
1011 // if you don't want to count metrics in private scripts. You should use 1018 // if you don't want to count metrics in private scripts. You should use
1012 // countDeprecationIfNotPrivateScript() in a binding layer. 1019 // countDeprecationIfNotPrivateScript() in a binding layer.
1013 static void countDeprecationIfNotPrivateScript(v8::Isolate*, ExecutionContex t*, Feature); 1020 static void countDeprecationIfNotPrivateScript(v8::Isolate*, ExecutionContex t*, Feature);
1014 static String deprecationMessage(Feature); 1021 static String deprecationMessage(Feature);
1015 1022
1023 // Count only features if they're being used in a cross-origin iframe.
1024 static void countCrossOriginIframe(const Document&, Feature);
1025
1016 // Return whether the Feature was previously counted for this document. 1026 // Return whether the Feature was previously counted for this document.
1017 // NOTE: only for use in testing. 1027 // NOTE: only for use in testing.
1018 static bool isCounted(Document&, Feature); 1028 static bool isCounted(Document&, Feature);
1019 1029
1020 void didCommitLoad(); 1030 void didCommitLoad();
1021 1031
1022 static UseCounter* getFrom(const Document*); 1032 static UseCounter* getFrom(const Document*);
1023 static UseCounter* getFrom(const CSSStyleSheet*); 1033 static UseCounter* getFrom(const CSSStyleSheet*);
1024 static UseCounter* getFrom(const StyleSheetContents*); 1034 static UseCounter* getFrom(const StyleSheetContents*);
1025 1035
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 1078
1069 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR ecordedMeasurement(feature); } 1079 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR ecordedMeasurement(feature); }
1070 1080
1071 CountBits m_countBits; 1081 CountBits m_countBits;
1072 BitVector m_CSSFeatureBits; 1082 BitVector m_CSSFeatureBits;
1073 }; 1083 };
1074 1084
1075 } // namespace blink 1085 } // namespace blink
1076 1086
1077 #endif // UseCounter_h 1087 #endif // UseCounter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698