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

Side by Side Diff: Source/core/frame/DOMWindow.cpp

Issue 258783004: Add a "forwarded" flag to usergesture tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix unittest Created 6 years, 7 months 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
« no previous file with comments | « Source/core/frame/DOMTimer.cpp ('k') | Source/platform/UserGestureIndicator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 return; 857 return;
858 858
859 RefPtrWillBeRawPtr<MessageEvent> event = timer->event(); 859 RefPtrWillBeRawPtr<MessageEvent> event = timer->event();
860 860
861 // Give the embedder a chance to intercept this postMessage because this 861 // Give the embedder a chance to intercept this postMessage because this
862 // DOMWindow might be a proxy for another in browsers that support 862 // DOMWindow might be a proxy for another in browsers that support
863 // postMessage calls across WebKit instances. 863 // postMessage calls across WebKit instances.
864 if (m_frame->loader().client()->willCheckAndDispatchMessageEvent(timer->targ etOrigin(), event.get())) 864 if (m_frame->loader().client()->willCheckAndDispatchMessageEvent(timer->targ etOrigin(), event.get()))
865 return; 865 return;
866 866
867 UserGestureIndicator gestureIndicator(timer->userGestureToken()); 867 UserGestureToken* token = timer->userGestureToken();
868 if (token)
869 token->setForwarded();
870 UserGestureIndicator gestureIndicator(token);
868 871
869 event->entangleMessagePorts(document()); 872 event->entangleMessagePorts(document());
870 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->sta ckTrace()); 873 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->sta ckTrace());
871 } 874 }
872 875
873 void DOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTarg etOrigin, PassRefPtrWillBeRawPtr<Event> event, PassRefPtr<ScriptCallStack> stack Trace) 876 void DOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTarg etOrigin, PassRefPtrWillBeRawPtr<Event> event, PassRefPtr<ScriptCallStack> stack Trace)
874 { 877 {
875 if (intendedTargetOrigin) { 878 if (intendedTargetOrigin) {
876 // Check target origin now since the target document may have changed si nce the timer was scheduled. 879 // Check target origin now since the target document may have changed si nce the timer was scheduled.
877 if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrig in())) { 880 if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrig in())) {
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 visitor->trace(m_media); 1881 visitor->trace(m_media);
1879 visitor->trace(m_sessionStorage); 1882 visitor->trace(m_sessionStorage);
1880 visitor->trace(m_localStorage); 1883 visitor->trace(m_localStorage);
1881 visitor->trace(m_applicationCache); 1884 visitor->trace(m_applicationCache);
1882 visitor->trace(m_performance); 1885 visitor->trace(m_performance);
1883 visitor->trace(m_css); 1886 visitor->trace(m_css);
1884 WillBeHeapSupplementable<DOMWindow>::trace(visitor); 1887 WillBeHeapSupplementable<DOMWindow>::trace(visitor);
1885 } 1888 }
1886 1889
1887 } // namespace WebCore 1890 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/DOMTimer.cpp ('k') | Source/platform/UserGestureIndicator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698