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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 Frame* frame = document.frame(); | 735 Frame* frame = document.frame(); |
736 if (!frame) | 736 if (!frame) |
737 return; | 737 return; |
738 // Check to see if the frame can script into the top level document. | 738 // Check to see if the frame can script into the top level document. |
739 SecurityOrigin* securityOrigin = frame->securityContext()->securityOrigin(); | 739 SecurityOrigin* securityOrigin = frame->securityContext()->securityOrigin(); |
740 Frame* top = frame->tree().top(); | 740 Frame* top = frame->tree().top(); |
741 if (top && !securityOrigin->canAccess(top->securityContext()->securityOrigin
())) | 741 if (top && !securityOrigin->canAccess(top->securityContext()->securityOrigin
())) |
742 count(frame, feature); | 742 count(frame, feature); |
743 } | 743 } |
744 | 744 |
745 // TODO (nainar): Migrate all console message functions to Deprecation | |
746 static const char* milestoneString(int milestone) | 745 static const char* milestoneString(int milestone) |
747 { | 746 { |
748 switch (milestone) { | 747 switch (milestone) { |
749 case 50: | 748 case 50: |
750 return "M50, around April 2016"; | 749 return "M50, around April 2016"; |
751 case 51: | |
752 return "M51, around June 2016"; | |
753 case 53: | 750 case 53: |
754 return "M53, around September 2016"; | 751 return "M53, around September 2016"; |
755 } | 752 } |
756 | 753 |
757 ASSERT_NOT_REACHED(); | 754 ASSERT_NOT_REACHED(); |
758 return nullptr; | 755 return nullptr; |
759 } | 756 } |
760 | 757 |
761 static String replacedBy(const char* feature, const char* replacement) | 758 static String replacedBy(const char* feature, const char* replacement) |
762 { | 759 { |
763 return String::format("%s is deprecated. Please use %s instead.", feature, r
eplacement); | 760 return String::format("%s is deprecated. Please use %s instead.", feature, r
eplacement); |
764 } | 761 } |
765 | 762 |
766 String UseCounter::willBeRemoved(const char* feature, int milestone, const char*
details) | 763 static String willBeRemoved(const char* feature, int milestone, const char* deta
ils) |
767 { | 764 { |
768 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); | 765 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); |
769 } | 766 } |
770 | 767 |
771 static String replacedWillBeRemoved(const char* feature, const char* replacement
, int milestone, const char* details) | 768 static String replacedWillBeRemoved(const char* feature, const char* replacement
, int milestone, const char* details) |
772 { | 769 { |
773 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); | 770 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); |
774 } | 771 } |
775 | 772 |
776 String UseCounter::deprecationMessage(Feature feature) | 773 String UseCounter::deprecationMessage(Feature feature) |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) | 1024 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
1028 { | 1025 { |
1029 // FIXME: We may want to handle stylesheets that have multiple owners | 1026 // FIXME: We may want to handle stylesheets that have multiple owners |
1030 // https://crbug.com/242125 | 1027 // https://crbug.com/242125 |
1031 if (sheetContents && sheetContents->hasSingleOwnerNode()) | 1028 if (sheetContents && sheetContents->hasSingleOwnerNode()) |
1032 return getFrom(sheetContents->singleOwnerDocument()); | 1029 return getFrom(sheetContents->singleOwnerDocument()); |
1033 return 0; | 1030 return 0; |
1034 } | 1031 } |
1035 | 1032 |
1036 } // namespace blink | 1033 } // namespace blink |
OLD | NEW |