OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/DOMWindow.h" | 5 #include "core/frame/DOMWindow.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "bindings/core/v8/WindowProxyManager.h" | 9 #include "bindings/core/v8/WindowProxyManager.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return nullptr; | 99 return nullptr; |
100 | 100 |
101 Frame* parent = GetFrame()->Tree().Parent(); | 101 Frame* parent = GetFrame()->Tree().Parent(); |
102 return parent ? parent->DomWindow() : GetFrame()->DomWindow(); | 102 return parent ? parent->DomWindow() : GetFrame()->DomWindow(); |
103 } | 103 } |
104 | 104 |
105 DOMWindow* DOMWindow::top() const { | 105 DOMWindow* DOMWindow::top() const { |
106 if (!GetFrame()) | 106 if (!GetFrame()) |
107 return nullptr; | 107 return nullptr; |
108 | 108 |
109 return GetFrame()->Tree().Top()->DomWindow(); | 109 return GetFrame()->Tree().Top().DomWindow(); |
110 } | 110 } |
111 | 111 |
112 DOMWindow* DOMWindow::AnonymousIndexedGetter(uint32_t index) const { | 112 DOMWindow* DOMWindow::AnonymousIndexedGetter(uint32_t index) const { |
113 if (!GetFrame()) | 113 if (!GetFrame()) |
114 return nullptr; | 114 return nullptr; |
115 | 115 |
116 Frame* child = GetFrame()->Tree().ScopedChild(index); | 116 Frame* child = GetFrame()->Tree().ScopedChild(index); |
117 return child ? child->DomWindow() : nullptr; | 117 return child ? child->DomWindow() : nullptr; |
118 } | 118 } |
119 | 119 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 ->GetSecurityOrigin() | 221 ->GetSecurityOrigin() |
222 ->ToString()); | 222 ->ToString()); |
223 if (MixedContentChecker::IsMixedContent(source_document->GetSecurityOrigin(), | 223 if (MixedContentChecker::IsMixedContent(source_document->GetSecurityOrigin(), |
224 target_url)) { | 224 target_url)) { |
225 UseCounter::Count(GetFrame(), UseCounter::kPostMessageFromSecureToInsecure); | 225 UseCounter::Count(GetFrame(), UseCounter::kPostMessageFromSecureToInsecure); |
226 } else if (MixedContentChecker::IsMixedContent( | 226 } else if (MixedContentChecker::IsMixedContent( |
227 GetFrame()->GetSecurityContext()->GetSecurityOrigin(), | 227 GetFrame()->GetSecurityContext()->GetSecurityOrigin(), |
228 source_document->Url())) { | 228 source_document->Url())) { |
229 UseCounter::Count(GetFrame(), UseCounter::kPostMessageFromInsecureToSecure); | 229 UseCounter::Count(GetFrame(), UseCounter::kPostMessageFromInsecureToSecure); |
230 if (MixedContentChecker::IsMixedContent( | 230 if (MixedContentChecker::IsMixedContent( |
231 GetFrame()->Tree().Top()->GetSecurityContext()->GetSecurityOrigin(), | 231 GetFrame()->Tree().Top().GetSecurityContext()->GetSecurityOrigin(), |
232 source_document->Url())) { | 232 source_document->Url())) { |
233 UseCounter::Count(GetFrame(), | 233 UseCounter::Count(GetFrame(), |
234 UseCounter::kPostMessageFromInsecureToSecureToplevel); | 234 UseCounter::kPostMessageFromInsecureToSecureToplevel); |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 MessageEvent* event = | 238 MessageEvent* event = |
239 MessageEvent::Create(std::move(channels), std::move(message), | 239 MessageEvent::Create(std::move(channels), std::move(message), |
240 source_origin, String(), source, source_suborigin); | 240 source_origin, String(), source, source_suborigin); |
241 | 241 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 visitor->Trace(location_); | 447 visitor->Trace(location_); |
448 EventTargetWithInlineData::Trace(visitor); | 448 EventTargetWithInlineData::Trace(visitor); |
449 } | 449 } |
450 | 450 |
451 DEFINE_TRACE_WRAPPERS(DOMWindow) { | 451 DEFINE_TRACE_WRAPPERS(DOMWindow) { |
452 visitor->TraceWrappers(location_); | 452 visitor->TraceWrappers(location_); |
453 EventTargetWithInlineData::TraceWrappers(visitor); | 453 EventTargetWithInlineData::TraceWrappers(visitor); |
454 } | 454 } |
455 | 455 |
456 } // namespace blink | 456 } // namespace blink |
OLD | NEW |