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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 void HTMLParserScheduler::continueNextChunkTimerFired(Timer<HTMLParserScheduler>
* timer) | 88 void HTMLParserScheduler::continueNextChunkTimerFired(Timer<HTMLParserScheduler>
* timer) |
89 { | 89 { |
90 ASSERT_UNUSED(timer, timer == &m_continueNextChunkTimer); | 90 ASSERT_UNUSED(timer, timer == &m_continueNextChunkTimer); |
91 m_parser->resumeParsingAfterYield(); | 91 m_parser->resumeParsingAfterYield(); |
92 } | 92 } |
93 | 93 |
94 void HTMLParserScheduler::scheduleForResume() | 94 void HTMLParserScheduler::scheduleForResume() |
95 { | 95 { |
| 96 m_isSuspendedWithActiveTimer = false; |
96 m_continueNextChunkTimer.startOneShot(0, FROM_HERE); | 97 m_continueNextChunkTimer.startOneShot(0, FROM_HERE); |
97 } | 98 } |
98 | 99 |
99 void HTMLParserScheduler::suspend() | 100 void HTMLParserScheduler::suspend() |
100 { | 101 { |
101 ASSERT(!m_isSuspendedWithActiveTimer); | 102 ASSERT(!m_isSuspendedWithActiveTimer); |
102 if (!m_continueNextChunkTimer.isActive()) | 103 if (!m_continueNextChunkTimer.isActive()) |
103 return; | 104 return; |
104 m_isSuspendedWithActiveTimer = true; | 105 m_isSuspendedWithActiveTimer = true; |
105 m_continueNextChunkTimer.stop(); | 106 m_continueNextChunkTimer.stop(); |
106 } | 107 } |
107 | 108 |
108 void HTMLParserScheduler::resume() | 109 void HTMLParserScheduler::resume() |
109 { | 110 { |
110 ASSERT(!m_continueNextChunkTimer.isActive()); | 111 ASSERT(!m_continueNextChunkTimer.isActive()); |
111 if (!m_isSuspendedWithActiveTimer) | 112 if (!m_isSuspendedWithActiveTimer) |
112 return; | 113 return; |
113 m_isSuspendedWithActiveTimer = false; | 114 m_isSuspendedWithActiveTimer = false; |
114 m_continueNextChunkTimer.startOneShot(0, FROM_HERE); | 115 m_continueNextChunkTimer.startOneShot(0, FROM_HERE); |
115 } | 116 } |
116 | 117 |
117 } | 118 } |
OLD | NEW |