| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2  * Copyright (C) 2013 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 284       } | 284       } | 
| 285       if (shouldEvaluateForDocumentWrite) { | 285       if (shouldEvaluateForDocumentWrite) { | 
| 286         m_likelyDocumentWriteScriptIndices.push_back(m_pendingTokens->size() - | 286         m_likelyDocumentWriteScriptIndices.push_back(m_pendingTokens->size() - | 
| 287                                                      1); | 287                                                      1); | 
| 288       } | 288       } | 
| 289     } | 289     } | 
| 290 | 290 | 
| 291     m_token->clear(); | 291     m_token->clear(); | 
| 292 | 292 | 
| 293     if (simulatedToken == HTMLTreeBuilderSimulator::ScriptEnd || | 293     if (simulatedToken == HTMLTreeBuilderSimulator::ScriptEnd || | 
|  | 294         simulatedToken == HTMLTreeBuilderSimulator::StyleEnd || | 
|  | 295         simulatedToken == HTMLTreeBuilderSimulator::Link || | 
| 294         m_pendingTokens->size() >= m_pendingTokenLimit) { | 296         m_pendingTokens->size() >= m_pendingTokenLimit) { | 
| 295       shouldNotifyMainThread |= queueChunkForMainThread(); | 297       shouldNotifyMainThread |= queueChunkForMainThread(); | 
| 296       // If we're far ahead of the main thread, yield for a bit to avoid | 298       // If we're far ahead of the main thread, yield for a bit to avoid | 
| 297       // consuming too much memory. | 299       // consuming too much memory. | 
| 298       if (m_input.totalCheckpointTokenCount() > m_outstandingTokenLimit) | 300       if (m_input.totalCheckpointTokenCount() > m_outstandingTokenLimit) | 
| 299         break; | 301         break; | 
| 300     } | 302     } | 
| 301 | 303 | 
| 302     if (!m_shouldCoalesceChunks && shouldNotifyMainThread) { | 304     if (!m_shouldCoalesceChunks && shouldNotifyMainThread) { | 
| 303       runOnMainThread(&HTMLDocumentParser::notifyPendingTokenizedChunks, | 305       runOnMainThread(&HTMLDocumentParser::notifyPendingTokenizedChunks, | 
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 377   if (isMainThread()) { | 379   if (isMainThread()) { | 
| 378     (*WTF::bind(function, std::forward<Ps>(parameters)...))(); | 380     (*WTF::bind(function, std::forward<Ps>(parameters)...))(); | 
| 379   } else { | 381   } else { | 
| 380     m_loadingTaskRunner->postTask( | 382     m_loadingTaskRunner->postTask( | 
| 381         BLINK_FROM_HERE, | 383         BLINK_FROM_HERE, | 
| 382         crossThreadBind(function, std::forward<Ps>(parameters)...)); | 384         crossThreadBind(function, std::forward<Ps>(parameters)...)); | 
| 383   } | 385   } | 
| 384 } | 386 } | 
| 385 | 387 | 
| 386 }  // namespace blink | 388 }  // namespace blink | 
| OLD | NEW | 
|---|