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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // features are used and thus when it's safe to remove or change them. | 49 // features are used and thus when it's safe to remove or change them. |
50 // | 50 // |
51 // The Chromium Content layer controls what is done with this data. | 51 // The Chromium Content layer controls what is done with this data. |
52 // For instance, in Google Chrome, these counts are submitted | 52 // For instance, in Google Chrome, these counts are submitted |
53 // anonymously through the Histogram recording system in Chrome | 53 // anonymously through the Histogram recording system in Chrome |
54 // for users who opt-in to "Usage Statistics" submission | 54 // for users who opt-in to "Usage Statistics" submission |
55 // during their install of Google Chrome: | 55 // during their install of Google Chrome: |
56 // http://www.google.com/chrome/intl/en/privacy.html | 56 // http://www.google.com/chrome/intl/en/privacy.html |
57 | 57 |
58 class CORE_EXPORT UseCounter { | 58 class CORE_EXPORT UseCounter { |
59 DISALLOW_ALLOCATION(); | 59 DISALLOW_NEW(); |
60 WTF_MAKE_NONCOPYABLE(UseCounter); | 60 WTF_MAKE_NONCOPYABLE(UseCounter); |
61 public: | 61 public: |
62 UseCounter(); | 62 UseCounter(); |
63 ~UseCounter(); | 63 ~UseCounter(); |
64 | 64 |
65 enum Feature { | 65 enum Feature { |
66 // Do not change assigned numbers of existing items: add new features | 66 // Do not change assigned numbers of existing items: add new features |
67 // to the end of the list. | 67 // to the end of the list. |
68 PageDestruction = 0, | 68 PageDestruction = 0, |
69 PrefixedIndexedDB = 3, | 69 PrefixedIndexedDB = 3, |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 static UseCounter* getFrom(const Document*); | 909 static UseCounter* getFrom(const Document*); |
910 static UseCounter* getFrom(const CSSStyleSheet*); | 910 static UseCounter* getFrom(const CSSStyleSheet*); |
911 static UseCounter* getFrom(const StyleSheetContents*); | 911 static UseCounter* getFrom(const StyleSheetContents*); |
912 | 912 |
913 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id); | 913 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id); |
914 | 914 |
915 static void muteForInspector(); | 915 static void muteForInspector(); |
916 static void unmuteForInspector(); | 916 static void unmuteForInspector(); |
917 | 917 |
918 class CountBits { | 918 class CountBits { |
919 DISALLOW_ALLOCATION(); | 919 DISALLOW_NEW(); |
920 public: | 920 public: |
921 CountBits() : m_bits(NumberOfFeatures) { } | 921 CountBits() : m_bits(NumberOfFeatures) { } |
922 | 922 |
923 bool hasRecordedMeasurement(Feature feature) const | 923 bool hasRecordedMeasurement(Feature feature) const |
924 { | 924 { |
925 if (UseCounter::m_muteCount) | 925 if (UseCounter::m_muteCount) |
926 return false; | 926 return false; |
927 ASSERT(feature != PageDestruction); // PageDestruction is reserved a
s a scaling factor. | 927 ASSERT(feature != PageDestruction); // PageDestruction is reserved a
s a scaling factor. |
928 ASSERT(feature < NumberOfFeatures); | 928 ASSERT(feature < NumberOfFeatures); |
929 | 929 |
(...skipping 25 matching lines...) Expand all Loading... |
955 | 955 |
956 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR
ecordedMeasurement(feature); } | 956 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR
ecordedMeasurement(feature); } |
957 | 957 |
958 CountBits m_countBits; | 958 CountBits m_countBits; |
959 BitVector m_CSSFeatureBits; | 959 BitVector m_CSSFeatureBits; |
960 }; | 960 }; |
961 | 961 |
962 } // namespace blink | 962 } // namespace blink |
963 | 963 |
964 #endif // UseCounter_h | 964 #endif // UseCounter_h |
OLD | NEW |