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

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: 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
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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 680
681 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer) 681 void LocalDOMWindow::removePostMessageTimer(PostMessageTimer* timer)
682 { 682 {
683 m_postMessageTimers.remove(timer); 683 m_postMessageTimers.remove(timer);
684 } 684 }
685 685
686 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, PassRefPtrWillBeRawPtr<Event> event, PassRefPtrWillBeRawPtr<Scrip tCallStack> stackTrace) 686 void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende dTargetOrigin, PassRefPtrWillBeRawPtr<Event> event, PassRefPtrWillBeRawPtr<Scrip tCallStack> stackTrace)
687 { 687 {
688 if (intendedTargetOrigin) { 688 if (intendedTargetOrigin) {
689 // Check target origin now since the target document may have changed si nce the timer was scheduled. 689 // Check target origin now since the target document may have changed si nce the timer was scheduled.
690 if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrig in())) { 690 if (!intendedTargetOrigin->isSameSchemeHostPortAndSuborigin(document()-> securityOrigin())) {
691 String message = ExceptionMessages::failedToExecute("postMessage", " DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() + "') does not match the recipient window's origin ('" + document()->securityOrig in()->toString() + "')."); 691 String message = ExceptionMessages::failedToExecute("postMessage", " DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() + "') does not match the recipient window's origin ('" + document()->securityOrig in()->toString() + "').");
692 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage:: create(SecurityMessageSource, ErrorMessageLevel, message); 692 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage:: create(SecurityMessageSource, ErrorMessageLevel, message);
693 consoleMessage->setCallStack(stackTrace); 693 consoleMessage->setCallStack(stackTrace);
694 frameConsole()->addMessage(consoleMessage.release()); 694 frameConsole()->addMessage(consoleMessage.release());
695 return; 695 return;
696 } 696 }
697 } 697 }
698 698
699 dispatchEvent(event); 699 dispatchEvent(event);
700 } 700 }
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 DOMWindow::trace(visitor); 1525 DOMWindow::trace(visitor);
1526 DOMWindowLifecycleNotifier::trace(visitor); 1526 DOMWindowLifecycleNotifier::trace(visitor);
1527 } 1527 }
1528 1528
1529 LocalFrame* LocalDOMWindow::frame() const 1529 LocalFrame* LocalDOMWindow::frame() const
1530 { 1530 {
1531 return m_frameObserver->frame(); 1531 return m_frameObserver->frame();
1532 } 1532 }
1533 1533
1534 } // namespace blink 1534 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698