| OLD | NEW |
| 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 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 | 1135 |
| 1136 void HTMLDocumentParser::appendBytes(const char* data, size_t length) { | 1136 void HTMLDocumentParser::appendBytes(const char* data, size_t length) { |
| 1137 if (!length || isStopped()) | 1137 if (!length || isStopped()) |
| 1138 return; | 1138 return; |
| 1139 | 1139 |
| 1140 if (shouldUseThreading()) { | 1140 if (shouldUseThreading()) { |
| 1141 double bytesReceivedTime = monotonicallyIncreasingTimeMS(); | 1141 double bytesReceivedTime = monotonicallyIncreasingTimeMS(); |
| 1142 if (!m_haveBackgroundParser) | 1142 if (!m_haveBackgroundParser) |
| 1143 startBackgroundParser(); | 1143 startBackgroundParser(); |
| 1144 | 1144 |
| 1145 std::unique_ptr<Vector<char>> buffer = wrapUnique(new Vector<char>(length)); | 1145 std::unique_ptr<Vector<char>> buffer = makeUnique<Vector<char>>(length); |
| 1146 memcpy(buffer->data(), data, length); | 1146 memcpy(buffer->data(), data, length); |
| 1147 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"), | 1147 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.debug"), |
| 1148 "HTMLDocumentParser::appendBytes", "size", (unsigned)length); | 1148 "HTMLDocumentParser::appendBytes", "size", (unsigned)length); |
| 1149 | 1149 |
| 1150 LookaheadParserTaskSynchrony policy = | 1150 LookaheadParserTaskSynchrony policy = |
| 1151 document()->settings() && | 1151 document()->settings() && |
| 1152 document()->settings()->parseHTMLOnMainThreadSyncTokenize() | 1152 document()->settings()->parseHTMLOnMainThreadSyncTokenize() |
| 1153 ? Synchronous | 1153 ? Synchronous |
| 1154 : Asynchronous; | 1154 : Asynchronous; |
| 1155 postTaskToLookaheadParser( | 1155 postTaskToLookaheadParser( |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 case Asynchronous: | 1295 case Asynchronous: |
| 1296 m_loadingTaskRunner->postTask( | 1296 m_loadingTaskRunner->postTask( |
| 1297 BLINK_FROM_HERE, | 1297 BLINK_FROM_HERE, |
| 1298 WTF::bind(function, std::forward<Ps>(parameters)...)); | 1298 WTF::bind(function, std::forward<Ps>(parameters)...)); |
| 1299 return; | 1299 return; |
| 1300 } | 1300 } |
| 1301 NOTREACHED(); | 1301 NOTREACHED(); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 } // namespace blink | 1304 } // namespace blink |
| OLD | NEW |