OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "bindings/core/v8/BindingSecurity.h" | 31 #include "bindings/core/v8/BindingSecurity.h" |
32 | 32 |
33 #include "bindings/core/v8/ExceptionState.h" | 33 #include "bindings/core/v8/ExceptionState.h" |
34 #include "bindings/core/v8/V8BindingForCore.h" | 34 #include "bindings/core/v8/V8BindingForCore.h" |
35 #include "bindings/core/v8/V8Location.h" | 35 #include "bindings/core/v8/V8Location.h" |
36 #include "bindings/core/v8/WrapperCreationSecurityCheck.h" | |
37 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
38 #include "core/frame/LocalDOMWindow.h" | 37 #include "core/frame/LocalDOMWindow.h" |
39 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
40 #include "core/frame/Location.h" | 39 #include "core/frame/Location.h" |
41 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
42 #include "core/html/HTMLFrameElementBase.h" | 41 #include "core/html/HTMLFrameElementBase.h" |
43 #include "core/workers/MainThreadWorkletGlobalScope.h" | 42 #include "core/workers/MainThreadWorkletGlobalScope.h" |
| 43 #include "platform/bindings/WrapperCreationSecurityCheck.h" |
44 #include "platform/weborigin/SecurityOrigin.h" | 44 #include "platform/weborigin/SecurityOrigin.h" |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 bool CanAccessFrameInternal(const LocalDOMWindow* accessing_window, | 50 bool CanAccessFrameInternal(const LocalDOMWindow* accessing_window, |
51 const SecurityOrigin* target_frame_origin, | 51 const SecurityOrigin* target_frame_origin, |
52 const DOMWindow* target_window) { | 52 const DOMWindow* target_window) { |
53 SECURITY_CHECK(!(target_window && target_window->GetFrame()) || | 53 SECURITY_CHECK(!(target_window && target_window->GetFrame()) || |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // arguments, so the generated exception can be more descriptive. | 338 // arguments, so the generated exception can be more descriptive. |
339 ExceptionState exception_state(isolate, ExceptionState::kUnknownContext, | 339 ExceptionState exception_state(isolate, ExceptionState::kUnknownContext, |
340 nullptr, nullptr); | 340 nullptr, nullptr); |
341 exception_state.ThrowSecurityError( | 341 exception_state.ThrowSecurityError( |
342 target_window->SanitizedCrossDomainAccessErrorMessage( | 342 target_window->SanitizedCrossDomainAccessErrorMessage( |
343 CurrentDOMWindow(isolate)), | 343 CurrentDOMWindow(isolate)), |
344 target_window->CrossDomainAccessErrorMessage(CurrentDOMWindow(isolate))); | 344 target_window->CrossDomainAccessErrorMessage(CurrentDOMWindow(isolate))); |
345 } | 345 } |
346 | 346 |
347 } // namespace blink | 347 } // namespace blink |
OLD | NEW |