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

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

Issue 181493007: Don't stop the documentLoader on navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: simplify Created 6 years, 7 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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 m_policyDocumentLoader->setOverrideEncoding(m_documentLoader->overrideEn coding()); 1281 m_policyDocumentLoader->setOverrideEncoding(m_documentLoader->overrideEn coding());
1282 1282
1283 // stopAllLoaders can detach the LocalFrame, so protect it. 1283 // stopAllLoaders can detach the LocalFrame, so protect it.
1284 RefPtr<LocalFrame> protect(m_frame); 1284 RefPtr<LocalFrame> protect(m_frame);
1285 if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request) || !shouldClose()) && m_policyDocumentLoader) { 1285 if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request) || !shouldClose()) && m_policyDocumentLoader) {
1286 m_policyDocumentLoader->detachFromFrame(); 1286 m_policyDocumentLoader->detachFromFrame();
1287 m_policyDocumentLoader = nullptr; 1287 m_policyDocumentLoader = nullptr;
1288 return; 1288 return;
1289 } 1289 }
1290 1290
1291 // A new navigation is in progress, so don't clear the history's provisional item. 1291 if (m_provisionalDocumentLoader) {
1292 stopAllLoaders(); 1292 m_provisionalDocumentLoader->stopLoading();
1293 1293 if (m_provisionalDocumentLoader)
1294 // <rdar://problem/6250856> - In certain circumstances on pages with multipl e frames, stopAllLoaders() 1294 m_provisionalDocumentLoader->detachFromFrame();
1295 // might detach the current FrameLoader, in which case we should bail on thi s newly defunct load. 1295 m_provisionalDocumentLoader = nullptr;
1296 if (!m_frame->page() || !m_policyDocumentLoader) 1296 }
Nate Chapin 2014/05/20 17:47:09 I don't think that removing this early return is s
mkosiba (inactive) 2014/05/20 19:06:10 I will leave the check in. If I wanted to hit this
Nate Chapin 2014/05/20 19:16:06 In terms of repro, I have never actually seen a re
1297 return; 1297 m_checkTimer.stop();
1298 1298
1299 if (isLoadingMainFrame()) 1299 if (isLoadingMainFrame())
1300 m_frame->page()->inspectorController().resume(); 1300 m_frame->page()->inspectorController().resume();
1301 m_frame->navigationScheduler().cancel(); 1301 m_frame->navigationScheduler().cancel();
1302 1302
1303 m_provisionalDocumentLoader = m_policyDocumentLoader.release(); 1303 m_provisionalDocumentLoader = m_policyDocumentLoader.release();
1304 m_loadType = type; 1304 m_loadType = type;
1305 m_state = FrameStateProvisional; 1305 m_state = FrameStateProvisional;
1306 1306
1307 if (formState) 1307 if (formState)
1308 m_client->dispatchWillSubmitForm(formState->form()); 1308 m_client->dispatchWillSubmitForm(formState->form());
1309 1309
1310 m_progressTracker->progressStarted(); 1310 m_progressTracker->progressStarted();
1311
Nate Chapin 2014/05/20 17:47:09 Any reason for the extra newlines here and below?
mkosiba (inactive) 2014/05/20 19:06:10 Done.
1311 if (m_provisionalDocumentLoader->isClientRedirect()) 1312 if (m_provisionalDocumentLoader->isClientRedirect())
1312 m_provisionalDocumentLoader->appendRedirect(m_frame->document()->url()); 1313 m_provisionalDocumentLoader->appendRedirect(m_frame->document()->url());
1313 m_provisionalDocumentLoader->appendRedirect(m_provisionalDocumentLoader->req uest().url()); 1314 m_provisionalDocumentLoader->appendRedirect(m_provisionalDocumentLoader->req uest().url());
1314 m_client->dispatchDidStartProvisionalLoad(); 1315 m_client->dispatchDidStartProvisionalLoad();
1315 ASSERT(m_provisionalDocumentLoader); 1316 ASSERT(m_provisionalDocumentLoader);
1316 m_provisionalDocumentLoader->startLoadingMainResource(); 1317 m_provisionalDocumentLoader->startLoadingMainResource();
1318
1317 } 1319 }
1318 1320
1319 void FrameLoader::applyUserAgent(ResourceRequest& request) 1321 void FrameLoader::applyUserAgent(ResourceRequest& request)
1320 { 1322 {
1321 String userAgent = this->userAgent(request.url()); 1323 String userAgent = this->userAgent(request.url());
1322 ASSERT(!userAgent.isNull()); 1324 ASSERT(!userAgent.isNull());
1323 request.setHTTPUserAgent(AtomicString(userAgent)); 1325 request.setHTTPUserAgent(AtomicString(userAgent));
1324 } 1326 }
1325 1327
1326 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con st KURL& url, unsigned long requestIdentifier) 1328 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con st KURL& url, unsigned long requestIdentifier)
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 { 1438 {
1437 SandboxFlags flags = m_forcedSandboxFlags; 1439 SandboxFlags flags = m_forcedSandboxFlags;
1438 if (LocalFrame* parentFrame = m_frame->tree().parent()) 1440 if (LocalFrame* parentFrame = m_frame->tree().parent())
1439 flags |= parentFrame->document()->sandboxFlags(); 1441 flags |= parentFrame->document()->sandboxFlags();
1440 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) 1442 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
1441 flags |= ownerElement->sandboxFlags(); 1443 flags |= ownerElement->sandboxFlags();
1442 return flags; 1444 return flags;
1443 } 1445 }
1444 1446
1445 } // namespace WebCore 1447 } // 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