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

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

Issue 1799253002: Stricter user gestures for touch - measure and warn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/Deprecation.h" 5 #include "core/frame/Deprecation.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/frame/FrameConsole.h" 9 #include "core/frame/FrameConsole.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 Deprecation::countDeprecation(document.frame(), feature); 141 Deprecation::countDeprecation(document.frame(), feature);
142 } 142 }
143 143
144 void Deprecation::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execu tionContext* context, UseCounter::Feature feature) 144 void Deprecation::countDeprecationIfNotPrivateScript(v8::Isolate* isolate, Execu tionContext* context, UseCounter::Feature feature)
145 { 145 {
146 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) 146 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld())
147 return; 147 return;
148 Deprecation::countDeprecation(context, feature); 148 Deprecation::countDeprecation(context, feature);
149 } 149 }
150 150
151 void Deprecation::countDeprecationCrossOriginIframe(const Document& document, Us eCounter::Feature feature) 151 void Deprecation::countDeprecationCrossOriginIframe(const LocalFrame* frame, Use Counter::Feature feature)
152 { 152 {
153 LocalFrame* frame = document.frame();
154 if (!frame)
155 return;
156 // Check to see if the frame can script into the top level document. 153 // Check to see if the frame can script into the top level document.
157 SecurityOrigin* securityOrigin = frame->securityContext()->getSecurityOrigin (); 154 SecurityOrigin* securityOrigin = frame->securityContext()->getSecurityOrigin ();
158 Frame* top = frame->tree().top(); 155 Frame* top = frame->tree().top();
159 if (top && !securityOrigin->canAccess(top->securityContext()->getSecurityOri gin())) 156 if (top && !securityOrigin->canAccess(top->securityContext()->getSecurityOri gin()))
160 countDeprecation(frame, feature); 157 countDeprecation(frame, feature);
161 } 158 }
162 159
160 void Deprecation::countDeprecationCrossOriginIframe(const Document& document, Us eCounter::Feature feature)
161 {
162 LocalFrame* frame = document.frame();
163 if (!frame)
164 return;
165 countDeprecationCrossOriginIframe(frame, feature);
166 }
167
163 String Deprecation::deprecationMessage(UseCounter::Feature feature) 168 String Deprecation::deprecationMessage(UseCounter::Feature feature)
164 { 169 {
165 switch (feature) { 170 switch (feature) {
166 // Quota 171 // Quota
167 case UseCounter::PrefixedStorageInfo: 172 case UseCounter::PrefixedStorageInfo:
168 return replacedBy("'window.webkitStorageInfo'", "'navigator.webkitTempor aryStorage' or 'navigator.webkitPersistentStorage'"); 173 return replacedBy("'window.webkitStorageInfo'", "'navigator.webkitTempor aryStorage' or 'navigator.webkitPersistentStorage'");
169 174
170 case UseCounter::ConsoleMarkTimeline: 175 case UseCounter::ConsoleMarkTimeline:
171 return replacedBy("'console.markTimeline'", "'console.timeStamp'"); 176 return replacedBy("'console.markTimeline'", "'console.timeStamp'");
172 177
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 366
362 case UseCounter::PresentationConnectionStateChangeEventListener: 367 case UseCounter::PresentationConnectionStateChangeEventListener:
363 return replacedWillBeRemoved("'PresentationConnection.onstateachange'", "'PresentationConnection.on{connect,close,terminate}'", 51, "5662456714100736"); 368 return replacedWillBeRemoved("'PresentationConnection.onstateachange'", "'PresentationConnection.on{connect,close,terminate}'", 51, "5662456714100736");
364 369
365 case UseCounter::HTMLKeygenElement: 370 case UseCounter::HTMLKeygenElement:
366 return willBeRemoved("The <keygen> element", 54, "5716060992962560"); 371 return willBeRemoved("The <keygen> element", 54, "5716060992962560");
367 372
368 case UseCounter::ResultsAttribute: 373 case UseCounter::ResultsAttribute:
369 return willBeRemoved("'results' attribute", 53, "5738199536107520"); 374 return willBeRemoved("'results' attribute", 53, "5738199536107520");
370 375
376 case UseCounter::TouchDragUserGestureUsedCrossOrigin:
377 return willBeRemoved("Performing sensitive operations in iframes on touc h events which don't represent a tap gesture", 52, "XXX-TODO");
378
371 // Features that aren't deprecated don't have a deprecation message. 379 // Features that aren't deprecated don't have a deprecation message.
372 default: 380 default:
373 return String(); 381 return String();
374 } 382 }
375 } 383 }
376 384
377 } // namespace blink 385 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698