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

Side by Side Diff: third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.h

Issue 2740503002: Remove timeout from idle time spell checker's cold mode request (Closed)
Patch Set: Created 3 years, 9 months 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IdleSpellCheckCallback_h 5 #ifndef IdleSpellCheckCallback_h
6 #define IdleSpellCheckCallback_h 6 #define IdleSpellCheckCallback_h
7 7
8 #include "core/dom/IdleRequestCallback.h" 8 #include "core/dom/IdleRequestCallback.h"
9 #include "core/dom/SynchronousMutationObserver.h" 9 #include "core/dom/SynchronousMutationObserver.h"
10 #include "core/editing/EphemeralRange.h" 10 #include "core/editing/EphemeralRange.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 private: 67 private:
68 explicit IdleSpellCheckCallback(LocalFrame&); 68 explicit IdleSpellCheckCallback(LocalFrame&);
69 void handleEvent(IdleDeadline*) override; 69 void handleEvent(IdleDeadline*) override;
70 70
71 LocalFrame& frame() const { return *m_frame; } 71 LocalFrame& frame() const { return *m_frame; }
72 72
73 // Returns whether spell checking is globally enabled. 73 // Returns whether spell checking is globally enabled.
74 bool isSpellCheckingEnabled() const; 74 bool isSpellCheckingEnabled() const;
75 75
76 // Calls requestIdleCallback with this IdleSpellCheckCallback. 76 // Calls requestIdleCallback with this IdleSpellCheckCallback.
77 void requestInvocation(); 77 void requestInvocation(int timeoutMS);
78 78
79 // Functions for hot mode. 79 // Functions for hot mode.
80 void hotModeInvocation(IdleDeadline*); 80 void hotModeInvocation(IdleDeadline*);
81 81
82 // Transit to ColdModeTimerStarted, if possible. Sets up a timer, and requests 82 // Transit to ColdModeTimerStarted, if possible. Sets up a timer, and requests
83 // cold mode invocation if no critical operation occurs before timer firing. 83 // cold mode invocation if no critical operation occurs before timer firing.
84 void setNeedsColdModeInvocation(); 84 void setNeedsColdModeInvocation();
85 85
86 // Functions for cold mode. 86 // Functions for cold mode.
87 void coldModeTimerFired(TimerBase*); 87 void coldModeTimerFired(TimerBase*);
88 void coldModeInvocation(IdleDeadline*); 88 void coldModeInvocation(IdleDeadline*);
89 bool coldModeFinishesFullDocument() const; 89 bool coldModeFinishesFullDocument() const;
90 90
91 // Implements |SynchronousMutationObserver|. 91 // Implements |SynchronousMutationObserver|.
92 void contextDestroyed(Document*) final; 92 void contextDestroyed(Document*) final;
93 93
94 State m_state; 94 State m_state;
95 int m_idleCallbackHandle; 95 int m_idleCallbackHandle;
96 mutable bool m_needsMoreColdModeInvocationForTesting; 96 mutable bool m_needsMoreColdModeInvocationForTesting;
97 const Member<LocalFrame> m_frame; 97 const Member<LocalFrame> m_frame;
98 uint64_t m_lastProcessedUndoStepSequence; 98 uint64_t m_lastProcessedUndoStepSequence;
99 TaskRunnerTimer<IdleSpellCheckCallback> m_coldModeTimer; 99 TaskRunnerTimer<IdleSpellCheckCallback> m_coldModeTimer;
100 }; 100 };
101 101
102 } // namespace blink 102 } // namespace blink
103 103
104 #endif // IdleSpellCheckCallback_h 104 #endif // IdleSpellCheckCallback_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698