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 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 return; | 1422 return; |
1423 | 1423 |
1424 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, ErrorMess
ageLevel, message)); | 1424 frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, ErrorMess
ageLevel, message)); |
1425 } | 1425 } |
1426 | 1426 |
1427 PassRefPtrWillBeRawPtr<DOMWindow> LocalDOMWindow::open(const String& urlString,
const AtomicString& frameName, const String& windowFeaturesString, | 1427 PassRefPtrWillBeRawPtr<DOMWindow> LocalDOMWindow::open(const String& urlString,
const AtomicString& frameName, const String& windowFeaturesString, |
1428 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow) | 1428 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow) |
1429 { | 1429 { |
1430 if (!isCurrentlyDisplayedInFrame()) | 1430 if (!isCurrentlyDisplayedInFrame()) |
1431 return nullptr; | 1431 return nullptr; |
| 1432 if (!callingWindow->frame()) |
| 1433 return nullptr; |
1432 Document* activeDocument = callingWindow->document(); | 1434 Document* activeDocument = callingWindow->document(); |
1433 if (!activeDocument) | 1435 if (!activeDocument) |
1434 return nullptr; | 1436 return nullptr; |
1435 LocalFrame* firstFrame = enteredWindow->frame(); | 1437 LocalFrame* firstFrame = enteredWindow->frame(); |
1436 if (!firstFrame) | 1438 if (!firstFrame) |
1437 return nullptr; | 1439 return nullptr; |
1438 | 1440 |
1439 UseCounter::count(*activeDocument, UseCounter::DOMWindowOpen); | 1441 UseCounter::count(*activeDocument, UseCounter::DOMWindowOpen); |
1440 if (!windowFeaturesString.isEmpty()) | 1442 if (!windowFeaturesString.isEmpty()) |
1441 UseCounter::count(*activeDocument, UseCounter::DOMWindowOpenFeatures); | 1443 UseCounter::count(*activeDocument, UseCounter::DOMWindowOpenFeatures); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 { | 1512 { |
1511 // If the LocalDOMWindow still has a frame reference, that frame must point | 1513 // If the LocalDOMWindow still has a frame reference, that frame must point |
1512 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1514 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1513 // where script execution leaks between different LocalDOMWindows. | 1515 // where script execution leaks between different LocalDOMWindows. |
1514 if (m_frameObserver->frame()) | 1516 if (m_frameObserver->frame()) |
1515 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1517 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1516 return m_frameObserver->frame(); | 1518 return m_frameObserver->frame(); |
1517 } | 1519 } |
1518 | 1520 |
1519 } // namespace blink | 1521 } // namespace blink |
OLD | NEW |