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

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: Revert incorrect changes Created 4 years, 2 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 m_muteCount++; 83 m_muteCount++;
84 } 84 }
85 85
86 void Deprecation::unmuteForInspector() 86 void Deprecation::unmuteForInspector()
87 { 87 {
88 m_muteCount--; 88 m_muteCount--;
89 } 89 }
90 90
91 void Deprecation::suppress(CSSPropertyID unresolvedProperty) 91 void Deprecation::suppress(CSSPropertyID unresolvedProperty)
92 { 92 {
93 ASSERT(unresolvedProperty >= firstCSSProperty); 93 DCHECK(isPropertyIDWithName(unresolvedProperty));
94 ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
95 m_cssPropertyDeprecationBits.quickSet(unresolvedProperty); 94 m_cssPropertyDeprecationBits.quickSet(unresolvedProperty);
96 } 95 }
97 96
98 bool Deprecation::isSuppressed(CSSPropertyID unresolvedProperty) 97 bool Deprecation::isSuppressed(CSSPropertyID unresolvedProperty)
99 { 98 {
100 ASSERT(unresolvedProperty >= firstCSSProperty); 99 DCHECK(isPropertyIDWithName(unresolvedProperty));
101 ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty);
102 return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty); 100 return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty);
103 } 101 }
104 102
105 void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, CSSPropert yID unresolvedProperty) 103 void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, CSSPropert yID unresolvedProperty)
106 { 104 {
107 FrameHost* host = frame ? frame->host() : nullptr; 105 FrameHost* host = frame ? frame->host() : nullptr;
108 if (!host || host->deprecation().m_muteCount || host->deprecation().isSuppre ssed(unresolvedProperty)) 106 if (!host || host->deprecation().m_muteCount || host->deprecation().isSuppre ssed(unresolvedProperty))
109 return; 107 return;
110 108
111 String message = deprecationMessage(unresolvedProperty); 109 String message = deprecationMessage(unresolvedProperty);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 case UseCounter::PaymentAddressCareOf: 389 case UseCounter::PaymentAddressCareOf:
392 return willBeRemoved("PaymentAddress.careOf", M56, "5728579069411328"); 390 return willBeRemoved("PaymentAddress.careOf", M56, "5728579069411328");
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