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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2795113002: Move ownership of TextCheckerClientImpl to WebLocalFrameImpl (Closed)
Patch Set: Mon Apr 3 18:57:07 PDT 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
index e26740a836c32da813eb5152f1c4237bccd5ca4b..2e50a2db8a632948142cef7c565a175bf95380a9 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -108,8 +108,15 @@ SpellCheckerClient& SpellChecker::spellCheckerClient() const {
return emptySpellCheckerClient();
}
+static TextCheckerClient& emptyTextCheckerClient() {
+ DEFINE_STATIC_LOCAL(EmptyTextCheckerClient, client, ());
+ return client;
+}
+
TextCheckerClient& SpellChecker::textChecker() const {
- return spellCheckerClient().textChecker();
+ if (TextCheckerClient* textChecker = frame().client()->textCheckerClient())
+ return *textChecker;
+ return emptyTextCheckerClient();
}
SpellChecker::SpellChecker(LocalFrame& frame)

Powered by Google App Engine
This is Rietveld 408576698