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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp

Issue 2790323003: Revert of Prerender: Disable prefetch if there's an appcache. (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/test/data/prerender/prefetch_appcache.html ('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) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 876
877 // We should never reach this point if we're using a parser thread, as 877 // We should never reach this point if we're using a parser thread, as
878 // appendBytes() will directly ship the data to the thread. 878 // appendBytes() will directly ship the data to the thread.
879 DCHECK(!shouldUseThreading()); 879 DCHECK(!shouldUseThreading());
880 880
881 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"), 881 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"),
882 "HTMLDocumentParser::append", "size", inputSource.length()); 882 "HTMLDocumentParser::append", "size", inputSource.length());
883 const SegmentedString source(inputSource); 883 const SegmentedString source(inputSource);
884 884
885 if (document()->isPrefetchOnly()) { 885 if (document()->isPrefetchOnly()) {
886 // Do not prefetch if there is an appcache.
887 if (document()->loader()->response().appCacheID() != 0)
888 return;
889
890 if (!m_preloadScanner) 886 if (!m_preloadScanner)
891 m_preloadScanner = createPreloadScanner(); 887 m_preloadScanner = createPreloadScanner();
892 888
893 m_preloadScanner->appendToEnd(source); 889 m_preloadScanner->appendToEnd(source);
894 scanAndPreload(m_preloadScanner.get()); 890 scanAndPreload(m_preloadScanner.get());
895 891
896 // Return after the preload scanner, do not actually parse the document. 892 // Return after the preload scanner, do not actually parse the document.
897 return; 893 return;
898 } 894 }
899 895
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 successHistogram.count(duration); 1313 successHistogram.count(duration);
1318 } else { 1314 } else {
1319 DEFINE_STATIC_LOCAL( 1315 DEFINE_STATIC_LOCAL(
1320 CustomCountHistogram, failureHistogram, 1316 CustomCountHistogram, failureHistogram,
1321 ("PreloadScanner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50)); 1317 ("PreloadScanner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50));
1322 failureHistogram.count(duration); 1318 failureHistogram.count(duration);
1323 } 1319 }
1324 } 1320 }
1325 1321
1326 } // namespace blink 1322 } // namespace blink
OLDNEW
« no previous file with comments | « chrome/test/data/prerender/prefetch_appcache.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698