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

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: Only trace first use of each feature 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 1313
1314 static UseCounter* getFrom(const Document*); 1314 static UseCounter* getFrom(const Document*);
1315 static UseCounter* getFrom(const CSSStyleSheet*); 1315 static UseCounter* getFrom(const CSSStyleSheet*);
1316 static UseCounter* getFrom(const StyleSheetContents*); 1316 static UseCounter* getFrom(const StyleSheetContents*);
1317 1317
1318 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id); 1318 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id);
1319 1319
1320 void muteForInspector(); 1320 void muteForInspector();
1321 void unmuteForInspector(); 1321 void unmuteForInspector();
1322 1322
1323 void recordMeasurement(Feature feature) 1323 void recordMeasurement(Feature);
1324 {
1325 if (!m_muteCount)
1326 m_countBits.recordMeasurement(feature);
1327 }
1328 void updateMeasurements(); 1324 void updateMeasurements();
1329 1325
1330 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR ecordedMeasurement(feature); } 1326 bool hasRecordedMeasurement(Feature feature) const { return m_countBits.hasR ecordedMeasurement(feature); }
1331 1327
1332 class CountBits { 1328 class CountBits {
1333 DISALLOW_NEW(); 1329 DISALLOW_NEW();
1334 public: 1330 public:
1335 CountBits() : m_bits(NumberOfFeatures) { } 1331 CountBits() : m_bits(NumberOfFeatures) { }
1336 1332
1337 bool hasRecordedMeasurement(Feature feature) const 1333 bool hasRecordedMeasurement(Feature feature) const
(...skipping 22 matching lines...) Expand all
1360 friend class UseCounterTest; 1356 friend class UseCounterTest;
1361 unsigned m_muteCount; 1357 unsigned m_muteCount;
1362 1358
1363 CountBits m_countBits; 1359 CountBits m_countBits;
1364 BitVector m_CSSFeatureBits; 1360 BitVector m_CSSFeatureBits;
1365 }; 1361 };
1366 1362
1367 } // namespace blink 1363 } // namespace blink
1368 1364
1369 #endif // UseCounter_h 1365 #endif // UseCounter_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698