Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/UseCounter.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/UseCounter.cpp b/third_party/WebKit/Source/core/frame/UseCounter.cpp |
| index 8e65609f65e41de83e72a10607d5b498947a6ca7..0e5c65fc8416a964fd0cf1e86ffe14e2d8b5e230 100644 |
| --- a/third_party/WebKit/Source/core/frame/UseCounter.cpp |
| +++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp |
| @@ -706,6 +706,18 @@ void UseCounter::countDeprecation(const LocalFrame* frame, Feature feature) |
| } |
| } |
| +void UseCounter::countDeprecation(LocalFrame* frame, CSSPropertyID cssPropertyID) |
|
alancutter (OOO until 2018)
2016/01/18 04:00:44
const LocalFrame*.
nainar
2016/01/18 06:09:55
Done.
|
| +{ |
| + if (!frame) |
| + return; |
| + FrameHost* host = frame->host(); |
|
alancutter (OOO until 2018)
2016/01/18 04:00:44
No need for local variable.
nainar
2016/01/18 06:09:55
Done.
|
| + if (!host) |
|
alancutter (OOO until 2018)
2016/01/18 04:00:44
You can merge these two ifs together.
nainar
2016/01/18 06:09:55
Done.
|
| + return; |
| + |
| + if (!deprecationMessage(cssPropertyID).isEmpty()) |
|
alancutter (OOO until 2018)
2016/01/18 04:00:44
Avoid calling deprecationMessage() twice.
nainar
2016/01/18 06:09:55
Done.
|
| + frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, deprecationMessage(cssPropertyID))); |
| +} |
| + |
| void UseCounter::countDeprecation(ExecutionContext* context, Feature feature) |
| { |
| if (!context) |
| @@ -735,6 +747,8 @@ static const char* milestoneString(int milestone) |
| switch (milestone) { |
| case 50: |
| return "M50, around April 2016"; |
| + case 51: |
| + return "M51, around June 2016"; |
| case 53: |
| return "M53, around September 2016"; |
| } |
| @@ -758,6 +772,17 @@ static String replacedWillBeRemoved(const char* feature, const char* replacement |
| return String::format("%s is deprecated and will be removed in %s. Please use %s instead. See https://www.chromestatus.com/features/%s for more details.", feature, milestoneString(milestone), replacement, details); |
| } |
| +String UseCounter::deprecationMessage(CSSPropertyID cssPropertyID) |
| +{ |
| + switch (cssPropertyID) { |
| + case CSSPropertyWebkitBackgroundComposite: |
| + return willBeRemoved("'-webkit-background-composite'", 51, "6607299456008192"); |
| + // CSSPropertyIDs that aren't deprecated don't have a deprecation message. |
|
alancutter (OOO until 2018)
2016/01/18 04:00:44
Instead of this comment have a comment in the head
nainar
2016/01/18 06:09:55
Done.
|
| + default: |
| + return String(); |
|
alancutter (OOO until 2018)
2016/01/18 04:00:44
Use emptyString().
nainar
2016/01/18 06:09:54
Done.
|
| + } |
| +} |
| + |
| String UseCounter::deprecationMessage(Feature feature) |
| { |
| switch (feature) { |