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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 { | 703 { |
704 if (intendedTargetOrigin) { | 704 if (intendedTargetOrigin) { |
705 // Check target origin now since the target document may have changed si
nce the timer was scheduled. | 705 // Check target origin now since the target document may have changed si
nce the timer was scheduled. |
706 SecurityOrigin* securityOrigin = document()->getSecurityOrigin(); | 706 SecurityOrigin* securityOrigin = document()->getSecurityOrigin(); |
707 bool validTarget = intendedTargetOrigin->isSameSchemeHostPortAndSuborigi
n(securityOrigin); | 707 bool validTarget = intendedTargetOrigin->isSameSchemeHostPortAndSuborigi
n(securityOrigin); |
708 if (securityOrigin->hasSuborigin() && securityOrigin->suborigin()->polic
yContains(Suborigin::SuboriginPolicyOptions::UnsafePostMessageReceive)) | 708 if (securityOrigin->hasSuborigin() && securityOrigin->suborigin()->polic
yContains(Suborigin::SuboriginPolicyOptions::UnsafePostMessageReceive)) |
709 validTarget = intendedTargetOrigin->isSameSchemeHostPort(securityOri
gin); | 709 validTarget = intendedTargetOrigin->isSameSchemeHostPort(securityOri
gin); |
710 | 710 |
711 if (!validTarget) { | 711 if (!validTarget) { |
712 String message = ExceptionMessages::failedToExecute("postMessage", "
DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() +
"') does not match the recipient window's origin ('" + document()->getSecurityO
rigin()->toString() + "')."); | 712 String message = ExceptionMessages::failedToExecute("postMessage", "
DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() +
"') does not match the recipient window's origin ('" + document()->getSecurityO
rigin()->toString() + "')."); |
713 ConsoleMessage* consoleMessage = ConsoleMessage::create(SecurityMess
ageSource, ErrorMessageLevel, message); | 713 ConsoleMessage* consoleMessage = ConsoleMessage::create(SecurityMess
ageSource, ErrorMessageLevel, message, String(), 0, 0, stackTrace); |
714 consoleMessage->setCallStack(stackTrace); | |
715 frameConsole()->addMessage(consoleMessage); | 714 frameConsole()->addMessage(consoleMessage); |
716 return; | 715 return; |
717 } | 716 } |
718 } | 717 } |
719 | 718 |
720 dispatchEvent(event); | 719 dispatchEvent(event); |
721 } | 720 } |
722 | 721 |
723 DOMSelection* LocalDOMWindow::getSelection() | 722 DOMSelection* LocalDOMWindow::getSelection() |
724 { | 723 { |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 { | 1532 { |
1534 // If the LocalDOMWindow still has a frame reference, that frame must point | 1533 // If the LocalDOMWindow still has a frame reference, that frame must point |
1535 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1534 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1536 // where script execution leaks between different LocalDOMWindows. | 1535 // where script execution leaks between different LocalDOMWindows. |
1537 if (m_frameObserver->frame()) | 1536 if (m_frameObserver->frame()) |
1538 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1537 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1539 return m_frameObserver->frame(); | 1538 return m_frameObserver->frame(); |
1540 } | 1539 } |
1541 | 1540 |
1542 } // namespace blink | 1541 } // namespace blink |
OLD | NEW |