| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 if (context->isWorkerOrWorkletGlobalScope()) | 163 if (context->isWorkerOrWorkletGlobalScope()) |
| 164 toWorkerOrWorkletGlobalScope(context)->countDeprecation(feature); | 164 toWorkerOrWorkletGlobalScope(context)->countDeprecation(feature); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void Deprecation::countDeprecation(const Document& document, | 167 void Deprecation::countDeprecation(const Document& document, |
| 168 UseCounter::Feature feature) { | 168 UseCounter::Feature feature) { |
| 169 Deprecation::countDeprecation(document.frame(), feature); | 169 Deprecation::countDeprecation(document.frame(), feature); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void Deprecation::countDeprecationIfNotPrivateScript( | |
| 173 v8::Isolate* isolate, | |
| 174 ExecutionContext* context, | |
| 175 UseCounter::Feature feature) { | |
| 176 if (DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld()) | |
| 177 return; | |
| 178 Deprecation::countDeprecation(context, feature); | |
| 179 } | |
| 180 | |
| 181 void Deprecation::countDeprecationCrossOriginIframe( | 172 void Deprecation::countDeprecationCrossOriginIframe( |
| 182 const LocalFrame* frame, | 173 const LocalFrame* frame, |
| 183 UseCounter::Feature feature) { | 174 UseCounter::Feature feature) { |
| 184 // Check to see if the frame can script into the top level document. | 175 // Check to see if the frame can script into the top level document. |
| 185 SecurityOrigin* securityOrigin = | 176 SecurityOrigin* securityOrigin = |
| 186 frame->securityContext()->getSecurityOrigin(); | 177 frame->securityContext()->getSecurityOrigin(); |
| 187 Frame* top = frame->tree().top(); | 178 Frame* top = frame->tree().top(); |
| 188 if (top && | 179 if (top && |
| 189 !securityOrigin->canAccess(top->securityContext()->getSecurityOrigin())) | 180 !securityOrigin->canAccess(top->securityContext()->getSecurityOrigin())) |
| 190 countDeprecation(frame, feature); | 181 countDeprecation(frame, feature); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 "redirected response. This will result in an error in %s.", | 411 "redirected response. This will result in an error in %s.", |
| 421 milestoneString(M59)); | 412 milestoneString(M59)); |
| 422 | 413 |
| 423 // Features that aren't deprecated don't have a deprecation message. | 414 // Features that aren't deprecated don't have a deprecation message. |
| 424 default: | 415 default: |
| 425 return String(); | 416 return String(); |
| 426 } | 417 } |
| 427 } | 418 } |
| 428 | 419 |
| 429 } // namespace blink | 420 } // namespace blink |
| OLD | NEW |