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

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

Issue 2714113003: Move ownership of IdleSpellCheckCallback from LocalFrame to SpellChecker (Closed)
Patch Set: Fri Feb 24 11:06:25 PST 2017 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "platform/Timer.h" 9 #include "platform/Timer.h"
10 10
(...skipping 19 matching lines...) Expand all
30 void setNeedsColdModeInvocation(); 30 void setNeedsColdModeInvocation();
31 31
32 // Cleans everything up and makes the callback inactive. Should be called when 32 // Cleans everything up and makes the callback inactive. Should be called when
33 // document is detached or spellchecking is globally disabled. 33 // document is detached or spellchecking is globally disabled.
34 // TODO(xiaochengh): Add proper call sites. 34 // TODO(xiaochengh): Add proper call sites.
35 void deactivate(); 35 void deactivate();
36 36
37 // Exposed for testing only. 37 // Exposed for testing only.
38 SpellCheckRequester& spellCheckRequester() const; 38 SpellCheckRequester& spellCheckRequester() const;
39 39
40 // The leak detector will report leaks should queued requests be posted
41 // while it GCs repeatedly, as the requests keep their associated element
42 // alive.
43 //
44 // Hence allow the leak detector to effectively stop the spell checker to
45 // ensure leak reporting stability.
46 void prepareForLeakDetection();
47
48 DECLARE_VIRTUAL_TRACE(); 40 DECLARE_VIRTUAL_TRACE();
49 41
50 private: 42 private:
51 explicit IdleSpellCheckCallback(LocalFrame&); 43 explicit IdleSpellCheckCallback(LocalFrame&);
52 void handleEvent(IdleDeadline*) override; 44 void handleEvent(IdleDeadline*) override;
53 45
54 LocalFrame& frame() const { return *m_frame; } 46 LocalFrame& frame() const { return *m_frame; }
55 47
56 enum class State { 48 enum class State {
57 kInactive, 49 kInactive,
(...skipping 20 matching lines...) Expand all
78 70
79 State m_state; 71 State m_state;
80 const Member<LocalFrame> m_frame; 72 const Member<LocalFrame> m_frame;
81 73
82 TaskRunnerTimer<IdleSpellCheckCallback> m_coldModeTimer; 74 TaskRunnerTimer<IdleSpellCheckCallback> m_coldModeTimer;
83 }; 75 };
84 76
85 } // namespace blink 77 } // namespace blink
86 78
87 #endif // IdleSpellCheckCallback_h 79 #endif // IdleSpellCheckCallback_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698