| 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 | 83 |
| 84 void Deprecation::muteForInspector() { | 84 void Deprecation::muteForInspector() { |
| 85 m_muteCount++; | 85 m_muteCount++; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void Deprecation::unmuteForInspector() { | 88 void Deprecation::unmuteForInspector() { |
| 89 m_muteCount--; | 89 m_muteCount--; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void Deprecation::suppress(CSSPropertyID unresolvedProperty) { | 92 void Deprecation::suppress(CSSPropertyID unresolvedProperty) { |
| 93 ASSERT(unresolvedProperty >= firstCSSProperty); | 93 DCHECK(isCSSPropertyIDWithName(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 ASSERT(unresolvedProperty >= firstCSSProperty); | 98 DCHECK(isCSSPropertyIDWithName(unresolvedProperty)); |
| 100 ASSERT(unresolvedProperty <= lastUnresolvedCSSProperty); | |
| 101 return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty); | 99 return m_cssPropertyDeprecationBits.quickGet(unresolvedProperty); |
| 102 } | 100 } |
| 103 | 101 |
| 104 void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, | 102 void Deprecation::warnOnDeprecatedProperties(const LocalFrame* frame, |
| 105 CSSPropertyID unresolvedProperty) { | 103 CSSPropertyID unresolvedProperty) { |
| 106 FrameHost* host = frame ? frame->host() : nullptr; | 104 FrameHost* host = frame ? frame->host() : nullptr; |
| 107 if (!host || host->deprecation().m_muteCount || | 105 if (!host || host->deprecation().m_muteCount || |
| 108 host->deprecation().isSuppressed(unresolvedProperty)) | 106 host->deprecation().isSuppressed(unresolvedProperty)) |
| 109 return; | 107 return; |
| 110 | 108 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 case UseCounter::PaymentAddressCareOf: | 483 case UseCounter::PaymentAddressCareOf: |
| 486 return willBeRemoved("PaymentAddress.careOf", M56, "5728579069411328"); | 484 return willBeRemoved("PaymentAddress.careOf", M56, "5728579069411328"); |
| 487 | 485 |
| 488 // Features that aren't deprecated don't have a deprecation message. | 486 // Features that aren't deprecated don't have a deprecation message. |
| 489 default: | 487 default: |
| 490 return String(); | 488 return String(); |
| 491 } | 489 } |
| 492 } | 490 } |
| 493 | 491 |
| 494 } // namespace blink | 492 } // namespace blink |
| OLD | NEW |