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

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

Issue 2720663002: Revert of Implement complete lifecycle transition for IdleSpellCheckCallback (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.h
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.h b/third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.h
index db1e34d49f2b9e952e397da3c15dcdcc17755b47..7ddc2c4e392948fb656d778e54921844368ef91e 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.h
+++ b/third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.h
@@ -6,7 +6,6 @@
#define IdleSpellCheckCallback_h
#include "core/dom/IdleRequestCallback.h"
-#include "core/dom/SynchronousMutationObserver.h"
#include "platform/Timer.h"
namespace blink {
@@ -15,15 +14,36 @@
class SpellCheckRequester;
// Main class for the implementation of idle time spell checker.
-class CORE_EXPORT IdleSpellCheckCallback final
- : public IdleRequestCallback,
- public SynchronousMutationObserver {
- DISALLOW_COPY_AND_ASSIGN(IdleSpellCheckCallback);
- USING_GARBAGE_COLLECTED_MIXIN(IdleSpellCheckCallback);
-
+class CORE_EXPORT IdleSpellCheckCallback final : public IdleRequestCallback {
public:
static IdleSpellCheckCallback* create(LocalFrame&);
~IdleSpellCheckCallback() override;
+
+ // Transit to HotModeRequested, if possible. Called by operations that need
+ // spell checker to follow up.
+ // TODO(xiaochengh): Add proper call sites.
+ void setNeedsHotModeInvocation();
+
+ // Transit to ColdModeTimerStarted, if possible. Sets up a timer, and requests
+ // cold mode invocation if no critical operation occurs before timer firing.
+ // TODO(xiaochengh): Add proper call sites.
+ void setNeedsColdModeInvocation();
+
+ // Cleans everything up and makes the callback inactive. Should be called when
+ // document is detached or spellchecking is globally disabled.
+ // TODO(xiaochengh): Add proper call sites.
+ void deactivate();
+
+ // Exposed for testing only.
+ SpellCheckRequester& spellCheckRequester() const;
+
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ explicit IdleSpellCheckCallback(LocalFrame&);
+ void handleEvent(IdleDeadline*) override;
+
+ LocalFrame& frame() const { return *m_frame; }
enum class State {
kInactive,
@@ -34,35 +54,6 @@
kInColdModeInvocation
};
- State state() const { return m_state; }
-
- // Transit to HotModeRequested, if possible. Called by operations that need
- // spell checker to follow up.
- void setNeedsInvocation();
-
- // Cleans everything up and makes the callback inactive. Should be called when
- // document is detached or spellchecking is globally disabled.
- void deactivate();
-
- void documentAttached(Document*);
-
- // Exposed for testing only.
- SpellCheckRequester& spellCheckRequester() const;
- void forceInvocationForTesting();
- void setNeedsMoreColdModeInvocationForTesting() {
- m_needsMoreColdModeInvocationForTesting = true;
- }
- void skipColdModeTimerForTesting();
- int idleCallbackHandle() const { return m_idleCallbackHandle; }
-
- DECLARE_VIRTUAL_TRACE();
-
- private:
- explicit IdleSpellCheckCallback(LocalFrame&);
- void handleEvent(IdleDeadline*) override;
-
- LocalFrame& frame() const { return *m_frame; }
-
// Returns whether spell checking is globally enabled.
bool isSpellCheckingEnabled() const;
@@ -72,21 +63,12 @@
// Functions for hot mode.
void hotModeInvocation(IdleDeadline*);
- // Transit to ColdModeTimerStarted, if possible. Sets up a timer, and requests
- // cold mode invocation if no critical operation occurs before timer firing.
- void setNeedsColdModeInvocation();
-
// Functions for cold mode.
void coldModeTimerFired(TimerBase*);
void coldModeInvocation(IdleDeadline*);
bool coldModeFinishesFullDocument() const;
- // Implements |SynchronousMutationObserver|.
- void contextDestroyed(Document*) final;
-
State m_state;
- int m_idleCallbackHandle;
- mutable bool m_needsMoreColdModeInvocationForTesting;
const Member<LocalFrame> m_frame;
TaskRunnerTimer<IdleSpellCheckCallback> m_coldModeTimer;

Powered by Google App Engine
This is Rietveld 408576698