Title: [138791] trunk/Source/WebKit2
Revision
138791
Author
commit-qu...@webkit.org
Date
2013-01-04 05:24:40 -0800 (Fri, 04 Jan 2013)

Log Message

[GTK][Qt] Make compositing messages async again
https://bugs.webkit.org/show_bug.cgi?id=106082

Patch by Carlos Garcia Campos <cgar...@igalia.com> on 2013-01-04
Reviewed by Simon Hausmann.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setComposition):
(WebKit::WebPageProxy::confirmComposition):
(WebKit::WebPageProxy::cancelComposition):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::confirmComposition):
(WebKit::WebPage::setComposition):
(WebKit::WebPage::cancelComposition):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/WebPage.messages.in:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (138790 => 138791)


--- trunk/Source/WebKit2/ChangeLog	2013-01-04 12:50:02 UTC (rev 138790)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-04 13:24:40 UTC (rev 138791)
@@ -1,3 +1,22 @@
+2013-01-04  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [GTK][Qt] Make compositing messages async again
+        https://bugs.webkit.org/show_bug.cgi?id=106082
+
+        Reviewed by Simon Hausmann.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setComposition):
+        (WebKit::WebPageProxy::confirmComposition):
+        (WebKit::WebPageProxy::cancelComposition):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::confirmComposition):
+        (WebKit::WebPage::setComposition):
+        (WebKit::WebPage::cancelComposition):
+        * WebProcess/WebPage/WebPage.h:
+        (WebPage):
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2013-01-04  Christophe Dumez  <christophe.du...@intel.com>
 
         Regression(r138728): Causes crashes on the build bots

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (138790 => 138791)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-01-04 12:50:02 UTC (rev 138790)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-01-04 13:24:40 UTC (rev 138791)
@@ -4237,7 +4237,7 @@
     if (!isValid())
         return;
 
-    process()->sendSync(Messages::WebPage::SetComposition(text, underlines, selectionStart, selectionEnd, replacementRangeStart, replacementRangeEnd), Messages::WebPage::SetComposition::Reply(m_editorState), m_pageID);
+    process()->send(Messages::WebPage::SetComposition(text, underlines, selectionStart, selectionEnd, replacementRangeStart, replacementRangeEnd), m_pageID);
 }
 
 void WebPageProxy::confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength)
@@ -4245,7 +4245,7 @@
     if (!isValid())
         return;
 
-    process()->sendSync(Messages::WebPage::ConfirmComposition(compositionString, selectionStart, selectionLength), Messages::WebPage::ConfirmComposition::Reply(m_editorState), m_pageID);
+    process()->send(Messages::WebPage::ConfirmComposition(compositionString, selectionStart, selectionLength), m_pageID);
 }
 
 void WebPageProxy::cancelComposition()
@@ -4253,7 +4253,7 @@
     if (!isValid())
         return;
 
-    process()->sendSync(Messages::WebPage::CancelComposition(), Messages::WebPage::CancelComposition::Reply(m_editorState), m_pageID);
+    process()->send(Messages::WebPage::CancelComposition(), m_pageID);
 }
 #endif // PLATFORM(QT) || PLATFORM(GTK)
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (138790 => 138791)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-01-04 12:50:02 UTC (rev 138790)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-01-04 13:24:40 UTC (rev 138791)
@@ -3695,11 +3695,11 @@
     return targetFrame;
 }
 
-void WebPage::confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength, EditorState& newState)
+void WebPage::confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength)
 {
     Frame* targetFrame = targetFrameForEditing(this);
     if (!targetFrame) {
-        newState = editorState();
+        send(Messages::WebPageProxy::EditorStateChanged(editorState()));
         return;
     }
 
@@ -3707,7 +3707,7 @@
     editor->confirmComposition(compositionString);
 
     if (selectionStart == -1) {
-        newState = editorState();
+        send(Messages::WebPageProxy::EditorStateChanged(editorState()));
         return;
     }
 
@@ -3719,22 +3719,17 @@
         VisibleSelection selection(selectionRange.get(), SEL_DEFAULT_AFFINITY);
         targetFrame->selection()->setSelection(selection);
     }
-    newState = editorState();
+    send(Messages::WebPageProxy::EditorStateChanged(editorState()));
 }
 
-void WebPage::setComposition(const String& text, Vector<CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementStart, uint64_t replacementLength, EditorState& newState)
+void WebPage::setComposition(const String& text, Vector<CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementStart, uint64_t replacementLength)
 {
     Frame* targetFrame = targetFrameForEditing(this);
-    if (!targetFrame) {
-        newState = editorState();
+    if (!targetFrame || !targetFrame->selection()->isContentEditable()) {
+        send(Messages::WebPageProxy::EditorStateChanged(editorState()));
         return;
     }
 
-    if (!targetFrame->selection()->isContentEditable()) {
-        newState = editorState();
-        return;
-    }
-
     if (replacementLength > 0) {
         // The layout needs to be uptodate before setting a selection
         targetFrame->document()->updateLayout();
@@ -3747,19 +3742,14 @@
     }
 
     targetFrame->editor()->setComposition(text, underlines, selectionStart, selectionEnd);
-    newState = editorState();
+    send(Messages::WebPageProxy::EditorStateChanged(editorState()));
 }
 
-void WebPage::cancelComposition(EditorState& newState)
+void WebPage::cancelComposition()
 {
-    Frame* targetFrame = targetFrameForEditing(this);
-    if (!targetFrame) {
-        newState = editorState();
-        return;
-    }
-
-    targetFrame->editor()->cancelComposition();
-    newState = editorState();
+    if (Frame* targetFrame = targetFrameForEditing(this))
+        targetFrame->editor()->cancelComposition();
+    send(Messages::WebPageProxy::EditorStateChanged(editorState()));
 }
 #endif
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (138790 => 138791)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-01-04 12:50:02 UTC (rev 138790)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-01-04 13:24:40 UTC (rev 138791)
@@ -428,9 +428,9 @@
 #endif
 
 #if PLATFORM(QT) || PLATFORM(GTK)
-    void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState&);
-    void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength, EditorState&);
-    void cancelComposition(EditorState&);
+    void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
+    void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
+    void cancelComposition();
 #endif
 
 #if PLATFORM(MAC)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (138790 => 138791)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2013-01-04 12:50:02 UTC (rev 138790)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2013-01-04 13:24:40 UTC (rev 138791)
@@ -251,9 +251,9 @@
 #endif
 
 #if PLATFORM(QT) || PLATFORM(GTK)
-    SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (WebKit::EditorState newState)
-    ConfirmComposition(WTF::String text, int64_t selectionStart, int64_t selectionLength) -> (WebKit::EditorState newState)
-    CancelComposition() -> (WebKit::EditorState newState)
+    SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd)
+    ConfirmComposition(WTF::String text, int64_t selectionStart, int64_t selectionLength)
+    CancelComposition()
 #endif
 
 #if PLATFORM(MAC)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to