| 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 #ifndef Deprecation_h | 5 #ifndef Deprecation_h |
| 6 #define Deprecation_h | 6 #define Deprecation_h |
| 7 | 7 |
| 8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 10 #include "core/frame/UseCounter.h" | 10 #include "core/frame/UseCounter.h" |
| 11 #include "platform/wtf/BitVector.h" | 11 #include "platform/wtf/BitVector.h" |
| 12 #include "platform/wtf/Noncopyable.h" | 12 #include "platform/wtf/Noncopyable.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class LocalFrame; | 16 class LocalFrame; |
| 17 enum class WebFeaturePolicyFeature; |
| 17 | 18 |
| 18 class CORE_EXPORT Deprecation { | 19 class CORE_EXPORT Deprecation { |
| 19 DISALLOW_NEW(); | 20 DISALLOW_NEW(); |
| 20 WTF_MAKE_NONCOPYABLE(Deprecation); | 21 WTF_MAKE_NONCOPYABLE(Deprecation); |
| 21 | 22 |
| 22 public: | 23 public: |
| 23 Deprecation(); | 24 Deprecation(); |
| 24 ~Deprecation(); | 25 ~Deprecation(); |
| 25 | 26 |
| 26 static void WarnOnDeprecatedProperties(const LocalFrame*, | 27 static void WarnOnDeprecatedProperties(const LocalFrame*, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 40 // For shared workers and service workers, the ExecutionContext* overload | 41 // For shared workers and service workers, the ExecutionContext* overload |
| 41 // doesn't count the usage but only sends a console warning. | 42 // doesn't count the usage but only sends a console warning. |
| 42 static void CountDeprecation(const LocalFrame*, WebFeature); | 43 static void CountDeprecation(const LocalFrame*, WebFeature); |
| 43 static void CountDeprecation(ExecutionContext*, WebFeature); | 44 static void CountDeprecation(ExecutionContext*, WebFeature); |
| 44 static void CountDeprecation(const Document&, WebFeature); | 45 static void CountDeprecation(const Document&, WebFeature); |
| 45 | 46 |
| 46 // Count only features if they're being used in an iframe which does not | 47 // Count only features if they're being used in an iframe which does not |
| 47 // have script access into the top level document. | 48 // have script access into the top level document. |
| 48 static void CountDeprecationCrossOriginIframe(const LocalFrame*, WebFeature); | 49 static void CountDeprecationCrossOriginIframe(const LocalFrame*, WebFeature); |
| 49 static void CountDeprecationCrossOriginIframe(const Document&, WebFeature); | 50 static void CountDeprecationCrossOriginIframe(const Document&, WebFeature); |
| 51 |
| 52 static void CountDeprecationFeaturePolicy(const Document&, |
| 53 WebFeaturePolicyFeature); |
| 50 static String DeprecationMessage(WebFeature); | 54 static String DeprecationMessage(WebFeature); |
| 51 | 55 |
| 52 // Note: this is only public for tests. | 56 // Note: this is only public for tests. |
| 53 bool IsSuppressed(CSSPropertyID unresolved_property); | 57 bool IsSuppressed(CSSPropertyID unresolved_property); |
| 54 | 58 |
| 55 protected: | 59 protected: |
| 56 void Suppress(CSSPropertyID unresolved_property); | 60 void Suppress(CSSPropertyID unresolved_property); |
| 57 // CSSPropertyIDs that aren't deprecated return an empty string. | 61 // CSSPropertyIDs that aren't deprecated return an empty string. |
| 58 static String DeprecationMessage(CSSPropertyID unresolved_property); | 62 static String DeprecationMessage(CSSPropertyID unresolved_property); |
| 59 | 63 |
| 60 BitVector css_property_deprecation_bits_; | 64 BitVector css_property_deprecation_bits_; |
| 61 unsigned mute_count_; | 65 unsigned mute_count_; |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 } // namespace blink | 68 } // namespace blink |
| 65 | 69 |
| 66 #endif // Deprecation_h | 70 #endif // Deprecation_h |
| OLD | NEW |