OLD | NEW |
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 Loading... |
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 360 |
356 case UseCounter::PresentationConnectionStateChangeEventListener: | 361 case UseCounter::PresentationConnectionStateChangeEventListener: |
357 return replacedWillBeRemoved("'PresentationConnection.onstateachange'",
"'PresentationConnection.on{connect,close,terminate}'", 51, "5662456714100736"); | 362 return replacedWillBeRemoved("'PresentationConnection.onstateachange'",
"'PresentationConnection.on{connect,close,terminate}'", 51, "5662456714100736"); |
358 | 363 |
359 case UseCounter::HTMLKeygenElement: | 364 case UseCounter::HTMLKeygenElement: |
360 return willBeRemoved("The <keygen> element", 54, "5716060992962560"); | 365 return willBeRemoved("The <keygen> element", 54, "5716060992962560"); |
361 | 366 |
362 case UseCounter::ResultsAttribute: | 367 case UseCounter::ResultsAttribute: |
363 return willBeRemoved("'results' attribute", 53, "5738199536107520"); | 368 return willBeRemoved("'results' attribute", 53, "5738199536107520"); |
364 | 369 |
| 370 case UseCounter::TouchDragUserGestureUsedCrossOrigin: |
| 371 return willBeRemoved("Performing sensitive operations in iframes on touc
h events which don't represent a tap gesture", 52, "https://www.chromestatus.com
/features/5649871251963904"); |
| 372 |
365 // Features that aren't deprecated don't have a deprecation message. | 373 // Features that aren't deprecated don't have a deprecation message. |
366 default: | 374 default: |
367 return String(); | 375 return String(); |
368 } | 376 } |
369 } | 377 } |
370 | 378 |
371 } // namespace blink | 379 } // namespace blink |
OLD | NEW |