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

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

Issue 1180923003: Add window access checks for Suborigins (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests on Windows Created 5 years, 6 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/DOMWindow.cpp ('k') | Source/platform/weborigin/SecurityOrigin.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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 670
671 event->entangleMessagePorts(document()); 671 event->entangleMessagePorts(document());
672 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->sta ckTrace()); 672 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->sta ckTrace());
673 m_postMessageTimers.remove(timer); 673 m_postMessageTimers.remove(timer);
674 } 674 }
675 675
676 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, PassRefPtrWillBeRawPtr<Event> event, PassRefPtrWillBeRawPtr<Scrip tCallStack> stackTrace) 676 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, PassRefPtrWillBeRawPtr<Event> event, PassRefPtrWillBeRawPtr<Scrip tCallStack> stackTrace)
677 { 677 {
678 if (intendedTargetOrigin) { 678 if (intendedTargetOrigin) {
679 // Check target origin now since the target document may have changed si nce the timer was scheduled. 679 // Check target origin now since the target document may have changed si nce the timer was scheduled.
680 if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrig in())) { 680 if (!intendedTargetOrigin->isSameSchemeHostPortAndSuborigin(document()-> securityOrigin())) {
681 String message = ExceptionMessages::failedToExecute("postMessage", " DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() + "') does not match the recipient window's origin ('" + document()->securityOrig in()->toString() + "')."); 681 String message = ExceptionMessages::failedToExecute("postMessage", " DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() + "') does not match the recipient window's origin ('" + document()->securityOrig in()->toString() + "').");
682 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage:: create(SecurityMessageSource, ErrorMessageLevel, message); 682 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage:: create(SecurityMessageSource, ErrorMessageLevel, message);
683 consoleMessage->setCallStack(stackTrace); 683 consoleMessage->setCallStack(stackTrace);
684 frameConsole()->addMessage(consoleMessage.release()); 684 frameConsole()->addMessage(consoleMessage.release());
685 return; 685 return;
686 } 686 }
687 } 687 }
688 688
689 dispatchEvent(event); 689 dispatchEvent(event);
690 } 690 }
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 DOMWindow::trace(visitor); 1503 DOMWindow::trace(visitor);
1504 DOMWindowLifecycleNotifier::trace(visitor); 1504 DOMWindowLifecycleNotifier::trace(visitor);
1505 } 1505 }
1506 1506
1507 LocalFrame* LocalDOMWindow::frame() const 1507 LocalFrame* LocalDOMWindow::frame() const
1508 { 1508 {
1509 return m_frameObserver->frame(); 1509 return m_frameObserver->frame();
1510 } 1510 }
1511 1511
1512 } // namespace blink 1512 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/DOMWindow.cpp ('k') | Source/platform/weborigin/SecurityOrigin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698