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

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

Issue 1069743002: Stop parsing of current document before starting a next load. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 | « 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 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 isTransitionNavigation = dispatchNavigationTransitionData(); 1223 isTransitionNavigation = dispatchNavigationTransitionData();
1224 1224
1225 // stopAllLoaders can detach the LocalFrame, so protect it. 1225 // stopAllLoaders can detach the LocalFrame, so protect it.
1226 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); 1226 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get());
1227 if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request, fra meLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), navigationPolicy, isT ransitionNavigation) || !shouldClose()) && m_policyDocumentLoader) { 1227 if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request, fra meLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), navigationPolicy, isT ransitionNavigation) || !shouldClose()) && m_policyDocumentLoader) {
1228 m_policyDocumentLoader->detachFromFrame(); 1228 m_policyDocumentLoader->detachFromFrame();
1229 m_policyDocumentLoader = nullptr; 1229 m_policyDocumentLoader = nullptr;
1230 return; 1230 return;
1231 } 1231 }
1232 1232
1233 // FIXME: This is an odd set of steps to shut down parsing and it's unclear why it works.
1234 // It's also unclear why other steps don't work.
1235 if (m_frame->document()->parsing()) {
1236 finishedParsing();
1237 m_frame->document()->setParsingState(Document::FinishedParsing);
1238 }
1239 m_frame->document()->setReadyState(Document::Complete);
1240
1233 if (m_provisionalDocumentLoader) { 1241 if (m_provisionalDocumentLoader) {
1234 m_provisionalDocumentLoader->stopLoading(); 1242 m_provisionalDocumentLoader->stopLoading();
1235 if (m_provisionalDocumentLoader) 1243 if (m_provisionalDocumentLoader)
1236 m_provisionalDocumentLoader->detachFromFrame(); 1244 m_provisionalDocumentLoader->detachFromFrame();
1237 m_provisionalDocumentLoader = nullptr; 1245 m_provisionalDocumentLoader = nullptr;
1238 } 1246 }
1239 m_checkTimer.stop(); 1247 m_checkTimer.stop();
1240 1248
1241 // <rdar://problem/6250856> - In certain circumstances on pages with multipl e frames, stopAllLoaders() 1249 // <rdar://problem/6250856> - In certain circumstances on pages with multipl e frames, stopAllLoaders()
1242 // might detach the current FrameLoader, in which case we should bail on thi s newly defunct load. 1250 // might detach the current FrameLoader, in which case we should bail on thi s newly defunct load.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 // FIXME: We need a way to propagate insecure requests policy flags to 1434 // FIXME: We need a way to propagate insecure requests policy flags to
1427 // out-of-process frames. For now, we'll always use default behavior. 1435 // out-of-process frames. For now, we'll always use default behavior.
1428 if (!parentFrame->isLocalFrame()) 1436 if (!parentFrame->isLocalFrame())
1429 return nullptr; 1437 return nullptr;
1430 1438
1431 ASSERT(toLocalFrame(parentFrame)->document()); 1439 ASSERT(toLocalFrame(parentFrame)->document());
1432 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1440 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1433 } 1441 }
1434 1442
1435 } // namespace blink 1443 } // namespace blink
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