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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2455653005: Revert "Revert of [NoStatePrefetch] Kill renderer after preload scanning (patchset #12 id:240001 of… (Closed)
Patch Set: rebased Created 4 years, 1 month 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 #include "platform/scroll/ScrollbarTheme.h" 235 #include "platform/scroll/ScrollbarTheme.h"
236 #include "platform/text/PlatformLocale.h" 236 #include "platform/text/PlatformLocale.h"
237 #include "platform/text/SegmentedString.h" 237 #include "platform/text/SegmentedString.h"
238 #include "platform/tracing/TraceEvent.h" 238 #include "platform/tracing/TraceEvent.h"
239 #include "platform/weborigin/OriginAccessEntry.h" 239 #include "platform/weborigin/OriginAccessEntry.h"
240 #include "platform/weborigin/SchemeRegistry.h" 240 #include "platform/weborigin/SchemeRegistry.h"
241 #include "platform/weborigin/SecurityOrigin.h" 241 #include "platform/weborigin/SecurityOrigin.h"
242 #include "public/platform/Platform.h" 242 #include "public/platform/Platform.h"
243 #include "public/platform/WebAddressSpace.h" 243 #include "public/platform/WebAddressSpace.h"
244 #include "public/platform/WebFrameScheduler.h" 244 #include "public/platform/WebFrameScheduler.h"
245 #include "public/platform/WebPrerenderingSupport.h"
245 #include "public/platform/WebScheduler.h" 246 #include "public/platform/WebScheduler.h"
246 #include "wtf/AutoReset.h" 247 #include "wtf/AutoReset.h"
247 #include "wtf/CurrentTime.h" 248 #include "wtf/CurrentTime.h"
248 #include "wtf/DateMath.h" 249 #include "wtf/DateMath.h"
249 #include "wtf/Functional.h" 250 #include "wtf/Functional.h"
250 #include "wtf/HashFunctions.h" 251 #include "wtf/HashFunctions.h"
251 #include "wtf/PtrUtil.h" 252 #include "wtf/PtrUtil.h"
252 #include "wtf/StdLibExtras.h" 253 #include "wtf/StdLibExtras.h"
253 #include "wtf/text/StringBuffer.h" 254 #include "wtf/text/StringBuffer.h"
254 #include "wtf/text/TextEncodingRegistry.h" 255 #include "wtf/text/TextEncodingRegistry.h"
(...skipping 4876 matching lines...) Expand 10 before | Expand all | Expand 10 after
5131 // Schedule dropping of the ElementDataCache. We keep it alive for a while 5132 // Schedule dropping of the ElementDataCache. We keep it alive for a while
5132 // after parsing finishes so that dynamically inserted content can also 5133 // after parsing finishes so that dynamically inserted content can also
5133 // benefit from sharing optimizations. Note that we don't refresh the timer 5134 // benefit from sharing optimizations. Note that we don't refresh the timer
5134 // on cache access since that could lead to huge caches being kept alive 5135 // on cache access since that could lead to huge caches being kept alive
5135 // indefinitely by something innocuous like JS setting .innerHTML repeatedly 5136 // indefinitely by something innocuous like JS setting .innerHTML repeatedly
5136 // on a timer. 5137 // on a timer.
5137 m_elementDataCacheClearTimer.startOneShot(10, BLINK_FROM_HERE); 5138 m_elementDataCacheClearTimer.startOneShot(10, BLINK_FROM_HERE);
5138 5139
5139 // Parser should have picked up all preloads by now 5140 // Parser should have picked up all preloads by now
5140 m_fetcher->clearPreloads(ResourceFetcher::ClearSpeculativeMarkupPreloads); 5141 m_fetcher->clearPreloads(ResourceFetcher::ClearSpeculativeMarkupPreloads);
5142
5143 if (isPrefetchOnly())
5144 WebPrerenderingSupport::current()->prefetchFinished();
5141 } 5145 }
5142 5146
5143 void Document::elementDataCacheClearTimerFired(TimerBase*) { 5147 void Document::elementDataCacheClearTimerFired(TimerBase*) {
5144 m_elementDataCache.clear(); 5148 m_elementDataCache.clear();
5145 } 5149 }
5146 5150
5147 void Document::beginLifecycleUpdatesIfRenderingReady() { 5151 void Document::beginLifecycleUpdatesIfRenderingReady() {
5148 if (!isActive()) 5152 if (!isActive())
5149 return; 5153 return;
5150 if (!isRenderingReady()) 5154 if (!isRenderingReady())
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
6406 } 6410 }
6407 6411
6408 void showLiveDocumentInstances() { 6412 void showLiveDocumentInstances() {
6409 WeakDocumentSet& set = liveDocumentSet(); 6413 WeakDocumentSet& set = liveDocumentSet();
6410 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6414 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6411 for (Document* document : set) 6415 for (Document* document : set)
6412 fprintf(stderr, "- Document %p URL: %s\n", document, 6416 fprintf(stderr, "- Document %p URL: %s\n", document,
6413 document->url().getString().utf8().data()); 6417 document->url().getString().utf8().data());
6414 } 6418 }
6415 #endif 6419 #endif
OLDNEW
« no previous file with comments | « chrome/renderer/prerender/prerender_dispatcher.cc ('k') | third_party/WebKit/Source/web/tests/PrerenderingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698