[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

andersca at apple.com andersca at apple.com
Fri Jan 21 14:55:37 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 190ba930015533f916b42006872206efe7edd40e
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 4 22:41:52 2011 +0000

    2011-01-04  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Sam Weinig.
    
            Send over text checker state to the web process
            https://bugs.webkit.org/show_bug.cgi?id=51896
    
            * Platform/CoreIPC/Arguments.h:
            Remove 'const' from the argument, this matches all the other Arguments classes.
    
            * Shared/TextCheckerState.h: Added.
            New class with text checker state.
    
            * Shared/WebProcessCreationParameters.cpp:
            (WebKit::WebProcessCreationParameters::encode):
            (WebKit::WebProcessCreationParameters::decode):
            * Shared/WebProcessCreationParameters.h:
            Add textCheckerState.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView validateUserInterfaceItem:]):
            (-[WKView toggleContinuousSpellChecking:]):
            (-[WKView toggleGrammarChecking:]):
            (-[WKView toggleAutomaticSpellingCorrection:]):
            Get the needed flags from the text checker state.
    
            * UIProcess/TextChecker.h:
            Add state() function, remove getters.
    
            * UIProcess/WebContext.cpp:
            (WebKit::WebContext::ensureWebProcess):
            Initialize the text checker state.
    
            * UIProcess/WebProcessProxy.cpp:
            (WebKit::WebProcessProxy::updateTextCheckerState):
            Send the SetTextCheckerState message to the web process.
    
            * UIProcess/mac/TextCheckerMac.mm:
            (WebKit::initializeState):
            Initialize the state from the user defaults.
    
            (WebKit::TextChecker::state):
            Return the state.
    
            (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
            (WebKit::TextChecker::setGrammarCheckingEnabled):
            (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
            Make sure to write the new state.
    
            * UIProcess/qt/TextCheckerQt.cpp:
            (WebKit::TextChecker::state):
            * UIProcess/win/TextCheckerWin.cpp:
            (WebKit::TextChecker::state):
            Add stubs.
    
            * WebKit2.xcodeproj/project.pbxproj:
            Add TextCheckerState.h.
    
            * WebProcess/WebProcess.cpp:
            (WebKit::WebProcess::WebProcess):
            Initialize m_textCheckerState.
    
            (WebKit::WebProcess::setTextCheckerState):
            Update.
    
            * WebProcess/WebProcess.messages.in:
            Add SetTextCheckerState message.
    
            * win/WebKit2.vcproj:
            Add TextCheckerState.h.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75010 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 81721cd..86cb135 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,74 @@
+2011-01-04  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Send over text checker state to the web process
+        https://bugs.webkit.org/show_bug.cgi?id=51896
+
+        * Platform/CoreIPC/Arguments.h:
+        Remove 'const' from the argument, this matches all the other Arguments classes.
+
+        * Shared/TextCheckerState.h: Added.
+        New class with text checker state.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        Add textCheckerState.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView validateUserInterfaceItem:]):        
+        (-[WKView toggleContinuousSpellChecking:]):
+        (-[WKView toggleGrammarChecking:]):
+        (-[WKView toggleAutomaticSpellingCorrection:]):
+        Get the needed flags from the text checker state.
+
+        * UIProcess/TextChecker.h:
+        Add state() function, remove getters.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::ensureWebProcess):
+        Initialize the text checker state.
+
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::updateTextCheckerState):
+        Send the SetTextCheckerState message to the web process.
+
+        * UIProcess/mac/TextCheckerMac.mm:
+        (WebKit::initializeState):
+        Initialize the state from the user defaults.
+
+        (WebKit::TextChecker::state):
+        Return the state.
+
+        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
+        (WebKit::TextChecker::setGrammarCheckingEnabled):
+        (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
+        Make sure to write the new state.
+        
+        * UIProcess/qt/TextCheckerQt.cpp:
+        (WebKit::TextChecker::state):
+        * UIProcess/win/TextCheckerWin.cpp:
+        (WebKit::TextChecker::state):
+        Add stubs.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add TextCheckerState.h.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess):
+        Initialize m_textCheckerState.
+
+        (WebKit::WebProcess::setTextCheckerState):
+        Update.
+
+        * WebProcess/WebProcess.messages.in:
+        Add SetTextCheckerState message.
+
+        * win/WebKit2.vcproj:
+        Add TextCheckerState.h.
+
 2011-01-04  Brady Eidson  <beidson at apple.com>
 
         Rubberstamped by Anders Carlsson.
diff --git a/WebKit2/Platform/CoreIPC/Arguments.h b/WebKit2/Platform/CoreIPC/Arguments.h
index 9ccd83c..ba7c7e8 100644
--- a/WebKit2/Platform/CoreIPC/Arguments.h
+++ b/WebKit2/Platform/CoreIPC/Arguments.h
@@ -56,7 +56,7 @@ inline Arguments0 Out()
 }
 
 template<typename T1> struct Arguments1 {
-    typedef Arguments1<typename WTF::RemoveReference<T1>::Type> ValueType;
+    typedef Arguments1<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type> ValueType;
 
     Arguments1()
     {
diff --git a/WebKit2/Shared/TextCheckerState.h b/WebKit2/Shared/TextCheckerState.h
new file mode 100644
index 0000000..d17ba3f
--- /dev/null
+++ b/WebKit2/Shared/TextCheckerState.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TextCheckerState_h
+#define TextCheckerState_h
+
+#include "ArgumentCoders.h"
+
+namespace WebKit {
+
+struct TextCheckerState {
+    bool isContinuousSpellCheckingEnabled;
+    bool isGrammarCheckingEnabled;
+
+#if PLATFORM(MAC)
+    bool isAutomaticSpellingCorrectionEnabled;
+#endif
+};
+
+} // namespace WebKit
+
+namespace CoreIPC {
+template<> struct ArgumentCoder<WebKit::TextCheckerState> : SimpleArgumentCoder<WebKit::TextCheckerState> { };
+};
+
+#endif // TextCheckerState_h
diff --git a/WebKit2/Shared/WebProcessCreationParameters.cpp b/WebKit2/Shared/WebProcessCreationParameters.cpp
index 72f601d..3c770ed 100644
--- a/WebKit2/Shared/WebProcessCreationParameters.cpp
+++ b/WebKit2/Shared/WebProcessCreationParameters.cpp
@@ -54,6 +54,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
     encoder->encode(shouldTrackVisitedLinks);
     encoder->encode(shouldAlwaysUseComplexTextCodePath);
     encoder->encode(languageCode);
+    encoder->encode(textCheckerState);
 #if PLATFORM(MAC)
     encoder->encode(nsURLCachePath);
     encoder->encode(nsURLCacheMemoryCapacity);
@@ -88,6 +89,9 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
         return false;
     if (!decoder->decode(parameters.languageCode))
         return false;
+    if (!decoder->decode(parameters.textCheckerState))
+        return false;
+
 #if PLATFORM(MAC)
     if (!decoder->decode(parameters.nsURLCachePath))
         return false;
diff --git a/WebKit2/Shared/WebProcessCreationParameters.h b/WebKit2/Shared/WebProcessCreationParameters.h
index a5325de..194db75 100644
--- a/WebKit2/Shared/WebProcessCreationParameters.h
+++ b/WebKit2/Shared/WebProcessCreationParameters.h
@@ -28,6 +28,7 @@
 
 #include "CacheModel.h"
 #include "SandboxExtension.h"
+#include "TextCheckerState.h"
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
@@ -69,6 +70,8 @@ struct WebProcessCreationParameters {
 
     String languageCode;
 
+    TextCheckerState textCheckerState;
+
 #if PLATFORM(MAC)
     String nsURLCachePath;
     uint64_t nsURLCacheMemoryCapacity;
diff --git a/WebKit2/UIProcess/API/mac/WKView.mm b/WebKit2/UIProcess/API/mac/WKView.mm
index 03ccdaa..7fd2609 100644
--- a/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/WebKit2/UIProcess/API/mac/WKView.mm
@@ -35,6 +35,7 @@
 #import "PageClientImpl.h"
 #import "RunLoop.h"
 #import "TextChecker.h"
+#import "TextCheckerState.h"
 #import "WKAPICast.h"
 #import "WKStringCF.h"
 #import "WKTextInputWindowController.h"
@@ -348,19 +349,19 @@ static NSToolbarItem *toolbarItem(id <NSValidatedUserInterfaceItem> item)
 
     if (action == @selector(toggleContinuousSpellChecking:)) {
         bool enabled = TextChecker::isContinuousSpellCheckingAllowed();
-        bool checked = enabled && TextChecker::isContinuousSpellCheckingEnabled();
+        bool checked = enabled && TextChecker::state().isContinuousSpellCheckingEnabled;
         [menuItem(item) setState:checked ? NSOnState : NSOffState];
         return enabled;
     }
 
     if (action == @selector(toggleGrammarChecking:)) {
-        bool checked = TextChecker::isGrammarCheckingEnabled();
+        bool checked = TextChecker::state().isGrammarCheckingEnabled;
         [menuItem(item) setState:checked ? NSOnState : NSOffState];
         return YES;
     }
 
     if (action == @selector(toggleAutomaticSpellingCorrection:)) {
-        bool checked = TextChecker::isAutomaticSpellingCorrectionEnabled();
+        bool checked = TextChecker::state().isAutomaticSpellingCorrectionEnabled;
         [menuItem(item) setState:checked ? NSOnState : NSOffState];
         return _data->_page->selectionState().isContentEditable;
     }
@@ -424,25 +425,31 @@ static void speakString(WKStringRef string, WKErrorRef error, void*)
 
 - (IBAction)toggleContinuousSpellChecking:(id)sender
 {
-    bool spellCheckingEnabled = !TextChecker::isContinuousSpellCheckingEnabled();
+    bool spellCheckingEnabled = !TextChecker::state().isContinuousSpellCheckingEnabled;
     TextChecker::setContinuousSpellCheckingEnabled(spellCheckingEnabled);
 
+    _data->_page->process()->updateTextCheckerState();
+
     if (!spellCheckingEnabled)
         _data->_page->unmarkAllMisspellings();
 }
 
 - (IBAction)toggleGrammarChecking:(id)sender
 {
-    bool grammarCheckingEnabled = !TextChecker::isGrammarCheckingEnabled();
+    bool grammarCheckingEnabled = !TextChecker::state().isGrammarCheckingEnabled;
     TextChecker::setGrammarCheckingEnabled(grammarCheckingEnabled);
 
+    _data->_page->process()->updateTextCheckerState();
+
     if (!grammarCheckingEnabled)
         _data->_page->unmarkAllBadGrammar();
 }
 
 - (IBAction)toggleAutomaticSpellingCorrection:(id)sender
 {
-    TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::isAutomaticSpellingCorrectionEnabled());
+    TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled);
+
+    _data->_page->process()->updateTextCheckerState();
 }
 
 // Events
diff --git a/WebKit2/UIProcess/TextChecker.h b/WebKit2/UIProcess/TextChecker.h
index 1e76091..f14c53d 100644
--- a/WebKit2/UIProcess/TextChecker.h
+++ b/WebKit2/UIProcess/TextChecker.h
@@ -28,17 +28,19 @@
 
 namespace WebKit {
 
+class TextCheckerState;
+
 class TextChecker {
 public:
+    static const TextCheckerState& state();
     static bool isContinuousSpellCheckingAllowed();
-    static bool isContinuousSpellCheckingEnabled();
-    static void setContinuousSpellCheckingEnabled(bool);
 
-    static bool isGrammarCheckingEnabled();
+    static void setContinuousSpellCheckingEnabled(bool);
     static void setGrammarCheckingEnabled(bool);
 
+#if PLATFORM(MAC)
     static void setAutomaticSpellingCorrectionEnabled(bool);
-    static bool isAutomaticSpellingCorrectionEnabled();
+#endif
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 7bff752..c7e049d 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -29,6 +29,7 @@
 #include "ImmutableArray.h"
 #include "InjectedBundleMessageKinds.h"
 #include "RunLoop.h"
+#include "TextChecker.h"
 #include "WKContextPrivate.h"
 #include "WebContextMessageKinds.h"
 #include "WebContextUserMessageCoders.h"
@@ -174,6 +175,8 @@ void WebContext::ensureWebProcess()
 
     parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath;
 
+    parameters.textCheckerState = TextChecker::state();
+
     // Add any platform specific parameters
     platformInitializeWebProcess(parameters);
 
diff --git a/WebKit2/UIProcess/WebProcessProxy.cpp b/WebKit2/UIProcess/WebProcessProxy.cpp
index a4768f7..9ee923a 100644
--- a/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -27,6 +27,8 @@
 
 #include "PluginInfoStore.h"
 #include "PluginProcessManager.h"
+#include "TextChecker.h"
+#include "TextCheckerState.h"
 #include "WebBackForwardListItem.h"
 #include "WebContext.h"
 #include "WebNavigationDataStore.h"
@@ -391,4 +393,12 @@ size_t WebProcessProxy::frameCountInPage(WebPageProxy* page) const
     return result;
 }
 
+void WebProcessProxy::updateTextCheckerState()
+{
+    if (!isValid())
+        return;
+
+    send(Messages::WebProcess::SetTextCheckerState(TextChecker::state()), 0);
+}
+
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebProcessProxy.h b/WebKit2/UIProcess/WebProcessProxy.h
index 36e99de..3cf6c3b 100644
--- a/WebKit2/UIProcess/WebProcessProxy.h
+++ b/WebKit2/UIProcess/WebProcessProxy.h
@@ -102,6 +102,8 @@ public:
     void disconnectFramesFromPage(WebPageProxy*); // Including main frame.
     size_t frameCountInPage(WebPageProxy*) const; // Including main frame.
 
+    void updateTextCheckerState();
+
 private:
     explicit WebProcessProxy(WebContext*);
 
diff --git a/WebKit2/UIProcess/mac/TextCheckerMac.mm b/WebKit2/UIProcess/mac/TextCheckerMac.mm
index 10e8e84..5de1577 100644
--- a/WebKit2/UIProcess/mac/TextCheckerMac.mm
+++ b/WebKit2/UIProcess/mac/TextCheckerMac.mm
@@ -25,12 +25,40 @@
 
 #include "TextChecker.h"
 
+#include "TextCheckerState.h"
+
+#define WebAutomaticSpellingCorrectionEnabled @"WebAutomaticSpellingCorrectionEnabled"
+#define WebContinuousSpellCheckingEnabled @"WebContinuousSpellCheckingEnabled"
+#define WebGrammarCheckingEnabled @"WebGrammarCheckingEnabled"
+
 namespace WebKit {
 
-static bool continuousSpellCheckingEnabled;
-static bool grammarCheckingEnabled;
-static bool automaticSpellingCorrectionEnabled;
+TextCheckerState textCheckerState;
+
+static void initializeState()
+{
+    static bool didInitializeState;
+    if (didInitializeState)
+        return;
+
+    textCheckerState.isContinuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled] && TextChecker::isContinuousSpellCheckingAllowed();
+    textCheckerState.isGrammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled];
+    textCheckerState.isAutomaticSpellingCorrectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticSpellingCorrectionEnabled];
     
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+    if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
+        textCheckerState.isAutomaticSpellingCorrectionEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
+#endif
+
+    didInitializeState = true;
+}
+
+const TextCheckerState& TextChecker::state()
+{
+    initializeState();
+    return textCheckerState;
+}
+
 bool TextChecker::isContinuousSpellCheckingAllowed()
 {
     static bool allowContinuousSpellChecking = true;
@@ -46,27 +74,24 @@ bool TextChecker::isContinuousSpellCheckingAllowed()
     return allowContinuousSpellChecking;
 }
 
-bool TextChecker::isContinuousSpellCheckingEnabled()
-{
-    return continuousSpellCheckingEnabled && isContinuousSpellCheckingAllowed();
-}
-
 void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
 {
-    continuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
+    if (state().isContinuousSpellCheckingEnabled == isContinuousSpellCheckingEnabled)
+        return;
+                                                                                      
+    textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
+    [[NSUserDefaults standardUserDefaults] setBool:isContinuousSpellCheckingEnabled forKey:WebContinuousSpellCheckingEnabled];
 
     // FIXME: preflight the spell checker.
 }
 
-bool TextChecker::isGrammarCheckingEnabled()
-{
-    return grammarCheckingEnabled;
-}
-
 void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
 {
-    grammarCheckingEnabled = isGrammarCheckingEnabled;
+    if (state().isGrammarCheckingEnabled == isGrammarCheckingEnabled)
+        return;
 
+    textCheckerState.isGrammarCheckingEnabled = isGrammarCheckingEnabled;
+    [[NSUserDefaults standardUserDefaults] setBool:isGrammarCheckingEnabled forKey:WebGrammarCheckingEnabled];    
     [[NSSpellChecker sharedSpellChecker] updatePanels];
     
     // We call preflightSpellChecker() when turning continuous spell checking on, but we don't need to do that here
@@ -75,16 +100,13 @@ void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
 
 void TextChecker::setAutomaticSpellingCorrectionEnabled(bool isAutomaticSpellingCorrectionEnabled)
 {
-    if (automaticSpellingCorrectionEnabled == isAutomaticSpellingCorrectionEnabled)
+    if (state().isAutomaticSpellingCorrectionEnabled == isAutomaticSpellingCorrectionEnabled)
         return;
 
-    automaticSpellingCorrectionEnabled = isAutomaticSpellingCorrectionEnabled;
-    [[NSSpellChecker sharedSpellChecker] updatePanels];
-}
+    textCheckerState.isAutomaticSpellingCorrectionEnabled = isAutomaticSpellingCorrectionEnabled;
+    [[NSUserDefaults standardUserDefaults] setBool:isAutomaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled];    
 
-bool TextChecker::isAutomaticSpellingCorrectionEnabled()
-{
-    return automaticSpellingCorrectionEnabled;
+    [[NSSpellChecker sharedSpellChecker] updatePanels];
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/qt/TextCheckerQt.cpp b/WebKit2/UIProcess/qt/TextCheckerQt.cpp
index 0bc1c81..348d3b4 100644
--- a/WebKit2/UIProcess/qt/TextCheckerQt.cpp
+++ b/WebKit2/UIProcess/qt/TextCheckerQt.cpp
@@ -26,9 +26,19 @@
 #include "TextChecker.h"
 
 #include "NotImplemented.h"
+#include "TextCheckerState.h"
 
 namespace WebKit {
+  
+static TextCheckerState textCheckerState;
+
+const TextCheckerState& TextChecker::state()
+{
+    notImplemented();
     
+    return textCheckerState;
+}
+
 bool TextChecker::isContinuousSpellCheckingAllowed()
 {
     notImplemented();
diff --git a/WebKit2/UIProcess/win/TextCheckerWin.cpp b/WebKit2/UIProcess/win/TextCheckerWin.cpp
index 0bc1c81..381d0d8 100644
--- a/WebKit2/UIProcess/win/TextCheckerWin.cpp
+++ b/WebKit2/UIProcess/win/TextCheckerWin.cpp
@@ -26,9 +26,19 @@
 #include "TextChecker.h"
 
 #include "NotImplemented.h"
+#include "TextCheckerState.h"
 
 namespace WebKit {
-    
+
+static TextCheckerState textCheckerState;
+
+const TextCheckerState& TextChecker::state()
+{
+    notImplemented();
+
+    return textCheckerState;
+}
+  
 bool TextChecker::isContinuousSpellCheckingAllowed()
 {
     notImplemented();
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index ac7269a..3dc0c72 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -117,6 +117,7 @@
 		1A50DB66110A3D57000D3FE5 /* WebProcess.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */; };
 		1A594ABA112A1FB6009DE7C7 /* WebUIClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */; };
 		1A594ABB112A1FB6009DE7C7 /* WebUIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */; };
+		1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */; };
 		1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A61614D127798B5003ACD86 /* DownloadManager.cpp */; };
 		1A616150127798B5003ACD86 /* DownloadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A61614E127798B5003ACD86 /* DownloadManager.h */; };
 		1A6161D41278981C003ACD86 /* Download.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6161D21278981C003ACD86 /* Download.h */; };
@@ -781,6 +782,7 @@
 		1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebProcess.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebUIClient.cpp; sourceTree = "<group>"; };
 		1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUIClient.h; sourceTree = "<group>"; };
+		1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckerState.h; sourceTree = "<group>"; };
 		1A61614D127798B5003ACD86 /* DownloadManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DownloadManager.cpp; sourceTree = "<group>"; };
 		1A61614E127798B5003ACD86 /* DownloadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadManager.h; sourceTree = "<group>"; };
 		1A6161D21278981C003ACD86 /* Download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Download.h; sourceTree = "<group>"; };
@@ -1632,6 +1634,7 @@
 				1AAB4A8C1296F0A20023952F /* SandboxExtension.h */,
 				1AA41AB412C02EC4002BE67B /* SelectionState.h */,
 				BCBD3C3A125BFA7A00D2C29F /* StringPairVector.h */,
+				1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */,
 				BCB0B0DF12305AB100B1341E /* UserMessageCoders.h */,
 				1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */,
 				1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */,
@@ -2821,6 +2824,7 @@
 				BCCF6ACA12C91F59008F9C35 /* WKImageCG.h in Headers */,
 				BCAC111F12C92C1F00B08EEE /* WebDatabaseManagerProxyClient.h in Headers */,
 				BCCF6B2512C93E7A008F9C35 /* ImageOptions.h in Headers */,
+				1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/WebProcess.cpp b/WebKit2/WebProcess/WebProcess.cpp
index 5453742..b4e3d85 100644
--- a/WebKit2/WebProcess/WebProcess.cpp
+++ b/WebKit2/WebProcess/WebProcess.cpp
@@ -105,6 +105,7 @@ WebProcess::WebProcess()
 #if PLATFORM(QT)
     , m_networkAccessManager(0)
 #endif
+    , m_textCheckerState()
 {
 #if USE(PLATFORM_STRATEGIES)
     // Initialize our platform strategies.
@@ -610,4 +611,9 @@ void WebProcess::cancelDownload(uint64_t downloadID)
     DownloadManager::shared().cancelDownload(downloadID);
 }
 
+void WebProcess::setTextCheckerState(const TextCheckerState& textCheckerState)
+{
+    m_textCheckerState = textCheckerState;
+}
+
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebProcess.h b/WebKit2/WebProcess/WebProcess.h
index d4c0074..cfab98c 100644
--- a/WebKit2/WebProcess/WebProcess.h
+++ b/WebKit2/WebProcess/WebProcess.h
@@ -30,6 +30,7 @@
 #include "ChildProcess.h"
 #include "DrawingArea.h"
 #include "SharedMemory.h"
+#include "TextCheckerState.h"
 #include "VisitedLinkTable.h"
 #include "WebPageGroupProxy.h"
 #include <WebCore/LinkHash.h>
@@ -101,6 +102,8 @@ public:
 
     bool shouldUseCustomRepresentationForMIMEType(const String& mimeType) const { return m_mimeTypesWithCustomRepresentations.contains(mimeType); }
 
+    const TextCheckerState& textCheckerState() const { return m_textCheckerState; }
+
 private:
     WebProcess();
 
@@ -132,6 +135,8 @@ private:
 
     void cancelDownload(uint64_t downloadID);
 
+    void setTextCheckerState(const TextCheckerState&);
+
     // CoreIPC::Connection::Client
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
     CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
@@ -167,6 +172,8 @@ private:
     HashMap<uint64_t, WebFrame*> m_frameMap;
 
     HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomRepresentations;
+
+    TextCheckerState m_textCheckerState;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebProcess.messages.in b/WebKit2/WebProcess/WebProcess.messages.in
index 39ad06f..ef277d3 100644
--- a/WebKit2/WebProcess/WebProcess.messages.in
+++ b/WebKit2/WebProcess/WebProcess.messages.in
@@ -50,4 +50,6 @@ messages -> WebProcess {
     # Downloads. This should really be in a Download.messages.in, but it seemed unnecessary to create a new file just for
     # a single message.
     CancelDownload(uint64_t downloadID)
+
+    SetTextCheckerState(WebKit::TextCheckerState textCheckerState)
 }
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 50bffe6..ef9d87b 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -499,6 +499,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\Shared\TextCheckerState.h"
+				>
+			</File>
+			<File
 				RelativePath="..\Shared\UserMessageCoders.h"
 				>
 			</File>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list