OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google, Inc. All rights reserved. | 2 * Copyright (C) 2012 Google, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 UseCounter::countDeprecation(document.frame(), feature); | 723 UseCounter::countDeprecation(document.frame(), feature); |
724 } | 724 } |
725 | 725 |
726 void UseCounter::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execut
ionContext* context, Feature feature) | 726 void UseCounter::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execut
ionContext* context, Feature feature) |
727 { | 727 { |
728 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) | 728 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) |
729 return; | 729 return; |
730 UseCounter::countDeprecation(context, feature); | 730 UseCounter::countDeprecation(context, feature); |
731 } | 731 } |
732 | 732 |
| 733 // TODO (nainar): Migrate all console message functions to Deprecation |
733 static const char* milestoneString(int milestone) | 734 static const char* milestoneString(int milestone) |
734 { | 735 { |
735 switch (milestone) { | 736 switch (milestone) { |
736 case 50: | 737 case 50: |
737 return "M50, around April 2016"; | 738 return "M50, around April 2016"; |
| 739 case 51: |
| 740 return "M51, around June 2016"; |
738 case 53: | 741 case 53: |
739 return "M53, around September 2016"; | 742 return "M53, around September 2016"; |
740 } | 743 } |
741 | 744 |
742 ASSERT_NOT_REACHED(); | 745 ASSERT_NOT_REACHED(); |
743 return nullptr; | 746 return nullptr; |
744 } | 747 } |
745 | 748 |
746 static String replacedBy(const char* feature, const char* replacement) | 749 static String replacedBy(const char* feature, const char* replacement) |
747 { | 750 { |
748 return String::format("%s is deprecated. Please use %s instead.", feature, r
eplacement); | 751 return String::format("%s is deprecated. Please use %s instead.", feature, r
eplacement); |
749 } | 752 } |
750 | 753 |
751 static String willBeRemoved(const char* feature, int milestone, const char* deta
ils) | 754 String UseCounter::willBeRemoved(const char* feature, int milestone, const char*
details) |
752 { | 755 { |
753 return String::format("%s is deprecated and will be removed in %s. See https
://www.chromestatus.com/features/%s for more details.", feature, milestoneString
(milestone), details); | 756 return String::format("%s is deprecated and will be removed in %s. See https
://www.chromestatus.com/features/%s for more details.", feature, milestoneString
(milestone), details); |
754 } | 757 } |
755 | 758 |
756 static String replacedWillBeRemoved(const char* feature, const char* replacement
, int milestone, const char* details) | 759 static String replacedWillBeRemoved(const char* feature, const char* replacement
, int milestone, const char* details) |
757 { | 760 { |
758 return String::format("%s is deprecated and will be removed in %s. Please us
e %s instead. See https://www.chromestatus.com/features/%s for more details.", f
eature, milestoneString(milestone), replacement, details); | 761 return String::format("%s is deprecated and will be removed in %s. Please us
e %s instead. See https://www.chromestatus.com/features/%s for more details.", f
eature, milestoneString(milestone), replacement, details); |
759 } | 762 } |
760 | 763 |
761 String UseCounter::deprecationMessage(Feature feature) | 764 String UseCounter::deprecationMessage(Feature feature) |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) | 1018 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
1016 { | 1019 { |
1017 // FIXME: We may want to handle stylesheets that have multiple owners | 1020 // FIXME: We may want to handle stylesheets that have multiple owners |
1018 // https://crbug.com/242125 | 1021 // https://crbug.com/242125 |
1019 if (sheetContents && sheetContents->hasSingleOwnerNode()) | 1022 if (sheetContents && sheetContents->hasSingleOwnerNode()) |
1020 return getFrom(sheetContents->singleOwnerDocument()); | 1023 return getFrom(sheetContents->singleOwnerDocument()); |
1021 return 0; | 1024 return 0; |
1022 } | 1025 } |
1023 | 1026 |
1024 } // namespace blink | 1027 } // namespace blink |
OLD | NEW |