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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2751973005: Link prefetch fetches deferred until onload
Patch Set: Fixed post onload addition and crash Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 Event* loadEvent(Event::create(EventTypeNames::load)); 1472 Event* loadEvent(Event::create(EventTypeNames::load));
1473 if (frame() && frame()->loader().documentLoader() && 1473 if (frame() && frame()->loader().documentLoader() &&
1474 !frame()->loader().documentLoader()->timing().loadEventStart()) { 1474 !frame()->loader().documentLoader()->timing().loadEventStart()) {
1475 DocumentLoader* documentLoader = frame()->loader().documentLoader(); 1475 DocumentLoader* documentLoader = frame()->loader().documentLoader();
1476 DocumentLoadTiming& timing = documentLoader->timing(); 1476 DocumentLoadTiming& timing = documentLoader->timing();
1477 timing.markLoadEventStart(); 1477 timing.markLoadEventStart();
1478 dispatchEvent(loadEvent, document()); 1478 dispatchEvent(loadEvent, document());
1479 timing.markLoadEventEnd(); 1479 timing.markLoadEventEnd();
1480 DCHECK(documentLoader->fetcher()); 1480 DCHECK(documentLoader->fetcher());
1481 // If fetcher->countPreloads() is not empty here, it's full of link 1481 // If fetcher->countPreloads() is not empty here, it's full of link
1482 // preloads, as speculatove preloads were cleared at DCL. 1482 // preloads, as speculative preloads were cleared at DCL.
1483 if (frame() && documentLoader == frame()->loader().documentLoader() && 1483 if (frame() && documentLoader == frame()->loader().documentLoader() &&
1484 documentLoader->fetcher()->countPreloads()) 1484 documentLoader->fetcher()->countPreloads()) {
1485 m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeoutInSeconds, 1485 m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeoutInSeconds,
1486 BLINK_FROM_HERE); 1486 BLINK_FROM_HERE);
1487 }
1488 documentLoader->fetcher()->loadOnloadDeferredResources();
1487 } else { 1489 } else {
1488 dispatchEvent(loadEvent, document()); 1490 dispatchEvent(loadEvent, document());
1489 } 1491 }
1490 1492
1491 if (frame()) { 1493 if (frame()) {
1492 Performance* performance = DOMWindowPerformance::performance(*this); 1494 Performance* performance = DOMWindowPerformance::performance(*this);
1493 DCHECK(performance); 1495 DCHECK(performance);
1494 performance->addNavigationTiming(frame()); 1496 performance->addNavigationTiming(frame());
1495 } 1497 }
1496 1498
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 DOMWindow::trace(visitor); 1654 DOMWindow::trace(visitor);
1653 Supplementable<LocalDOMWindow>::trace(visitor); 1655 Supplementable<LocalDOMWindow>::trace(visitor);
1654 } 1656 }
1655 1657
1656 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { 1658 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) {
1657 visitor->traceWrappers(m_customElements); 1659 visitor->traceWrappers(m_customElements);
1658 DOMWindow::traceWrappers(visitor); 1660 DOMWindow::traceWrappers(visitor);
1659 } 1661 }
1660 1662
1661 } // namespace blink 1663 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698