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

Side by Side Diff: third_party/WebKit/Source/core/frame/Deprecation.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/Deprecation.h" 5 #include "core/frame/Deprecation.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/frame/FrameConsole.h" 9 #include "core/frame/FrameConsole.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 m_muteCount++; 84 m_muteCount++;
85 } 85 }
86 86
87 void Deprecation::unmuteForInspector() 87 void Deprecation::unmuteForInspector()
88 { 88 {
89 m_muteCount--; 89 m_muteCount--;
90 } 90 }
91 91
92 void Deprecation::suppress(CSSPropertyID unresolvedProperty) 92 void Deprecation::suppress(CSSPropertyID unresolvedProperty)
93 { 93 {
94 ASSERT(unresolvedProperty >= firstCSSProperty); 94 DCHECK(propertyHasName(unresolvedProperty));
95 ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
96 m_cssPropertyDeprecationBits.quickSet(unresolvedProperty); 95 m_cssPropertyDeprecationBits.quickSet(unresolvedProperty);
97 } 96 }
98 97
99 bool Deprecation::isSuppressed(CSSPropertyID unresolvedProperty) 98 bool Deprecation::isSuppressed(CSSPropertyID unresolvedProperty)
100 { 99 {
101 ASSERT(unresolvedProperty >= firstCSSProperty); 100 DCHECK(propertyHasName(unresolvedProperty));
102 ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
103 return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty); 101 return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty);
104 } 102 }
105 103
106 void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, CSSPropert yID unresolvedProperty) 104 void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, CSSPropert yID unresolvedProperty)
107 { 105 {
108 FrameHost* host = frame ? frame->host() : nullptr; 106 FrameHost* host = frame ? frame->host() : nullptr;
109 if (!host || host->deprecation().m_muteCount || host->deprecation().isSuppre ssed(unresolvedProperty)) 107 if (!host || host->deprecation().m_muteCount || host->deprecation().isSuppre ssed(unresolvedProperty))
110 return; 108 return;
111 109
112 String message = deprecationMessage(unresolvedProperty); 110 String message = deprecationMessage(unresolvedProperty);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 case UseCounter::V8SVGSVGElement_CurrentView_AttributeGetter: 389 case UseCounter::V8SVGSVGElement_CurrentView_AttributeGetter:
392 return willBeRemoved("SVGSVGElement.currentView", 56, "4511711998509056" ); 390 return willBeRemoved("SVGSVGElement.currentView", 56, "4511711998509056" );
393 391
394 // Features that aren't deprecated don't have a deprecation message. 392 // Features that aren't deprecated don't have a deprecation message.
395 default: 393 default:
396 return String(); 394 return String();
397 } 395 }
398 } 396 }
399 397
400 } // namespace blink 398 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698