| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 bool HTMLParserScheduler::isScheduledForResume() const { | 72 bool HTMLParserScheduler::isScheduledForResume() const { |
| 73 return m_isSuspendedWithActiveTimer || | 73 return m_isSuspendedWithActiveTimer || |
| 74 m_cancellableContinueParseTaskHandle.isActive(); | 74 m_cancellableContinueParseTaskHandle.isActive(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void HTMLParserScheduler::scheduleForResume() { | 77 void HTMLParserScheduler::scheduleForResume() { |
| 78 DCHECK(!m_isSuspendedWithActiveTimer); | 78 DCHECK(!m_isSuspendedWithActiveTimer); |
| 79 m_cancellableContinueParseTaskHandle = | 79 m_cancellableContinueParseTaskHandle = |
| 80 m_loadingTaskRunner->postCancellableTask( | 80 m_loadingTaskRunner->postCancellableTask( |
| 81 BLINK_FROM_HERE, WTF::bind(&HTMLParserScheduler::continueParsing, | 81 BLINK_FROM_HERE, |
| 82 wrapWeakPersistent(this))); | 82 WTF::bind(&HTMLParserScheduler::continueParsing, |
| 83 wrapWeakPersistent(this))); |
| 83 } | 84 } |
| 84 | 85 |
| 85 void HTMLParserScheduler::suspend() { | 86 void HTMLParserScheduler::suspend() { |
| 86 DCHECK(!m_isSuspendedWithActiveTimer); | 87 DCHECK(!m_isSuspendedWithActiveTimer); |
| 87 if (!m_cancellableContinueParseTaskHandle.isActive()) | 88 if (!m_cancellableContinueParseTaskHandle.isActive()) |
| 88 return; | 89 return; |
| 89 m_isSuspendedWithActiveTimer = true; | 90 m_isSuspendedWithActiveTimer = true; |
| 90 m_cancellableContinueParseTaskHandle.cancel(); | 91 m_cancellableContinueParseTaskHandle.cancel(); |
| 91 } | 92 } |
| 92 | 93 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void HTMLParserScheduler::forceResumeAfterYield() { | 145 void HTMLParserScheduler::forceResumeAfterYield() { |
| 145 DCHECK(!m_cancellableContinueParseTaskHandle.isActive()); | 146 DCHECK(!m_cancellableContinueParseTaskHandle.isActive()); |
| 146 m_isSuspendedWithActiveTimer = true; | 147 m_isSuspendedWithActiveTimer = true; |
| 147 } | 148 } |
| 148 | 149 |
| 149 void HTMLParserScheduler::continueParsing() { | 150 void HTMLParserScheduler::continueParsing() { |
| 150 m_parser->resumeParsingAfterYield(); | 151 m_parser->resumeParsingAfterYield(); |
| 151 } | 152 } |
| 152 | 153 |
| 153 } // namespace blink | 154 } // namespace blink |
| OLD | NEW |