| 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 731 |
| 732 void UseCounter::countCrossOriginIframe(const Document& document, Feature featur
e) | 732 void UseCounter::countCrossOriginIframe(const Document& document, Feature featur
e) |
| 733 { | 733 { |
| 734 LocalFrame* frame = document.frame(); | 734 LocalFrame* frame = document.frame(); |
| 735 if (frame && frame->isCrossOriginSubframe()) | 735 if (frame && frame->isCrossOriginSubframe()) |
| 736 count(frame, feature); | 736 count(frame, feature); |
| 737 } | 737 } |
| 738 | 738 |
| 739 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID property) | 739 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID property) |
| 740 { | 740 { |
| 741 DCHECK(property >= firstCSSProperty); | 741 DCHECK(isPropertyIDWithName(property)); |
| 742 DCHECK(property <= lastUnresolvedCSSProperty); | |
| 743 | 742 |
| 744 if (!isUseCounterEnabledForMode(cssParserMode) || m_muteCount) | 743 if (!isUseCounterEnabledForMode(cssParserMode) || m_muteCount) |
| 745 return; | 744 return; |
| 746 | 745 |
| 747 if (!m_CSSRecorded.quickGet(property)) { | 746 if (!m_CSSRecorded.quickGet(property)) { |
| 748 // Note that HTTPArchive tooling looks specifically for this event - see
https://github.com/HTTPArchive/httparchive/issues/59 | 747 // Note that HTTPArchive tooling looks specifically for this event - see
https://github.com/HTTPArchive/httparchive/issues/59 |
| 749 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), "CSSFeatu
reFirstUsed", "feature", property); | 748 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), "CSSFeatu
reFirstUsed", "feature", property); |
| 750 cssHistogram().count(mapCSSPropertyIdToCSSSampleIdForHistogram(property)
); | 749 cssHistogram().count(mapCSSPropertyIdToCSSSampleIdForHistogram(property)
); |
| 751 m_CSSRecorded.quickSet(property); | 750 m_CSSRecorded.quickSet(property); |
| 752 } | 751 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 } | 860 } |
| 862 } | 861 } |
| 863 | 862 |
| 864 if (needsPagesMeasuredUpdate) | 863 if (needsPagesMeasuredUpdate) |
| 865 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); | 864 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); |
| 866 | 865 |
| 867 m_CSSBits.clearAll(); | 866 m_CSSBits.clearAll(); |
| 868 } | 867 } |
| 869 | 868 |
| 870 } // namespace blink | 869 } // namespace blink |
| OLD | NEW |