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

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

Issue 2203913002: Added trace events for blink feature usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved trace point deeper to catch all code paths Created 4 years, 4 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 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 1325
1326 static UseCounter* getFrom(const Document*); 1326 static UseCounter* getFrom(const Document*);
1327 static UseCounter* getFrom(const CSSStyleSheet*); 1327 static UseCounter* getFrom(const CSSStyleSheet*);
1328 static UseCounter* getFrom(const StyleSheetContents*); 1328 static UseCounter* getFrom(const StyleSheetContents*);
1329 1329
1330 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id); 1330 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id);
1331 1331
1332 void muteForInspector(); 1332 void muteForInspector();
1333 void unmuteForInspector(); 1333 void unmuteForInspector();
1334 1334
1335 void recordMeasurement(Feature feature) 1335 void recordMeasurement(Feature);
1336 {
1337 if (!m_muteCount)
1338 m_countBits.recordMeasurement(feature);
1339 }
1340 void updateMeasurements(); 1336 void updateMeasurements();
1341 1337
1342 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR ecordedMeasurement(feature); } 1338 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR ecordedMeasurement(feature); }
1343 1339
1344 class CountBits { 1340 class CountBits {
1345 DISALLOW_NEW(); 1341 DISALLOW_NEW();
1346 public: 1342 public:
1347 CountBits() : m_bits(NumberOfFeatures) { } 1343 CountBits() : m_bits(NumberOfFeatures) { }
1348 1344
1349 bool hasRecordedMeasurement(Feature feature) const 1345 bool hasRecordedMeasurement(Feature feature) const
(...skipping 22 matching lines...) Expand all
1372 friend class UseCounterTest; 1368 friend class UseCounterTest;
1373 unsigned m_muteCount; 1369 unsigned m_muteCount;
1374 1370
1375 CountBits m_countBits; 1371 CountBits m_countBits;
1376 BitVector m_CSSFeatureBits; 1372 BitVector m_CSSFeatureBits;
1377 }; 1373 };
1378 1374
1379 } // namespace blink 1375 } // namespace blink
1380 1376
1381 #endif // UseCounter_h 1377 #endif // UseCounter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698