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

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

Issue 1937773002: remove obsolete todo note for CSS property to histogram id mapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | no next file » | 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 25 matching lines...) Expand all
36 #include "core/inspector/ConsoleMessage.h" 36 #include "core/inspector/ConsoleMessage.h"
37 #include "core/workers/WorkerGlobalScope.h" 37 #include "core/workers/WorkerGlobalScope.h"
38 #include "platform/Histogram.h" 38 #include "platform/Histogram.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 static int totalPagesMeasuredCSSSampleId() { return 1; } 42 static int totalPagesMeasuredCSSSampleId() { return 1; }
43 43
44 int UseCounter::m_muteCount = 0; 44 int UseCounter::m_muteCount = 0;
45 45
46 // FIXME : This mapping should be autogenerated. This function should
47 // be moved to a separate file and a script run at build time
48 // to detect new values in CSSPropertyID and add them to the
49 // end of this function. This file would be checked in.
50 // https://code.google.com/p/chromium/issues/detail?id=234940
51 int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(int id) 46 int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(int id)
52 { 47 {
53 CSSPropertyID cssPropertyID = static_cast<CSSPropertyID>(id); 48 CSSPropertyID cssPropertyID = static_cast<CSSPropertyID>(id);
54 49
55 switch (cssPropertyID) { 50 switch (cssPropertyID) {
56 // Begin at 2, because 1 is reserved for totalPagesMeasuredCSSSampleId. 51 // Begin at 2, because 1 is reserved for totalPagesMeasuredCSSSampleId.
57 case CSSPropertyColor: return 2; 52 case CSSPropertyColor: return 2;
58 case CSSPropertyDirection: return 3; 53 case CSSPropertyDirection: return 3;
59 case CSSPropertyDisplay: return 4; 54 case CSSPropertyDisplay: return 4;
60 case CSSPropertyFont: return 5; 55 case CSSPropertyFont: return 5;
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) 773 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents)
779 { 774 {
780 // FIXME: We may want to handle stylesheets that have multiple owners 775 // FIXME: We may want to handle stylesheets that have multiple owners
781 // https://crbug.com/242125 776 // https://crbug.com/242125
782 if (sheetContents && sheetContents->hasSingleOwnerNode()) 777 if (sheetContents && sheetContents->hasSingleOwnerNode())
783 return getFrom(sheetContents->singleOwnerDocument()); 778 return getFrom(sheetContents->singleOwnerDocument());
784 return 0; 779 return 0;
785 } 780 }
786 781
787 } // namespace blink 782 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698