| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |