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

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

Issue 1682173004: Add missing opener frame null check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/LayoutTests/fast/frames/open-without-opener-frame-crash-expected.txt ('k') | no next file » | 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 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/frames/open-without-opener-frame-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698