Title: [167924] trunk/Source/WebKit2
Revision
167924
Author
zandober...@gmail.com
Date
2014-04-29 01:44:14 -0700 (Tue, 29 Apr 2014)

Log Message

[GTK][WK2] Avoid Vector copies in WebViewBaseInputMethodFilter::setPreedit()
https://bugs.webkit.org/show_bug.cgi?id=132323

Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp:
(WebKit::WebViewBaseInputMethodFilter::setPreedit): Inline the Vector object construction into
the WebPageProxy::setComposition() call to avoid extra Vector copies and moves.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (167923 => 167924)


--- trunk/Source/WebKit2/ChangeLog	2014-04-29 04:20:37 UTC (rev 167923)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-29 08:44:14 UTC (rev 167924)
@@ -1,3 +1,14 @@
+2014-04-29  Zan Dobersek  <zdober...@igalia.com>
+
+        [GTK][WK2] Avoid Vector copies in WebViewBaseInputMethodFilter::setPreedit()
+        https://bugs.webkit.org/show_bug.cgi?id=132323
+
+        Reviewed by Carlos Garcia Campos.
+
+        * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp:
+        (WebKit::WebViewBaseInputMethodFilter::setPreedit): Inline the Vector object construction into
+        the WebPageProxy::setComposition() call to avoid extra Vector copies and moves.
+
 2014-04-28  Dan Bernstein  <m...@apple.com>
 
         <rdar://problem/16750708> REGRESSION (r159358): Crash in InjectedBundleHitTestResult::frame

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp (167923 => 167924)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp	2014-04-29 04:20:37 UTC (rev 167923)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp	2014-04-29 08:44:14 UTC (rev 167924)
@@ -87,14 +87,9 @@
 void WebViewBaseInputMethodFilter::setPreedit(String newPreedit, int /* cursorOffset */)
 {
     // TODO: We should parse the PangoAttrList that we get from the IM context here.
-    Vector<CompositionUnderline> underlines;
-    underlines.append(CompositionUnderline(0, newPreedit.length(), Color(1, 1, 1), false));
-
     ASSERT(m_webPageProxy);
-    m_webPageProxy->setComposition(newPreedit, underlines,
-                                   m_cursorOffset, m_cursorOffset,
-                                   0 /* replacement start */,
-                                   0 /* replacement end */);
+    m_webPageProxy->setComposition(newPreedit, Vector<CompositionUnderline>{ CompositionUnderline(0, newPreedit.length(), Color(1, 1, 1), false) },
+        m_cursorOffset, m_cursorOffset, 0 /* replacement start */, 0 /* replacement end */);
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to