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

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

Issue 303133004: Speculative fix for null m_documentLoader deref in FrameLoader::loadInSameDocument (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
« no previous file with comments | « no previous file | 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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 ASSERT(activeDocument); 1386 ASSERT(activeDocument);
1387 LocalFrame* frame = m_frame->tree().find(name); 1387 LocalFrame* frame = m_frame->tree().find(name);
1388 if (!activeDocument->canNavigate(frame)) 1388 if (!activeDocument->canNavigate(frame))
1389 return 0; 1389 return 0;
1390 return frame; 1390 return frame;
1391 } 1391 }
1392 1392
1393 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad Type, ResourceRequestCachePolicy cachePolicy) 1393 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoad Type, ResourceRequestCachePolicy cachePolicy)
1394 { 1394 {
1395 RefPtr<LocalFrame> protect(m_frame); 1395 RefPtr<LocalFrame> protect(m_frame);
1396 // FIXME: It shouldn't be possible for m_documentLoader to be null without m _frame->page() also being null.
1397 // However, it does appear to happen occasionally. This sounds like a side-e ffect of reentrant frame detach.
1398 // See detachClient().
dcheng 2014/05/29 22:43:44 I don't quite understand this comment. Do we check
1399 if (!m_documentLoader)
1400 return;
1401
1396 if (m_frame->page()->defersLoading()) { 1402 if (m_frame->page()->defersLoading()) {
1397 m_deferredHistoryLoad = DeferredHistoryLoad(item, historyLoadType, cache Policy); 1403 m_deferredHistoryLoad = DeferredHistoryLoad(item, historyLoadType, cache Policy);
1398 return; 1404 return;
1399 } 1405 }
1400 1406
1401 m_provisionalItem = item; 1407 m_provisionalItem = item;
1402 if (historyLoadType == HistorySameDocumentLoad) { 1408 if (historyLoadType == HistorySameDocumentLoad) {
1403 m_loadType = FrameLoadTypeBackForward; 1409 m_loadType = FrameLoadTypeBackForward;
1404 loadInSameDocument(item->url(), item->stateObject(), FrameLoadTypeBackFo rward, NotClientRedirect); 1410 loadInSameDocument(item->url(), item->stateObject(), FrameLoadTypeBackFo rward, NotClientRedirect);
1405 restoreScrollPositionAndViewState(); 1411 restoreScrollPositionAndViewState();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 { 1445 {
1440 SandboxFlags flags = m_forcedSandboxFlags; 1446 SandboxFlags flags = m_forcedSandboxFlags;
1441 if (LocalFrame* parentFrame = m_frame->tree().parent()) 1447 if (LocalFrame* parentFrame = m_frame->tree().parent())
1442 flags |= parentFrame->document()->sandboxFlags(); 1448 flags |= parentFrame->document()->sandboxFlags();
1443 if (FrameOwner* frameOwner = m_frame->ownerElement()) 1449 if (FrameOwner* frameOwner = m_frame->ownerElement())
1444 flags |= frameOwner->sandboxFlags(); 1450 flags |= frameOwner->sandboxFlags();
1445 return flags; 1451 return flags;
1446 } 1452 }
1447 1453
1448 } // namespace WebCore 1454 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698