Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: Source/core/html/parser/HTMLParserScheduler.h

Issue 673603002: Reland: Make the HTMLDocumentParser yield more aggressively (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698