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

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

Issue 2228313002: Make a function to query whether a CSSPropertyID is valid and whether it has a name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@asan
Patch Set: Adjust animation dchecks 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 738
739 void UseCounter::countCrossOriginIframe(const Document& document, Feature featur e) 739 void UseCounter::countCrossOriginIframe(const Document& document, Feature featur e)
740 { 740 {
741 Frame* frame = document.frame(); 741 Frame* frame = document.frame();
742 if (frame && frame->isCrossOrigin()) 742 if (frame && frame->isCrossOrigin())
743 count(frame, feature); 743 count(frame, feature);
744 } 744 }
745 745
746 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID feature) 746 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID feature)
747 { 747 {
748 ASSERT(feature >= firstCSSProperty); 748 DCHECK(propertyHasName(feature));
749 ASSERT(feature <= lastUnresolvedCSSProperty);
750 749
751 if (!isUseCounterEnabledForMode(cssParserMode) || m_muteCount) 750 if (!isUseCounterEnabledForMode(cssParserMode) || m_muteCount)
752 return; 751 return;
753 752
754 m_CSSFeatureBits.quickSet(feature); 753 m_CSSFeatureBits.quickSet(feature);
755 } 754 }
756 755
757 void UseCounter::count(Feature feature) 756 void UseCounter::count(Feature feature)
758 { 757 {
759 ASSERT(Deprecation::deprecationMessage(feature).isEmpty()); 758 ASSERT(Deprecation::deprecationMessage(feature).isEmpty());
(...skipping 17 matching lines...) Expand all
777 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) 776 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents)
778 { 777 {
779 // FIXME: We may want to handle stylesheets that have multiple owners 778 // FIXME: We may want to handle stylesheets that have multiple owners
780 // https://crbug.com/242125 779 // https://crbug.com/242125
781 if (sheetContents && sheetContents->hasSingleOwnerNode()) 780 if (sheetContents && sheetContents->hasSingleOwnerNode())
782 return getFrom(sheetContents->singleOwnerDocument()); 781 return getFrom(sheetContents->singleOwnerDocument());
783 return 0; 782 return 0;
784 } 783 }
785 784
786 } // namespace blink 785 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698