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

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 307223002: Make sure we never pass a null Frame to Document::canNavigate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« Source/core/frame/Frame.h ('K') | « Source/core/frame/History.cpp ('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, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement(); 1379 HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement();
1380 if (!isHTMLIFrameElement(ownerElement)) 1380 if (!isHTMLIFrameElement(ownerElement))
1381 return false; 1381 return false;
1382 return ownerElement->fastHasAttribute(srcdocAttr); 1382 return ownerElement->fastHasAttribute(srcdocAttr);
1383 } 1383 }
1384 1384
1385 LocalFrame* FrameLoader::findFrameForNavigation(const AtomicString& name, Docume nt* activeDocument) 1385 LocalFrame* FrameLoader::findFrameForNavigation(const AtomicString& name, Docume nt* activeDocument)
1386 { 1386 {
1387 ASSERT(activeDocument); 1387 ASSERT(activeDocument);
1388 LocalFrame* frame = m_frame->tree().find(name); 1388 LocalFrame* frame = m_frame->tree().find(name);
1389 if (!activeDocument->canNavigate(frame)) 1389 if (!frame || !activeDocument->canNavigate(*frame))
eseidel 2014/06/02 05:19:29 So this is the magic to fix the layout test?
Inactive 2014/06/02 12:16:37 No, I did not do anything to fix the layout test.
1390 return 0; 1390 return 0;
1391 return frame; 1391 return frame;
1392 } 1392 }
1393 1393
1394 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad Type, ResourceRequestCachePolicy cachePolicy) 1394 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad Type, ResourceRequestCachePolicy cachePolicy)
1395 { 1395 {
1396 RefPtr<LocalFrame> protect(m_frame); 1396 RefPtr<LocalFrame> protect(m_frame);
1397 if (m_frame->page()->defersLoading()) { 1397 if (m_frame->page()->defersLoading()) {
1398 m_deferredHistoryLoad = DeferredHistoryLoad(item, historyLoadType, cache Policy); 1398 m_deferredHistoryLoad = DeferredHistoryLoad(item, historyLoadType, cache Policy);
1399 return; 1399 return;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. 1442 // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
1443 Frame* parentFrame = m_frame->tree().parent(); 1443 Frame* parentFrame = m_frame->tree().parent();
1444 if (parentFrame && parentFrame->isLocalFrame()) 1444 if (parentFrame && parentFrame->isLocalFrame())
1445 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); 1445 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags();
1446 if (FrameOwner* frameOwner = m_frame->ownerElement()) 1446 if (FrameOwner* frameOwner = m_frame->ownerElement())
1447 flags |= frameOwner->sandboxFlags(); 1447 flags |= frameOwner->sandboxFlags();
1448 return flags; 1448 return flags;
1449 } 1449 }
1450 1450
1451 } // namespace WebCore 1451 } // namespace WebCore
OLDNEW
« Source/core/frame/Frame.h ('K') | « Source/core/frame/History.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698