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

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, 10 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 // Check to see if the frame can script into the top level document.
739 SecurityOrigin* securityOrigin = frame->securityContext()->securityOrigin();
740 Frame* top = frame->tree().top();
741 if (top && !securityOrigin->canAccess(top->securityContext()->securityOrigin ()))
742 count(frame, feature);
743 }
744
733 static const char* milestoneString(int milestone) 745 static const char* milestoneString(int milestone)
734 { 746 {
735 switch (milestone) { 747 switch (milestone) {
736 case 50: 748 case 50:
737 return "M50, around April 2016"; 749 return "M50, around April 2016";
738 case 53: 750 case 53:
739 return "M53, around September 2016"; 751 return "M53, around September 2016";
740 } 752 }
741 753
742 ASSERT_NOT_REACHED(); 754 ASSERT_NOT_REACHED();
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) 1024 UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents)
1013 { 1025 {
1014 // FIXME: We may want to handle stylesheets that have multiple owners 1026 // FIXME: We may want to handle stylesheets that have multiple owners
1015 // https://crbug.com/242125 1027 // https://crbug.com/242125
1016 if (sheetContents && sheetContents->hasSingleOwnerNode()) 1028 if (sheetContents && sheetContents->hasSingleOwnerNode())
1017 return getFrom(sheetContents->singleOwnerDocument()); 1029 return getFrom(sheetContents->singleOwnerDocument());
1018 return 0; 1030 return 0;
1019 } 1031 }
1020 1032
1021 } // namespace blink 1033 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/page/PointerLockController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698