| 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 return; | 734 return; |
| 735 UseCounter::count(context, feature); | 735 UseCounter::count(context, feature); |
| 736 } | 736 } |
| 737 | 737 |
| 738 void UseCounter::countCrossOriginIframe(const Document& document, Feature featur
e) | 738 void UseCounter::countCrossOriginIframe(const Document& document, Feature featur
e) |
| 739 { | 739 { |
| 740 Frame* frame = document.frame(); | 740 Frame* frame = document.frame(); |
| 741 if (!frame) | 741 if (!frame) |
| 742 return; | 742 return; |
| 743 // Check to see if the frame can script into the top level document. | 743 // Check to see if the frame can script into the top level document. |
| 744 SecurityOrigin* securityOrigin = frame->securityContext()->securityOrigin(); | 744 SecurityOrigin* securityOrigin = frame->securityContext()->getSecurityOrigin
(); |
| 745 Frame* top = frame->tree().top(); | 745 Frame* top = frame->tree().top(); |
| 746 if (top && !securityOrigin->canAccess(top->securityContext()->securityOrigin
())) | 746 if (top && !securityOrigin->canAccess(top->securityContext()->getSecurityOri
gin())) |
| 747 count(frame, feature); | 747 count(frame, feature); |
| 748 } | 748 } |
| 749 | 749 |
| 750 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID feature) | 750 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID feature) |
| 751 { | 751 { |
| 752 ASSERT(feature >= firstCSSProperty); | 752 ASSERT(feature >= firstCSSProperty); |
| 753 ASSERT(feature <= lastUnresolvedCSSProperty); | 753 ASSERT(feature <= lastUnresolvedCSSProperty); |
| 754 | 754 |
| 755 if (!isUseCounterEnabledForMode(cssParserMode)) | 755 if (!isUseCounterEnabledForMode(cssParserMode)) |
| 756 return; | 756 return; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 781 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) | 781 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
| 782 { | 782 { |
| 783 // FIXME: We may want to handle stylesheets that have multiple owners | 783 // FIXME: We may want to handle stylesheets that have multiple owners |
| 784 // https://crbug.com/242125 | 784 // https://crbug.com/242125 |
| 785 if (sheetContents && sheetContents->hasSingleOwnerNode()) | 785 if (sheetContents && sheetContents->hasSingleOwnerNode()) |
| 786 return getFrom(sheetContents->singleOwnerDocument()); | 786 return getFrom(sheetContents->singleOwnerDocument()); |
| 787 return 0; | 787 return 0; |
| 788 } | 788 } |
| 789 | 789 |
| 790 } // namespace blink | 790 } // namespace blink |
| OLD | NEW |