Chromium Code Reviews| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 // anonymously through the Histogram recording system in Chrome | 52 // anonymously through the Histogram recording system in Chrome |
| 53 // for users who opt-in to "Usage Statistics" submission | 53 // for users who opt-in to "Usage Statistics" submission |
| 54 // during their install of Google Chrome: | 54 // during their install of Google Chrome: |
| 55 // http://www.google.com/chrome/intl/en/privacy.html | 55 // http://www.google.com/chrome/intl/en/privacy.html |
| 56 | 56 |
| 57 class CORE_EXPORT UseCounter { | 57 class CORE_EXPORT UseCounter { |
| 58 DISALLOW_NEW(); | 58 DISALLOW_NEW(); |
| 59 WTF_MAKE_NONCOPYABLE(UseCounter); | 59 WTF_MAKE_NONCOPYABLE(UseCounter); |
| 60 public: | 60 public: |
| 61 UseCounter(); | 61 UseCounter(); |
| 62 ~UseCounter(); | |
| 63 | 62 |
| 64 enum Feature { | 63 enum Feature { |
| 65 // Do not change assigned numbers of existing items: add new features | 64 // Do not change assigned numbers of existing items: add new features |
| 66 // to the end of the list. | 65 // to the end of the list. |
| 67 PageDestruction = 0, | 66 OBSOLETE_PageDestruction = 0, |
| 68 PrefixedIndexedDB = 3, | 67 PrefixedIndexedDB = 3, |
| 69 WorkerStart = 4, | 68 WorkerStart = 4, |
| 70 SharedWorkerStart = 5, | 69 SharedWorkerStart = 5, |
| 71 UnprefixedIndexedDB = 9, | 70 UnprefixedIndexedDB = 9, |
| 72 OpenWebDatabase = 10, | 71 OpenWebDatabase = 10, |
| 73 UnprefixedRequestAnimationFrame = 13, | 72 UnprefixedRequestAnimationFrame = 13, |
| 74 PrefixedRequestAnimationFrame = 14, | 73 PrefixedRequestAnimationFrame = 14, |
| 75 ContentSecurityPolicy = 15, | 74 ContentSecurityPolicy = 15, |
| 76 ContentSecurityPolicyReportOnly = 16, | 75 ContentSecurityPolicyReportOnly = 16, |
| 77 PrefixedTransitionEndEvent = 18, | 76 PrefixedTransitionEndEvent = 18, |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1331 | 1330 |
| 1332 void muteForInspector(); | 1331 void muteForInspector(); |
| 1333 void unmuteForInspector(); | 1332 void unmuteForInspector(); |
| 1334 | 1333 |
| 1335 void recordMeasurement(Feature); | 1334 void recordMeasurement(Feature); |
| 1336 void updateMeasurements(); | 1335 void updateMeasurements(); |
| 1337 | 1336 |
| 1338 bool hasRecordedMeasurement(Feature) const; | 1337 bool hasRecordedMeasurement(Feature) const; |
| 1339 | 1338 |
| 1340 protected: | 1339 protected: |
| 1341 friend class UseCounterTest; | 1340 // Encapsulates the work to preserve the old "FeatureObserver" histogram wit h original semantics |
| 1341 // TODO(rbyers): remove this - http://crbug.com/597963 | |
| 1342 class LegacyCounter { | |
|
Nico
2016/09/13 14:16:47
this needs a CORE_EXPORT, else release component b
| |
| 1343 public: | |
| 1344 LegacyCounter(); | |
| 1345 ~LegacyCounter(); | |
| 1346 void countFeature(Feature); | |
| 1347 void countCSS(CSSPropertyID); | |
| 1348 void updateMeasurements(); | |
| 1349 private: | |
| 1350 // Tracks what features/properties need to be reported to the legacy his tograms. | |
| 1351 BitVector m_featureBits; | |
| 1352 BitVector m_CSSBits; | |
| 1353 } m_legacyCounter; | |
| 1354 | |
| 1342 unsigned m_muteCount; | 1355 unsigned m_muteCount; |
| 1343 | 1356 |
| 1344 BitVector m_featureBits; | 1357 // Track what features/properties have been reported to the (non-legacy) his tograms. |
| 1345 BitVector m_CSSFeatureBits; | 1358 BitVector m_featuresRecorded; |
| 1359 BitVector m_CSSRecorded; | |
| 1346 }; | 1360 }; |
| 1347 | 1361 |
| 1348 } // namespace blink | 1362 } // namespace blink |
| 1349 | 1363 |
| 1350 #endif // UseCounter_h | 1364 #endif // UseCounter_h |
| OLD | NEW |