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

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

Issue 2139703003: Add an experiment group via Settings to tokenize synchronously (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline on master Created 4 years, 5 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 | « third_party/WebKit/Source/core/frame/Settings.in ('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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 1018
1019 if (shouldUseThreading()) { 1019 if (shouldUseThreading()) {
1020 double bytesReceivedTime = monotonicallyIncreasingTimeMS(); 1020 double bytesReceivedTime = monotonicallyIncreasingTimeMS();
1021 if (!m_haveBackgroundParser) 1021 if (!m_haveBackgroundParser)
1022 startBackgroundParser(); 1022 startBackgroundParser();
1023 1023
1024 std::unique_ptr<Vector<char>> buffer = wrapUnique(new Vector<char>(lengt h)); 1024 std::unique_ptr<Vector<char>> buffer = wrapUnique(new Vector<char>(lengt h));
1025 memcpy(buffer->data(), data, length); 1025 memcpy(buffer->data(), data, length);
1026 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"), "HTMLDocumentPars er::appendBytes", "size", (unsigned)length); 1026 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"), "HTMLDocumentPars er::appendBytes", "size", (unsigned)length);
1027 1027
1028 postTaskToLookaheadParser(crossThreadBind(&BackgroundHTMLParser::appendR awBytesFromMainThread, m_backgroundParser, passed(std::move(buffer)), bytesRecei vedTime)); 1028 LookaheadParserTaskSynchrony policy = document()->settings() && document ()->settings()->parseHTMLOnMainThreadSyncTokenize() ? Synchronous : Asynchronous ;
1029 postTaskToLookaheadParser(crossThreadBind(&BackgroundHTMLParser::appendR awBytesFromMainThread, m_backgroundParser, passed(std::move(buffer)), bytesRecei vedTime), policy);
1029 return; 1030 return;
1030 } 1031 }
1031 1032
1032 DecodedDataDocumentParser::appendBytes(data, length); 1033 DecodedDataDocumentParser::appendBytes(data, length);
1033 } 1034 }
1034 1035
1035 void HTMLDocumentParser::flush() 1036 void HTMLDocumentParser::flush()
1036 { 1037 {
1037 // If we've got no decoder, we never received any data. 1038 // If we've got no decoder, we never received any data.
1038 if (isDetached() || needsDecoder()) 1039 if (isDetached() || needsDecoder())
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 (*closure)(); 1140 (*closure)();
1140 return; 1141 return;
1141 case Asynchronous: 1142 case Asynchronous:
1142 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, std::move(closure)); 1143 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, std::move(closure));
1143 return; 1144 return;
1144 } 1145 }
1145 NOTREACHED(); 1146 NOTREACHED();
1146 } 1147 }
1147 1148
1148 } // namespace blink 1149 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698