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

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

Issue 2452313002: Revert of [NoStatePrefetch] Kill renderer after preload scanning (Closed)
Patch Set: 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 #include "platform/scroll/ScrollbarTheme.h" 234 #include "platform/scroll/ScrollbarTheme.h"
235 #include "platform/text/PlatformLocale.h" 235 #include "platform/text/PlatformLocale.h"
236 #include "platform/text/SegmentedString.h" 236 #include "platform/text/SegmentedString.h"
237 #include "platform/tracing/TraceEvent.h" 237 #include "platform/tracing/TraceEvent.h"
238 #include "platform/weborigin/OriginAccessEntry.h" 238 #include "platform/weborigin/OriginAccessEntry.h"
239 #include "platform/weborigin/SchemeRegistry.h" 239 #include "platform/weborigin/SchemeRegistry.h"
240 #include "platform/weborigin/SecurityOrigin.h" 240 #include "platform/weborigin/SecurityOrigin.h"
241 #include "public/platform/Platform.h" 241 #include "public/platform/Platform.h"
242 #include "public/platform/WebAddressSpace.h" 242 #include "public/platform/WebAddressSpace.h"
243 #include "public/platform/WebFrameScheduler.h" 243 #include "public/platform/WebFrameScheduler.h"
244 #include "public/platform/WebPrerenderingSupport.h"
245 #include "public/platform/WebScheduler.h" 244 #include "public/platform/WebScheduler.h"
246 #include "wtf/AutoReset.h" 245 #include "wtf/AutoReset.h"
247 #include "wtf/CurrentTime.h" 246 #include "wtf/CurrentTime.h"
248 #include "wtf/DateMath.h" 247 #include "wtf/DateMath.h"
249 #include "wtf/Functional.h" 248 #include "wtf/Functional.h"
250 #include "wtf/HashFunctions.h" 249 #include "wtf/HashFunctions.h"
251 #include "wtf/PtrUtil.h" 250 #include "wtf/PtrUtil.h"
252 #include "wtf/StdLibExtras.h" 251 #include "wtf/StdLibExtras.h"
253 #include "wtf/text/StringBuffer.h" 252 #include "wtf/text/StringBuffer.h"
254 #include "wtf/text/TextEncodingRegistry.h" 253 #include "wtf/text/TextEncodingRegistry.h"
(...skipping 4882 matching lines...) Expand 10 before | Expand all | Expand 10 after
5137 // Schedule dropping of the ElementDataCache. We keep it alive for a while 5136 // Schedule dropping of the ElementDataCache. We keep it alive for a while
5138 // after parsing finishes so that dynamically inserted content can also 5137 // after parsing finishes so that dynamically inserted content can also
5139 // benefit from sharing optimizations. Note that we don't refresh the timer 5138 // benefit from sharing optimizations. Note that we don't refresh the timer
5140 // on cache access since that could lead to huge caches being kept alive 5139 // on cache access since that could lead to huge caches being kept alive
5141 // indefinitely by something innocuous like JS setting .innerHTML repeatedly 5140 // indefinitely by something innocuous like JS setting .innerHTML repeatedly
5142 // on a timer. 5141 // on a timer.
5143 m_elementDataCacheClearTimer.startOneShot(10, BLINK_FROM_HERE); 5142 m_elementDataCacheClearTimer.startOneShot(10, BLINK_FROM_HERE);
5144 5143
5145 // Parser should have picked up all preloads by now 5144 // Parser should have picked up all preloads by now
5146 m_fetcher->clearPreloads(ResourceFetcher::ClearSpeculativeMarkupPreloads); 5145 m_fetcher->clearPreloads(ResourceFetcher::ClearSpeculativeMarkupPreloads);
5147
5148 if (isPrefetchOnly())
5149 WebPrerenderingSupport::current()->prefetchFinished();
5150 } 5146 }
5151 5147
5152 void Document::elementDataCacheClearTimerFired(TimerBase*) { 5148 void Document::elementDataCacheClearTimerFired(TimerBase*) {
5153 m_elementDataCache.clear(); 5149 m_elementDataCache.clear();
5154 } 5150 }
5155 5151
5156 void Document::beginLifecycleUpdatesIfRenderingReady() { 5152 void Document::beginLifecycleUpdatesIfRenderingReady() {
5157 if (!isActive()) 5153 if (!isActive())
5158 return; 5154 return;
5159 if (!isRenderingReady()) 5155 if (!isRenderingReady())
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
6413 } 6409 }
6414 6410
6415 void showLiveDocumentInstances() { 6411 void showLiveDocumentInstances() {
6416 WeakDocumentSet& set = liveDocumentSet(); 6412 WeakDocumentSet& set = liveDocumentSet();
6417 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6413 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6418 for (Document* document : set) 6414 for (Document* document : set)
6419 fprintf(stderr, "- Document %p URL: %s\n", document, 6415 fprintf(stderr, "- Document %p URL: %s\n", document,
6420 document->url().getString().utf8().data()); 6416 document->url().getString().utf8().data());
6421 } 6417 }
6422 #endif 6418 #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