| 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 // Always check isParsing first as m_document may be null. Surprisingly, | 628 // Always check isParsing first as m_document may be null. Surprisingly, |
| 629 // isScheduledForResume() may be set here as a result of | 629 // isScheduledForResume() may be set here as a result of |
| 630 // processTokenizedChunkFromBackgroundParser running arbitrary javascript | 630 // processTokenizedChunkFromBackgroundParser running arbitrary javascript |
| 631 // which invokes nested event loops. (e.g. inspector breakpoints) | 631 // which invokes nested event loops. (e.g. inspector breakpoints) |
| 632 checkIfBodyStylesheetAdded(); | 632 checkIfBodyStylesheetAdded(); |
| 633 if (!isParsing() || isPaused() || isScheduledForResume()) | 633 if (!isParsing() || isPaused() || isScheduledForResume()) |
| 634 break; | 634 break; |
| 635 | 635 |
| 636 if (m_speculations.isEmpty() || | 636 if (m_speculations.isEmpty() || |
| 637 m_parserScheduler->yieldIfNeeded( | 637 m_parserScheduler->yieldIfNeeded( |
| 638 session, m_speculations.first()->startingScript)) | 638 session, m_speculations.front()->startingScript)) |
| 639 break; | 639 break; |
| 640 } | 640 } |
| 641 } | 641 } |
| 642 | 642 |
| 643 void HTMLDocumentParser::forcePlaintextForTextDocument() { | 643 void HTMLDocumentParser::forcePlaintextForTextDocument() { |
| 644 if (shouldUseThreading()) { | 644 if (shouldUseThreading()) { |
| 645 // This method is called before any data is appended, so we have to start | 645 // This method is called before any data is appended, so we have to start |
| 646 // the background parser ourselves. | 646 // the background parser ourselves. |
| 647 if (!m_haveBackgroundParser) | 647 if (!m_haveBackgroundParser) |
| 648 startBackgroundParser(); | 648 startBackgroundParser(); |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 successHistogram.count(duration); | 1320 successHistogram.count(duration); |
| 1321 } else { | 1321 } else { |
| 1322 DEFINE_STATIC_LOCAL( | 1322 DEFINE_STATIC_LOCAL( |
| 1323 CustomCountHistogram, failureHistogram, | 1323 CustomCountHistogram, failureHistogram, |
| 1324 ("PreloadScanner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50)); | 1324 ("PreloadScanner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50)); |
| 1325 failureHistogram.count(duration); | 1325 failureHistogram.count(duration); |
| 1326 } | 1326 } |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 } // namespace blink | 1329 } // namespace blink |
| OLD | NEW |