| 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 WTF_MAKE_NONCOPYABLE(HTMLParserScheduler); WTF_MAKE_FAST_ALLOCATED; | 71 WTF_MAKE_NONCOPYABLE(HTMLParserScheduler); WTF_MAKE_FAST_ALLOCATED; |
| 72 public: | 72 public: |
| 73 static PassOwnPtr<HTMLParserScheduler> create(HTMLDocumentParser* parser) | 73 static PassOwnPtr<HTMLParserScheduler> create(HTMLDocumentParser* parser) |
| 74 { | 74 { |
| 75 return adoptPtr(new HTMLParserScheduler(parser)); | 75 return adoptPtr(new HTMLParserScheduler(parser)); |
| 76 } | 76 } |
| 77 ~HTMLParserScheduler(); | 77 ~HTMLParserScheduler(); |
| 78 | 78 |
| 79 bool isScheduledForResume() const { return m_isSuspendedWithActiveTimer || m
_continueNextChunkTimer.isActive(); } | 79 bool isScheduledForResume() const { return m_isSuspendedWithActiveTimer || m
_continueNextChunkTimer.isActive(); } |
| 80 | 80 |
| 81 void scheduleForResume(); |
| 81 bool yieldIfNeeded(const SpeculationsPumpSession&, bool startingScript); | 82 bool yieldIfNeeded(const SpeculationsPumpSession&, bool startingScript); |
| 82 | 83 |
| 83 void suspend(); | 84 void suspend(); |
| 84 void resume(); | 85 void resume(); |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 explicit HTMLParserScheduler(HTMLDocumentParser*); | 88 explicit HTMLParserScheduler(HTMLDocumentParser*); |
| 88 | 89 |
| 89 bool shouldYield(const SpeculationsPumpSession&, bool startingScript) const; | 90 bool shouldYield(const SpeculationsPumpSession&, bool startingScript) const; |
| 90 void scheduleForResume(); | |
| 91 void continueNextChunkTimerFired(Timer<HTMLParserScheduler>*); | 91 void continueNextChunkTimerFired(Timer<HTMLParserScheduler>*); |
| 92 | 92 |
| 93 HTMLDocumentParser* m_parser; | 93 HTMLDocumentParser* m_parser; |
| 94 | 94 |
| 95 Timer<HTMLParserScheduler> m_continueNextChunkTimer; | 95 Timer<HTMLParserScheduler> m_continueNextChunkTimer; |
| 96 bool m_isSuspendedWithActiveTimer; | 96 bool m_isSuspendedWithActiveTimer; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } | 99 } |
| 100 | 100 |
| 101 #endif | 101 #endif |
| OLD | NEW |