Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Side by Side Diff: third_party/WebKit/Source/core/frame/UseCounter.cpp

Issue 1578263006: Add metrics for usage of permission features from iframes in blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 void UseCounter::countCrossOriginIframe(const Document& document, Feature featur e)
734 {
735 Frame* frame = document.frame();
736 if (!frame)
737 return;
738 SecurityOrigin* securityOrigin = frame->securityContext()->securityOrigin();
739 Frame* parent = frame->tree().parent();
740 if (parent && !securityOrigin->canAccess(parent->securityContext()->security Origin()))
mlamouri (slow - plz ping) 2016/01/19 17:54:48 canAccess() is not exactly "cross origin". Maybe t
raymes 2016/01/20 00:13:12 Done. Actually you made me realise that this code
741 count(frame, feature);
742 }
743
733 static const char* milestoneString(int milestone) 744 static const char* milestoneString(int milestone)
734 { 745 {
735 switch (milestone) { 746 switch (milestone) {
736 case 50: 747 case 50:
737 return "M50, around April 2016"; 748 return "M50, around April 2016";
738 case 53: 749 case 53:
739 return "M53, around September 2016"; 750 return "M53, around September 2016";
740 } 751 }
741 752
742 ASSERT_NOT_REACHED(); 753 ASSERT_NOT_REACHED();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) 1022 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents)
1012 { 1023 {
1013 // FIXME: We may want to handle stylesheets that have multiple owners 1024 // FIXME: We may want to handle stylesheets that have multiple owners
1014 // https://crbug.com/242125 1025 // https://crbug.com/242125
1015 if (sheetContents && sheetContents->hasSingleOwnerNode()) 1026 if (sheetContents && sheetContents->hasSingleOwnerNode())
1016 return getFrom(sheetContents->singleOwnerDocument()); 1027 return getFrom(sheetContents->singleOwnerDocument());
1017 return 0; 1028 return 0;
1018 } 1029 }
1019 1030
1020 } // namespace blink 1031 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698