OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 #include "core/page/CreateWindow.h" | 72 #include "core/page/CreateWindow.h" |
73 #include "core/page/Page.h" | 73 #include "core/page/Page.h" |
74 #include "core/page/WindowFeatures.h" | 74 #include "core/page/WindowFeatures.h" |
75 #include "core/page/scrolling/ScrollingCoordinator.h" | 75 #include "core/page/scrolling/ScrollingCoordinator.h" |
76 #include "platform/EventDispatchForbiddenScope.h" | 76 #include "platform/EventDispatchForbiddenScope.h" |
77 #include "platform/weborigin/SecurityOrigin.h" | 77 #include "platform/weborigin/SecurityOrigin.h" |
78 #include "platform/weborigin/Suborigin.h" | 78 #include "platform/weborigin/Suborigin.h" |
79 #include "public/platform/Platform.h" | 79 #include "public/platform/Platform.h" |
80 #include "public/platform/WebFrameScheduler.h" | 80 #include "public/platform/WebFrameScheduler.h" |
81 #include "public/platform/WebScreenInfo.h" | 81 #include "public/platform/WebScreenInfo.h" |
82 #include "wtf/debug/CrashLogging.h" | 82 #include "wtf/debug/CrashLogging.h" |
Robert Sesek
2016/07/08 15:01:02
Same.
Yuki
2016/07/11 04:00:43
Done.
| |
83 #include <memory> | 83 #include <memory> |
84 | 84 |
85 namespace blink { | 85 namespace blink { |
86 | 86 |
87 // Rather than simply inheriting LocalFrameLifecycleObserver like most other | 87 // Rather than simply inheriting LocalFrameLifecycleObserver like most other |
88 // classes, LocalDOMWindow hides its LocalFrameLifecycleObserver with | 88 // classes, LocalDOMWindow hides its LocalFrameLifecycleObserver with |
89 // composition. This prevents conflicting overloads between DOMWindow, which | 89 // composition. This prevents conflicting overloads between DOMWindow, which |
90 // has a frame() accessor that returns Frame* for bindings code, and | 90 // has a frame() accessor that returns Frame* for bindings code, and |
91 // LocalFrameLifecycleObserver, which has a frame() accessor that returns a | 91 // LocalFrameLifecycleObserver, which has a frame() accessor that returns a |
92 // LocalFrame*. | 92 // LocalFrame*. |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
681 { | 681 { |
682 if (!isCurrentlyDisplayedInFrame()) | 682 if (!isCurrentlyDisplayedInFrame()) |
683 return; | 683 return; |
684 | 684 |
685 MessageEvent* event = timer->event(); | 685 MessageEvent* event = timer->event(); |
686 | 686 |
687 UserGestureIndicator gestureIndicator(timer->userGestureToken()); | 687 UserGestureIndicator gestureIndicator(timer->userGestureToken()); |
688 | 688 |
689 event->entangleMessagePorts(document()); | 689 event->entangleMessagePorts(document()); |
690 | 690 |
691 // Temporary instrumentation for http://crbug.com/621730. | |
692 WTF::debug::ScopedCrashKey("postmessage_src_origin", event->origin().utf8(). data()); | |
693 WTF::debug::ScopedCrashKey("postmessage_dst_origin", document()->getSecurity Origin()->toRawString().utf8().data()); | |
694 WTF::debug::ScopedCrashKey("postmessage_dst_url", document()->url().getStrin g().utf8().data()); | |
695 | |
696 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->tak eLocation()); | 691 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->tak eLocation()); |
697 } | 692 } |
698 | 693 |
699 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer) | 694 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer) |
700 { | 695 { |
701 m_postMessageTimers.remove(timer); | 696 m_postMessageTimers.remove(timer); |
702 } | 697 } |
703 | 698 |
704 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, Event* event, std::unique_ptr<SourceLocation> location) | 699 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, Event* event, std::unique_ptr<SourceLocation> location) |
705 { | 700 { |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1556 { | 1551 { |
1557 // If the LocalDOMWindow still has a frame reference, that frame must point | 1552 // If the LocalDOMWindow still has a frame reference, that frame must point |
1558 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1553 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1559 // where script execution leaks between different LocalDOMWindows. | 1554 // where script execution leaks between different LocalDOMWindows. |
1560 if (m_frameObserver->frame()) | 1555 if (m_frameObserver->frame()) |
1561 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); | 1556 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); |
1562 return m_frameObserver->frame(); | 1557 return m_frameObserver->frame(); |
1563 } | 1558 } |
1564 | 1559 |
1565 } // namespace blink | 1560 } // namespace blink |
OLD | NEW |