Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2467993002: Document user gesture state should be able to propagate over postMessage (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 #include "bindings/core/v8/ScriptController.h" 29 #include "bindings/core/v8/ScriptController.h"
30 #include "bindings/core/v8/SourceLocation.h" 30 #include "bindings/core/v8/SourceLocation.h"
31 #include "core/css/CSSComputedStyleDeclaration.h" 31 #include "core/css/CSSComputedStyleDeclaration.h"
32 #include "core/css/CSSRuleList.h" 32 #include "core/css/CSSRuleList.h"
33 #include "core/css/DOMWindowCSS.h" 33 #include "core/css/DOMWindowCSS.h"
34 #include "core/css/MediaQueryList.h" 34 #include "core/css/MediaQueryList.h"
35 #include "core/css/MediaQueryMatcher.h" 35 #include "core/css/MediaQueryMatcher.h"
36 #include "core/css/StyleMedia.h" 36 #include "core/css/StyleMedia.h"
37 #include "core/css/resolver/StyleResolver.h" 37 #include "core/css/resolver/StyleResolver.h"
38 #include "core/dom/DOMImplementation.h" 38 #include "core/dom/DOMImplementation.h"
39 #include "core/dom/DocumentUserGestureToken.h"
39 #include "core/dom/ExecutionContextTask.h" 40 #include "core/dom/ExecutionContextTask.h"
40 #include "core/dom/FrameRequestCallback.h" 41 #include "core/dom/FrameRequestCallback.h"
41 #include "core/dom/SandboxFlags.h" 42 #include "core/dom/SandboxFlags.h"
42 #include "core/dom/custom/CustomElementRegistry.h" 43 #include "core/dom/custom/CustomElementRegistry.h"
43 #include "core/editing/Editor.h" 44 #include "core/editing/Editor.h"
44 #include "core/events/DOMWindowEventQueue.h" 45 #include "core/events/DOMWindowEventQueue.h"
45 #include "core/events/HashChangeEvent.h" 46 #include "core/events/HashChangeEvent.h"
46 #include "core/events/MessageEvent.h" 47 #include "core/events/MessageEvent.h"
47 #include "core/events/PageTransitionEvent.h" 48 #include "core/events/PageTransitionEvent.h"
48 #include "core/events/PopStateEvent.h" 49 #include "core/events/PopStateEvent.h"
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 timer->suspendIfNeeded(); 627 timer->suspendIfNeeded();
627 m_postMessageTimers.add(timer); 628 m_postMessageTimers.add(timer);
628 } 629 }
629 630
630 void LocalDOMWindow::postMessageTimerFired(PostMessageTimer* timer) { 631 void LocalDOMWindow::postMessageTimerFired(PostMessageTimer* timer) {
631 if (!isCurrentlyDisplayedInFrame()) 632 if (!isCurrentlyDisplayedInFrame())
632 return; 633 return;
633 634
634 MessageEvent* event = timer->event(); 635 MessageEvent* event = timer->event();
635 636
636 UserGestureIndicator gestureIndicator(timer->userGestureToken()); 637 UserGestureIndicator gestureIndicator(
638 DocumentUserGestureToken::adopt(document(), timer->userGestureToken()));
637 639
638 event->entangleMessagePorts(document()); 640 event->entangleMessagePorts(document());
639 641
640 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, 642 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event,
641 timer->takeLocation()); 643 timer->takeLocation());
642 } 644 }
643 645
644 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer) { 646 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer) {
645 m_postMessageTimers.remove(timer); 647 m_postMessageTimers.remove(timer);
646 } 648 }
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 1551
1550 LocalFrame* LocalDOMWindow::frame() const { 1552 LocalFrame* LocalDOMWindow::frame() const {
1551 // If the LocalDOMWindow still has a frame reference, that frame must point 1553 // If the LocalDOMWindow still has a frame reference, that frame must point
1552 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1554 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1553 // where script execution leaks between different LocalDOMWindows. 1555 // where script execution leaks between different LocalDOMWindows.
1554 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); 1556 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
1555 return m_frame; 1557 return m_frame;
1556 } 1558 }
1557 1559
1558 } // namespace blink 1560 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698