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

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

Issue 2642733002: Prerender: Disable prefetch if there's an appcache. (Closed)
Patch Set: Prerender: Disable prefetch if there's an appcache. 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 888
889 // We should never reach this point if we're using a parser thread, as 889 // We should never reach this point if we're using a parser thread, as
890 // appendBytes() will directly ship the data to the thread. 890 // appendBytes() will directly ship the data to the thread.
891 DCHECK(!ShouldUseThreading()); 891 DCHECK(!ShouldUseThreading());
892 892
893 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"), 893 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"),
894 "HTMLDocumentParser::append", "size", input_source.length()); 894 "HTMLDocumentParser::append", "size", input_source.length());
895 const SegmentedString source(input_source); 895 const SegmentedString source(input_source);
896 896
897 if (GetDocument()->IsPrefetchOnly()) { 897 if (GetDocument()->IsPrefetchOnly()) {
898 // Do not prefetch if there is an appcache.
899 if (GetDocument()->Loader()->GetResponse().AppCacheID() != 0)
900 return;
901
898 if (!preload_scanner_) 902 if (!preload_scanner_)
899 preload_scanner_ = CreatePreloadScanner(); 903 preload_scanner_ = CreatePreloadScanner();
900 904
901 preload_scanner_->AppendToEnd(source); 905 preload_scanner_->AppendToEnd(source);
902 ScanAndPreload(preload_scanner_.get()); 906 ScanAndPreload(preload_scanner_.get());
903 907
904 // Return after the preload scanner, do not actually parse the document. 908 // Return after the preload scanner, do not actually parse the document.
905 return; 909 return;
906 } 910 }
907 911
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 success_histogram.Count(duration); 1333 success_histogram.Count(duration);
1330 } else { 1334 } else {
1331 DEFINE_STATIC_LOCAL( 1335 DEFINE_STATIC_LOCAL(
1332 CustomCountHistogram, failure_histogram, 1336 CustomCountHistogram, failure_histogram,
1333 ("PreloadScanner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50)); 1337 ("PreloadScanner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50));
1334 failure_histogram.Count(duration); 1338 failure_histogram.Count(duration);
1335 } 1339 }
1336 } 1340 }
1337 1341
1338 } // namespace blink 1342 } // 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