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

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

Issue 465563002: Make onload async (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « Source/core/loader/FrameLoader.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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
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) 2009 Adam Barth. All rights reserved. 5 * Copyright (C) 2009 Adam Barth. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // "If the browsing context's session history contains only one Document, 287 // "If the browsing context's session history contains only one Document,
288 // and that was the about:blank Document created when the browsing context 288 // and that was the about:blank Document created when the browsing context
289 // was created, then the navigation must be done with replacement enabled. " 289 // was created, then the navigation must be done with replacement enabled. "
290 if (!targetFrame->loader().stateMachine()->committedMultipleRealLoads() 290 if (!targetFrame->loader().stateMachine()->committedMultipleRealLoads()
291 && equalIgnoringCase(targetFrame->document()->url(), blankURL())) 291 && equalIgnoringCase(targetFrame->document()->url(), blankURL()))
292 return true; 292 return true;
293 293
294 // Navigation of a subframe during loading of an ancestor frame does not cre ate a new back/forward item. 294 // Navigation of a subframe during loading of an ancestor frame does not cre ate a new back/forward item.
295 // The definition of "during load" is any time before all handlers for the l oad event have been run. 295 // The definition of "during load" is any time before all handlers for the l oad event have been run.
296 // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motiva tion for this. 296 // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motiva tion for this.
297 Frame* parentFrame = targetFrame->tree().parent(); 297 for (Frame* parentFrame = targetFrame->tree().parent(); parentFrame; parentF rame = parentFrame->tree().parent()) {
298 return parentFrame && parentFrame->isLocalFrame() && !toLocalFrame(parentFra me)->loader().allAncestorsAreComplete(); 298 if (!parentFrame->isLocalFrame() || !toLocalFrame(parentFrame)->document ()->loadEventFinished())
299 return true;
300 }
301 return false;
299 } 302 }
300 303
301 void NavigationScheduler::scheduleLocationChange(Document* originDocument, const String& url, const Referrer& referrer, bool lockBackForwardList) 304 void NavigationScheduler::scheduleLocationChange(Document* originDocument, const String& url, const Referrer& referrer, bool lockBackForwardList)
302 { 305 {
303 if (!shouldScheduleNavigation(url)) 306 if (!shouldScheduleNavigation(url))
304 return; 307 return;
305 if (url.isEmpty()) 308 if (url.isEmpty())
306 return; 309 return;
307 310
308 lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame ); 311 lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame );
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 424
422 void NavigationScheduler::cancel() 425 void NavigationScheduler::cancel()
423 { 426 {
424 if (m_timer.isActive()) 427 if (m_timer.isActive())
425 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame); 428 InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
426 m_timer.stop(); 429 m_timer.stop();
427 m_redirect.clear(); 430 m_redirect.clear();
428 } 431 }
429 432
430 } // namespace blink 433 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698