Title: [235175] trunk/Source/WebKit
Revision
235175
Author
dba...@webkit.org
Date
2018-08-22 09:46:22 -0700 (Wed, 22 Aug 2018)

Log Message

Cleanup: Add type alias for spell document tag
https://bugs.webkit.org/show_bug.cgi?id=188817

Reviewed by Simon Fraser.

* UIProcess/TextChecker.h:
* UIProcess/TextCheckerCompletion.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::~WebPageProxy):
(WebKit::WebPageProxy::spellDocumentTag):
* UIProcess/WebPageProxy.h: Also addressed FIXME comment and modernized the code to use a std::optional
while I am here.
* UIProcess/gtk/TextCheckerGtk.cpp:
(WebKit::TextChecker::uniqueSpellDocumentTag):
(WebKit::TextChecker::closeSpellDocumentWithTag):
(WebKit::TextChecker::checkSpellingOfString):
(WebKit::TextChecker::checkGrammarOfString):
(WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
(WebKit::TextChecker::updateSpellingUIWithGrammarString):
(WebKit::TextChecker::getGuessesForWord):
(WebKit::TextChecker::learnWord):
(WebKit::TextChecker::ignoreWord):
(WebKit::TextChecker::checkTextOfParagraph):
* UIProcess/ios/TextCheckerIOS.mm:
(WebKit::spellDocumentTagMap):
(WebKit::TextChecker::uniqueSpellDocumentTag):
(WebKit::TextChecker::closeSpellDocumentWithTag):
(WebKit::textCheckerFor):
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::checkSpellingOfString):
(WebKit::TextChecker::checkGrammarOfString):
(WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
(WebKit::TextChecker::updateSpellingUIWithGrammarString):
(WebKit::TextChecker::getGuessesForWord):
(WebKit::TextChecker::learnWord):
(WebKit::TextChecker::ignoreWord):
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::uniqueSpellDocumentTag):
(WebKit::TextChecker::closeSpellDocumentWithTag):
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::checkSpellingOfString):
(WebKit::TextChecker::checkGrammarOfString):
(WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
(WebKit::TextChecker::updateSpellingUIWithGrammarString):
(WebKit::TextChecker::getGuessesForWord):
(WebKit::TextChecker::learnWord):
(WebKit::TextChecker::ignoreWord):
* UIProcess/win/TextCheckerWin.cpp:
(WebKit::TextChecker::uniqueSpellDocumentTag):
(WebKit::TextChecker::closeSpellDocumentWithTag):
(WebKit::TextChecker::checkSpellingOfString):
(WebKit::TextChecker::checkGrammarOfString):
(WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
(WebKit::TextChecker::updateSpellingUIWithGrammarString):
(WebKit::TextChecker::getGuessesForWord):
(WebKit::TextChecker::learnWord):
(WebKit::TextChecker::ignoreWord):
(WebKit::TextChecker::checkTextOfParagraph):
* UIProcess/wpe/TextCheckerWPE.cpp:
(WebKit::TextChecker::uniqueSpellDocumentTag):
(WebKit::TextChecker::closeSpellDocumentWithTag):
(WebKit::TextChecker::checkSpellingOfString):
(WebKit::TextChecker::checkGrammarOfString):
(WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
(WebKit::TextChecker::updateSpellingUIWithGrammarString):
(WebKit::TextChecker::getGuessesForWord):
(WebKit::TextChecker::learnWord):
(WebKit::TextChecker::ignoreWord):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (235174 => 235175)


--- trunk/Source/WebKit/ChangeLog	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/ChangeLog	2018-08-22 16:46:22 UTC (rev 235175)
@@ -1,3 +1,74 @@
+2018-08-22  Daniel Bates  <daba...@apple.com>
+
+        Cleanup: Add type alias for spell document tag
+        https://bugs.webkit.org/show_bug.cgi?id=188817
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/TextChecker.h:
+        * UIProcess/TextCheckerCompletion.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::~WebPageProxy):
+        (WebKit::WebPageProxy::spellDocumentTag):
+        * UIProcess/WebPageProxy.h: Also addressed FIXME comment and modernized the code to use a std::optional
+        while I am here.
+        * UIProcess/gtk/TextCheckerGtk.cpp:
+        (WebKit::TextChecker::uniqueSpellDocumentTag):
+        (WebKit::TextChecker::closeSpellDocumentWithTag):
+        (WebKit::TextChecker::checkSpellingOfString):
+        (WebKit::TextChecker::checkGrammarOfString):
+        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
+        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
+        (WebKit::TextChecker::getGuessesForWord):
+        (WebKit::TextChecker::learnWord):
+        (WebKit::TextChecker::ignoreWord):
+        (WebKit::TextChecker::checkTextOfParagraph):
+        * UIProcess/ios/TextCheckerIOS.mm:
+        (WebKit::spellDocumentTagMap):
+        (WebKit::TextChecker::uniqueSpellDocumentTag):
+        (WebKit::TextChecker::closeSpellDocumentWithTag):
+        (WebKit::textCheckerFor):
+        (WebKit::TextChecker::checkTextOfParagraph):
+        (WebKit::TextChecker::checkSpellingOfString):
+        (WebKit::TextChecker::checkGrammarOfString):
+        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
+        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
+        (WebKit::TextChecker::getGuessesForWord):
+        (WebKit::TextChecker::learnWord):
+        (WebKit::TextChecker::ignoreWord):
+        * UIProcess/mac/TextCheckerMac.mm:
+        (WebKit::TextChecker::uniqueSpellDocumentTag):
+        (WebKit::TextChecker::closeSpellDocumentWithTag):
+        (WebKit::TextChecker::checkTextOfParagraph):
+        (WebKit::TextChecker::checkSpellingOfString):
+        (WebKit::TextChecker::checkGrammarOfString):
+        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
+        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
+        (WebKit::TextChecker::getGuessesForWord):
+        (WebKit::TextChecker::learnWord):
+        (WebKit::TextChecker::ignoreWord):
+        * UIProcess/win/TextCheckerWin.cpp:
+        (WebKit::TextChecker::uniqueSpellDocumentTag):
+        (WebKit::TextChecker::closeSpellDocumentWithTag):
+        (WebKit::TextChecker::checkSpellingOfString):
+        (WebKit::TextChecker::checkGrammarOfString):
+        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
+        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
+        (WebKit::TextChecker::getGuessesForWord):
+        (WebKit::TextChecker::learnWord):
+        (WebKit::TextChecker::ignoreWord):
+        (WebKit::TextChecker::checkTextOfParagraph):
+        * UIProcess/wpe/TextCheckerWPE.cpp:
+        (WebKit::TextChecker::uniqueSpellDocumentTag):
+        (WebKit::TextChecker::closeSpellDocumentWithTag):
+        (WebKit::TextChecker::checkSpellingOfString):
+        (WebKit::TextChecker::checkGrammarOfString):
+        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
+        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
+        (WebKit::TextChecker::getGuessesForWord):
+        (WebKit::TextChecker::learnWord):
+        (WebKit::TextChecker::ignoreWord):
+
 2018-08-22  Antti Koivisto  <an...@apple.com>
 
         Use OptionSet for NetworkCache::Storage::TraverseFlags

Modified: trunk/Source/WebKit/UIProcess/TextChecker.h (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/TextChecker.h	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/TextChecker.h	2018-08-22 16:46:22 UTC (rev 235175)
@@ -34,6 +34,8 @@
 class WebPageProxy;
 struct TextCheckerState;
 
+using SpellDocumentTag = int64_t;
+    
 class TextChecker {
 public:
     static const TextCheckerState& state();
@@ -71,20 +73,21 @@
 
     static void continuousSpellCheckingEnabledStateChanged(bool);
     static void grammarCheckingEnabledStateChanged(bool);
-    static int64_t uniqueSpellDocumentTag(WebPageProxy*);
-    static void closeSpellDocumentWithTag(int64_t);
+    
+    static SpellDocumentTag uniqueSpellDocumentTag(WebPageProxy*);
+    static void closeSpellDocumentWithTag(SpellDocumentTag);
 #if USE(UNIFIED_TEXT_CHECKING)
-    static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(int64_t spellDocumentTag, StringView, int32_t insertionPoint, OptionSet<WebCore::TextCheckingType>, bool initialCapitalizationEnabled);
+    static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(SpellDocumentTag, StringView, int32_t insertionPoint, OptionSet<WebCore::TextCheckingType>, bool initialCapitalizationEnabled);
 #endif
-    static void checkSpellingOfString(int64_t spellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength);
-    static void checkGrammarOfString(int64_t spellDocumentTag, StringView text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
+    static void checkSpellingOfString(SpellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength);
+    static void checkGrammarOfString(SpellDocumentTag, StringView text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
     static bool spellingUIIsShowing();
     static void toggleSpellingUIIsShowing();
-    static void updateSpellingUIWithMisspelledWord(int64_t spellDocumentTag, const String& misspelledWord);
-    static void updateSpellingUIWithGrammarString(int64_t spellDocumentTag, const String& badGrammarPhrase, const WebCore::GrammarDetail&);
-    static void getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled);
-    static void learnWord(int64_t spellDocumentTag, const String& word);
-    static void ignoreWord(int64_t spellDocumentTag, const String& word);
+    static void updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& misspelledWord);
+    static void updateSpellingUIWithGrammarString(SpellDocumentTag, const String& badGrammarPhrase, const WebCore::GrammarDetail&);
+    static void getGuessesForWord(SpellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled);
+    static void learnWord(SpellDocumentTag, const String& word);
+    static void ignoreWord(SpellDocumentTag, const String& word);
     static void requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t insertionPoint);
 };
 

Modified: trunk/Source/WebKit/UIProcess/TextCheckerCompletion.h (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/TextCheckerCompletion.h	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/TextCheckerCompletion.h	2018-08-22 16:46:22 UTC (rev 235175)
@@ -36,7 +36,7 @@
     static Ref<TextCheckerCompletion> create(uint64_t requestID, const WebCore::TextCheckingRequestData&, WebPageProxy*);
 
     const WebCore::TextCheckingRequestData& textCheckingRequestData() const;
-    int64_t spellDocumentTag();
+    SpellDocumentTag spellDocumentTag();
     void didFinishCheckingText(const Vector<WebCore::TextCheckingResult>&) const;
     void didCancelCheckingText() const;
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-08-22 16:46:22 UTC (rev 235175)
@@ -489,8 +489,8 @@
 
     WebProcessPool::statistics().wkPageCount--;
 
-    if (m_hasSpellDocumentTag)
-        TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
+    if (m_spellDocumentTag)
+        TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag.value());
 
     m_preferences->removePage(*this);
     m_pageGroup->removePage(this);
@@ -5334,14 +5334,11 @@
     return m_editCommandSet.find(command) != m_editCommandSet.end();
 }
 
-int64_t WebPageProxy::spellDocumentTag()
+SpellDocumentTag WebPageProxy::spellDocumentTag()
 {
-    if (!m_hasSpellDocumentTag) {
+    if (!m_spellDocumentTag)
         m_spellDocumentTag = TextChecker::uniqueSpellDocumentTag(this);
-        m_hasSpellDocumentTag = true;
-    }
-
-    return m_spellDocumentTag;
+    return m_spellDocumentTag.value();
 }
 
 #if USE(UNIFIED_TEXT_CHECKING)

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-08-22 16:46:22 UTC (rev 235175)
@@ -323,6 +323,8 @@
 typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
 #endif
 
+using SpellDocumentTag = int64_t;
+
 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
 #if ENABLE(INPUT_TYPE_COLOR)
     , public WebColorPicker::Client
@@ -1119,7 +1121,8 @@
 
     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
 
-    int64_t spellDocumentTag();
+    SpellDocumentTag spellDocumentTag();
+
     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
     void didCancelCheckingText(uint64_t requestID);
 
@@ -2087,8 +2090,6 @@
     WebCore::Color m_backgroundColor { WebCore::Color::white };
 #endif
 
-    int64_t m_spellDocumentTag { 0 }; // FIXME: use std::optional<>.
-    bool m_hasSpellDocumentTag { false }; 
     unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
 
     bool m_mainFrameHasCustomContentProvider { false };
@@ -2225,6 +2226,8 @@
     std::unique_ptr<DisplayLink> m_displayLink;
 #endif
 
+    std::optional<SpellDocumentTag> m_spellDocumentTag;
+
     std::optional<MonotonicTime> m_pageLoadStart;
 
     // FIXME: Support more than one suspended page per WebPageProxy,

Modified: trunk/Source/WebKit/UIProcess/gtk/TextCheckerGtk.cpp (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/gtk/TextCheckerGtk.cpp	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/gtk/TextCheckerGtk.cpp	2018-08-22 16:46:22 UTC (rev 235175)
@@ -127,16 +127,16 @@
 #endif
 }
 
-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
 {
-    return 0;
+    return { };
 }
 
-void TextChecker::closeSpellDocumentWithTag(int64_t /* tag */)
+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag)
 {
 }
 
-void TextChecker::checkSpellingOfString(int64_t /* spellDocumentTag */, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength)
+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength)
 {
 #if ENABLE(SPELLCHECK)
     misspellingLocation = -1;
@@ -149,7 +149,7 @@
 #endif
 }
 
-void TextChecker::checkGrammarOfString(int64_t /* spellDocumentTag */, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */)
+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */)
 {
 }
 
@@ -162,15 +162,15 @@
 {
 }
 
-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t /* spellDocumentTag */, const String& /* misspelledWord */)
+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& /* misspelledWord */)
 {
 }
 
-void TextChecker::updateSpellingUIWithGrammarString(int64_t /* spellDocumentTag */, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */)
+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */)
 {
 }
 
-void TextChecker::getGuessesForWord(int64_t /* spellDocumentTag */, const String& word, const String& /* context */, int32_t /* insertionPoint */, Vector<String>& guesses, bool)
+void TextChecker::getGuessesForWord(SpellDocumentTag, const String& word, const String& /* context */, int32_t /* insertionPoint */, Vector<String>& guesses, bool)
 {
 #if ENABLE(SPELLCHECK)
     guesses = TextCheckerEnchant::singleton().getGuessesForWord(word);
@@ -180,7 +180,7 @@
 #endif
 }
 
-void TextChecker::learnWord(int64_t /* spellDocumentTag */, const String& word)
+void TextChecker::learnWord(SpellDocumentTag, const String& word)
 {
 #if ENABLE(SPELLCHECK)
     TextCheckerEnchant::singleton().learnWord(word);
@@ -189,7 +189,7 @@
 #endif
 }
 
-void TextChecker::ignoreWord(int64_t /* spellDocumentTag */, const String& word)
+void TextChecker::ignoreWord(SpellDocumentTag, const String& word)
 {
 #if ENABLE(SPELLCHECK)
     TextCheckerEnchant::singleton().ignoreWord(word);
@@ -240,7 +240,7 @@
 #endif
 
 #if USE(UNIFIED_TEXT_CHECKING)
-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool)
+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool)
 {
     UNUSED_PARAM(insertionPoint);
 #if ENABLE(SPELLCHECK)

Modified: trunk/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm	2018-08-22 16:46:22 UTC (rev 235175)
@@ -146,25 +146,25 @@
 
 #if USE(UNIFIED_TEXT_CHECKING)
 
-static HashMap<int64_t, RetainPtr<UITextChecker>>& spellDocumentTagMap()
+static HashMap<SpellDocumentTag, RetainPtr<UITextChecker>>& spellDocumentTagMap()
 {
-    static NeverDestroyed<HashMap<int64_t, RetainPtr<UITextChecker>>> tagMap;
+    static NeverDestroyed<HashMap<SpellDocumentTag, RetainPtr<UITextChecker>>> tagMap;
     return tagMap;
 }
 
 #endif
 
-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
 {
 #if USE(UNIFIED_TEXT_CHECKING)
-    static int64_t nextSpellDocumentTag;
+    static SpellDocumentTag nextSpellDocumentTag;
     return ++nextSpellDocumentTag;
 #else
-    return 0;
+    return { };
 #endif
 }
 
-void TextChecker::closeSpellDocumentWithTag(int64_t spellDocumentTag)
+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag spellDocumentTag)
 {
 #if USE(UNIFIED_TEXT_CHECKING)
     spellDocumentTagMap().remove(spellDocumentTag);
@@ -175,7 +175,7 @@
 
 #if USE(UNIFIED_TEXT_CHECKING)
 
-static RetainPtr<UITextChecker> textCheckerFor(int64_t spellDocumentTag)
+static RetainPtr<UITextChecker> textCheckerFor(SpellDocumentTag spellDocumentTag)
 {
     auto addResult = spellDocumentTagMap().add(spellDocumentTag, nullptr);
     if (addResult.isNewEntry)
@@ -183,7 +183,7 @@
     return addResult.iterator->value;
 }
 
-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView text, int32_t /* insertionPoint */, OptionSet<TextCheckingType> checkingTypes, bool /* initialCapitalizationEnabled */)
+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag spellDocumentTag, StringView text, int32_t /* insertionPoint */, OptionSet<TextCheckingType> checkingTypes, bool /* initialCapitalizationEnabled */)
 {
     Vector<TextCheckingResult> results;
     if (!checkingTypes.contains(TextCheckingType::Spelling))
@@ -221,13 +221,13 @@
 
 #endif
 
-void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&)
+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&)
 {
     // iOS uses checkTextOfParagraph() instead.
     notImplemented();
 }
 
-void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
 {
     // iOS uses checkTextOfParagraph() instead.
     notImplemented();
@@ -244,27 +244,27 @@
     notImplemented();
 }
 
-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&)
+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String&)
 {
     notImplemented();
 }
 
-void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&)
+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String&, const GrammarDetail&)
 {
     notImplemented();
 }
 
-void TextChecker::getGuessesForWord(int64_t, const String&, const String&, int32_t, Vector<String>&, bool)
+void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String&, int32_t, Vector<String>&, bool)
 {
     notImplemented();
 }
 
-void TextChecker::learnWord(int64_t, const String&)
+void TextChecker::learnWord(SpellDocumentTag, const String&)
 {
     notImplemented();
 }
 
-void TextChecker::ignoreWord(int64_t, const String&)
+void TextChecker::ignoreWord(SpellDocumentTag, const String&)
 {
     notImplemented();
 }

Modified: trunk/Source/WebKit/UIProcess/mac/TextCheckerMac.mm (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/mac/TextCheckerMac.mm	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/mac/TextCheckerMac.mm	2018-08-22 16:46:22 UTC (rev 235175)
@@ -314,12 +314,12 @@
     textCheckerState.isGrammarCheckingEnabled = enabled;
 }
 
-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
 {
     return [NSSpellChecker uniqueSpellDocumentTag];
 }
 
-void TextChecker::closeSpellDocumentWithTag(int64_t tag)
+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag tag)
 {
     [[NSSpellChecker sharedSpellChecker] closeSpellDocumentWithTag:tag];
 }
@@ -326,7 +326,7 @@
 
 #if USE(UNIFIED_TEXT_CHECKING)
 
-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool initialCapitalizationEnabled)
+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool initialCapitalizationEnabled)
 {
     Vector<TextCheckingResult> results;
 
@@ -422,13 +422,13 @@
 
 #endif // USE(UNIFIED_TEXT_CHECKING)
 
-void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&)
+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&)
 {
     // Mac uses checkTextOfParagraph instead.
     notImplemented();
 }
 
-void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
 {
     // Mac uses checkTextOfParagraph instead.
     notImplemented();
@@ -448,12 +448,12 @@
         [spellingPanel orderFront:nil];
 }
 
-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String& misspelledWord)
+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& misspelledWord)
 {
     [[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithMisspelledWord:misspelledWord];
 }
 
-void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
 {
     RetainPtr<NSMutableArray> corrections = adoptNS([[NSMutableArray alloc] init]);
     for (size_t i = 0; i < grammarDetail.guesses.size(); ++i) {
@@ -468,7 +468,7 @@
     [[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithGrammarString:badGrammarPhrase detail:grammarDetailDict.get()];
 }
 
-void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled)
+void TextChecker::getGuessesForWord(SpellDocumentTag spellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled)
 {
     NSString* language = nil;
     NSOrthography* orthography = nil;
@@ -490,12 +490,12 @@
         guesses.append(guess);
 }
 
-void TextChecker::learnWord(int64_t, const String& word)
+void TextChecker::learnWord(SpellDocumentTag, const String& word)
 {
     [[NSSpellChecker sharedSpellChecker] learnWord:word];
 }
 
-void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word)
+void TextChecker::ignoreWord(SpellDocumentTag spellDocumentTag, const String& word)
 {
     [[NSSpellChecker sharedSpellChecker] ignoreWord:word inSpellDocumentWithTag:spellDocumentTag];
 }

Modified: trunk/Source/WebKit/UIProcess/win/TextCheckerWin.cpp (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/win/TextCheckerWin.cpp	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/win/TextCheckerWin.cpp	2018-08-22 16:46:22 UTC (rev 235175)
@@ -78,20 +78,20 @@
 {
 }
 
-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
 {
-    return 0;
+    return { };
 }
 
-void TextChecker::closeSpellDocumentWithTag(int64_t)
+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag)
 {
 }
 
-void TextChecker::checkSpellingOfString(int64_t /* spellDocumentTag */, StringView, int32_t&, int32_t&)
+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&)
 {
 }
 
-void TextChecker::checkGrammarOfString(int64_t /* spellDocumentTag */, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */)
+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */)
 {
 }
 
@@ -104,23 +104,23 @@
 {
 }
 
-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t /* spellDocumentTag */, const String& /* misspelledWord */)
+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& /* misspelledWord */)
 {
 }
 
-void TextChecker::updateSpellingUIWithGrammarString(int64_t /* spellDocumentTag */, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */)
+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */)
 {
 }
 
-void TextChecker::getGuessesForWord(int64_t /* spellDocumentTag */, const String&, const String& /* context */, int32_t /* insertionPoint */, Vector<String>&, bool)
+void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String& /* context */, int32_t /* insertionPoint */, Vector<String>&, bool)
 {
 }
 
-void TextChecker::learnWord(int64_t /* spellDocumentTag */, const String&)
+void TextChecker::learnWord(SpellDocumentTag, const String&)
 {
 }
 
-void TextChecker::ignoreWord(int64_t /* spellDocumentTag */, const String&)
+void TextChecker::ignoreWord(SpellDocumentTag, const String&)
 {
 }
 
@@ -130,7 +130,7 @@
 
 #if USE(UNIFIED_TEXT_CHECKING)
 
-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t, StringView, int32_t, OptionSet<TextCheckingType>, bool)
+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag, StringView, int32_t, OptionSet<TextCheckingType>, bool)
 {
     return { };
 }

Modified: trunk/Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp (235174 => 235175)


--- trunk/Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp	2018-08-22 16:24:39 UTC (rev 235174)
+++ trunk/Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp	2018-08-22 16:46:22 UTC (rev 235175)
@@ -76,23 +76,23 @@
     notImplemented();
 }
 
-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
 {
     notImplemented();
     return false;
 }
 
-void TextChecker::closeSpellDocumentWithTag(int64_t)
+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag)
 {
     notImplemented();
 }
 
-void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&)
+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&)
 {
     notImplemented();
 }
 
-void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
 {
     notImplemented();
 }
@@ -108,27 +108,27 @@
     notImplemented();
 }
 
-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&)
+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String&)
 {
     notImplemented();
 }
 
-void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&)
+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String&, const GrammarDetail&)
 {
     notImplemented();
 }
 
-void TextChecker::getGuessesForWord(int64_t, const String&, const String&, int32_t, Vector<String>&, bool)
+void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String&, int32_t, Vector<String>&, bool)
 {
     notImplemented();
 }
 
-void TextChecker::learnWord(int64_t, const String&)
+void TextChecker::learnWord(SpellDocumentTag, const String&)
 {
     notImplemented();
 }
 
-void TextChecker::ignoreWord(int64_t, const String&)
+void TextChecker::ignoreWord(SpellDocumentTag, const String&)
 {
     notImplemented();
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to