<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166900] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166900">166900</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2014-04-07 17:39:55 -0700 (Mon, 07 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add bundle client function corresponding to startAssistingNode
https://bugs.webkit.org/show_bug.cgi?id=131332

Reviewed by Anders Carlsson.

* UIProcess/PageClient.h: Added userData parameter to startAssistingNode.

* UIProcess/WebPageProxy.h: Added message decoder parameter to startAssistingNode.
* UIProcess/WebPageProxy.messages.in: Added message decoder parameter to StartAssistingNode.

* UIProcess/ios/PageClientImplIOS.h: Updated startAssistingNode override.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::startAssistingNode): Decode the user data into an NSObject and pass
it on to the content view.

* UIProcess/ios/WKContentViewInteraction.h: Added userObject parameter to
-_startAssitingNode:.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userObject:]): Added userObject parameter. We will pass
it to a future delegate method.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::startAssistingNode): Decode the user data and pass it to the client.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new
delegate method.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added an implementation
of API::InjectedBundle::FormClient::willBeginInputSession which calls the new delegate
method, and encodes the user object into userData.

* WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
(API::InjectedBundle::FormClient::willBeginInputSession): Added willBeginInputSession.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::elementDidFocus): Call willBeginInputSession and send the user data along
with the StartAssistingNode message to the UI process.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionh">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFormDelegatePrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIInjectedBundleFormClienth">trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2014-04-07  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Add bundle client function corresponding to startAssistingNode
+        https://bugs.webkit.org/show_bug.cgi?id=131332
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/PageClient.h: Added userData parameter to startAssistingNode.
+
+        * UIProcess/WebPageProxy.h: Added message decoder parameter to startAssistingNode.
+        * UIProcess/WebPageProxy.messages.in: Added message decoder parameter to StartAssistingNode.
+
+        * UIProcess/ios/PageClientImplIOS.h: Updated startAssistingNode override.
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::startAssistingNode): Decode the user data into an NSObject and pass
+        it on to the content view.
+
+        * UIProcess/ios/WKContentViewInteraction.h: Added userObject parameter to
+        -_startAssitingNode:.
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _startAssistingNode:userObject:]): Added userObject parameter. We will pass
+        it to a future delegate method.
+
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::startAssistingNode): Decode the user data and pass it to the client.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new
+        delegate method.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added an implementation
+        of API::InjectedBundle::FormClient::willBeginInputSession which calls the new delegate
+        method, and encodes the user object into userData.
+
+        * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
+        (API::InjectedBundle::FormClient::willBeginInputSession): Added willBeginInputSession.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::elementDidFocus): Call willBeginInputSession and send the user data along
+        with the StartAssistingNode message to the UI process.
+
</ins><span class="cx"> 2014-04-07  Jinwoo Song  &lt;jinwoo7.song@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Fixing the EFL build.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&amp;) = 0;
</span><span class="cx"> 
</span><del>-    virtual void startAssistingNode(const AssistedNodeInformation&amp;) = 0;
</del><ins>+    virtual void startAssistingNode(const AssistedNodeInformation&amp;, API::Object* userData) = 0;
</ins><span class="cx">     virtual void stopAssistingNode() = 0;
</span><span class="cx">     virtual void selectionDidChange() = 0;
</span><span class="cx">     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&amp;, bool isCharEvent) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -1335,7 +1335,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&amp; color, const Vector&lt;WebCore::FloatQuad&gt;&amp; geometries, const WebCore::IntSize&amp; topLeftRadius, const WebCore::IntSize&amp; topRightRadius, const WebCore::IntSize&amp; bottomLeftRadius, const WebCore::IntSize&amp; bottomRightRadius);
</span><span class="cx"> 
</span><del>-    void startAssistingNode(const AssistedNodeInformation&amp;);
</del><ins>+    void startAssistingNode(const AssistedNodeInformation&amp;, IPC::MessageDecoder&amp;);
</ins><span class="cx">     void stopAssistingNode();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector&lt;WebCore::FloatQuad&gt; geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius)
</span><span class="cx"> 
</span><del>-    StartAssistingNode(WebKit::AssistedNodeInformation information)
</del><ins>+    StartAssistingNode(WebKit::AssistedNodeInformation information, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
</ins><span class="cx">     StopAssistingNode()
</span><span class="cx">     NotifyRevealedSelection()
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&amp;) override;
</span><span class="cx"> 
</span><del>-    virtual void startAssistingNode(const AssistedNodeInformation&amp;) override;
</del><ins>+    virtual void startAssistingNode(const AssistedNodeInformation&amp;, API::Object* userData) override;
</ins><span class="cx">     virtual void stopAssistingNode() override;
</span><span class="cx">     virtual void selectionDidChange() override;
</span><span class="cx">     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&amp;, bool isCharEvent) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-#import &quot;_WKDownloadInternal.h&quot;
</del><ins>+#import &quot;APIData.h&quot;
</ins><span class="cx"> #import &quot;DataReference.h&quot;
</span><span class="cx"> #import &quot;DownloadProxy.h&quot;
</span><span class="cx"> #import &quot;FindIndicator.h&quot;
</span><span class="lines">@@ -39,12 +39,16 @@
</span><span class="cx"> #import &quot;WKWebViewInternal.h&quot;
</span><span class="cx"> #import &quot;WebContextMenuProxy.h&quot;
</span><span class="cx"> #import &quot;WebEditCommandProxy.h&quot;
</span><ins>+#import &quot;WebProcessProxy.h&quot;
+#import &quot;_WKDownloadInternal.h&quot;
</ins><span class="cx"> #import &lt;UIKit/UIImagePickerController_Private.h&gt;
</span><span class="cx"> #import &lt;UIKit/UIWebTouchEventsGestureRecognizer.h&gt;
</span><span class="cx"> #import &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> #import &lt;WebCore/PlatformScreen.h&gt;
</span><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> 
</span><ins>+#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_webView-&gt;_page-&gt;process().connection())
+
</ins><span class="cx"> @interface UIView (IPI)
</span><span class="cx"> - (UIScrollView *)_scroller;
</span><span class="cx"> @end
</span><span class="lines">@@ -358,9 +362,23 @@
</span><span class="cx">     [m_contentView _didCommitLayerTree:layerTreeTransaction];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::startAssistingNode(const AssistedNodeInformation&amp; nodeInformation)
</del><ins>+void PageClientImpl::startAssistingNode(const AssistedNodeInformation&amp; nodeInformation, API::Object* userData)
</ins><span class="cx"> {
</span><del>-    [m_contentView _startAssistingNode:nodeInformation];
</del><ins>+    MESSAGE_CHECK(!userData || userData-&gt;type() == API::Object::Type::Data);
+
+    NSObject &lt;NSSecureCoding&gt; *userObject = nil;
+    if (API::Data* data = static_cast&lt;API::Data*&gt;(userData)) {
+        auto nsData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast&lt;void*&gt;(static_cast&lt;const void*&gt;(data-&gt;bytes())) length:data-&gt;size() freeWhenDone:NO]);
+        auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:nsData.get()]);
+        [unarchiver setRequiresSecureCoding:YES];
+        @try {
+            userObject = [unarchiver decodeObjectOfClass:[NSObject class] forKey:@&quot;userObject&quot;];
+        } @catch (NSException *exception) {
+            LOG_ERROR(&quot;Failed to decode user data: %@&quot;, exception);
+        }
+    }
+
+    [m_contentView _startAssistingNode:nodeInformation userObject:userObject];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::stopAssistingNode()
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> - (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&amp;)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
</span><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&amp;)color quads:(const Vector&lt;WebCore::FloatQuad&gt;&amp;)highlightedQuads topLeftRadius:(const WebCore::IntSize&amp;)topLeftRadius topRightRadius:(const WebCore::IntSize&amp;)topRightRadius bottomLeftRadius:(const WebCore::IntSize&amp;)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&amp;)bottomRightRadius;
</span><span class="cx"> 
</span><del>-- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&amp;)information;
</del><ins>+- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&amp;)information userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject;
</ins><span class="cx"> - (void)_stopAssistingNode;
</span><span class="cx"> - (void)_selectionChanged;
</span><span class="cx"> - (void)_updateChangedSelection;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -1874,7 +1874,7 @@
</span><span class="cx">     return _assistedNodeInformation.selectOptions;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_startAssistingNode:(const AssistedNodeInformation&amp;)information
</del><ins>+- (void)_startAssistingNode:(const AssistedNodeInformation&amp;)information userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject
</ins><span class="cx"> {
</span><span class="cx">     _isEditable = YES;
</span><span class="cx">     _assistedNodeInformation = information;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import &quot;RemoteLayerTreeTransaction.h&quot;
</span><span class="cx"> #import &quot;ViewUpdateDispatcherMessages.h&quot;
</span><span class="cx"> #import &quot;WKBrowsingContextControllerInternal.h&quot;
</span><ins>+#import &quot;WebContextUserMessageCoders.h&quot;
</ins><span class="cx"> #import &quot;WebKitSystemInterfaceIOS.h&quot;
</span><span class="cx"> #import &quot;WebPageMessages.h&quot;
</span><span class="cx"> #import &quot;WebProcessProxy.h&quot;
</span><span class="lines">@@ -462,9 +463,14 @@
</span><span class="cx">     m_pageClient.didGetTapHighlightGeometries(requestID, color, highlightedQuads, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::startAssistingNode(const AssistedNodeInformation&amp; information)
</del><ins>+void WebPageProxy::startAssistingNode(const AssistedNodeInformation&amp; information, IPC::MessageDecoder&amp; decoder)
</ins><span class="cx"> {
</span><del>-    m_pageClient.startAssistingNode(information);
</del><ins>+    RefPtr&lt;API::Object&gt; userData;
+    WebContextUserMessageDecoder messageDecoder(userData, process());
+    if (!decoder.decode(messageDecoder))
+        return;
+
+    m_pageClient.startAssistingNode(information, userData.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::stopAssistingNode()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessPlugInFormDelegatePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didFocusTextField:(WKWebProcessPlugInNodeHandle *)textField inFrame:(WKWebProcessPlugInFrame *)frame;
</span><span class="cx"> - (void)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willSubmitForm:(WKWebProcessPlugInNodeHandle *)form toFrame:(WKWebProcessPlugInFrame *)frame fromFrame:(WKWebProcessPlugInFrame *)sourceFrame withValues:(NSDictionary *)values;
</span><ins>+- (NSObject &lt;NSSecureCoding&gt; *)_webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller willBeginInputSessionForElement:(WKWebProcessPlugInNodeHandle *)node inFrame:(WKWebProcessPlugInFrame *)frame;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><ins>+#import &quot;APIData.h&quot;
</ins><span class="cx"> #import &quot;RemoteObjectRegistry.h&quot;
</span><span class="cx"> #import &quot;RemoteObjectRegistryMessages.h&quot;
</span><span class="cx"> #import &quot;WKBrowsingContextHandleInternal.h&quot;
</span><span class="lines">@@ -405,6 +406,36 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        static void releaseNSData(unsigned char*, const void* untypedData)
+        {
+            [(NSData *)untypedData release];
+        }
+
+        virtual void willBeginInputSession(WebPage*, Element* element, WebFrame* frame, RefPtr&lt;API::Object&gt;&amp; userData) override
+        {
+            auto formDelegate = m_controller-&gt;_formDelegate.get();
+
+            if (![formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:willBeginInputSessionForElement:inFrame:)])
+                return;
+
+            NSObject &lt;NSSecureCoding&gt; *userObject = [formDelegate _webProcessPlugInBrowserContextController:m_controller willBeginInputSessionForElement:wrapper(*WebKit::InjectedBundleNodeHandle::getOrCreate(element)) inFrame:wrapper(*frame)];
+            if (!userObject)
+                return;
+
+            auto data = adoptNS([[NSMutableData alloc] init]);
+            auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
+            [archiver setRequiresSecureCoding:YES];
+            @try {
+                [archiver encodeObject:userObject forKey:@&quot;userObject&quot;];
+            } @catch (NSException *exception) {
+                LOG_ERROR(&quot;Failed to encode user object: %@&quot;, exception);
+                return;
+            }
+            [archiver finishEncoding];
+
+            userData = API::Data::createWithoutCopying((const unsigned char*)[data bytes], [data length], releaseNSData, data.leakRef()).leakRef();
+        }
+
</ins><span class="cx">     private:
</span><span class="cx">         WKWebProcessPlugInBrowserContextController *m_controller;
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIInjectedBundleFormClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx">     virtual void willSendSubmitEvent(WebKit::WebPage*, WebCore::HTMLFormElement*, WebKit::WebFrame*, WebKit::WebFrame* sourceFrame, const Vector&lt;std::pair&lt;WTF::String, WTF::String&gt;&gt;&amp;) { }
</span><span class="cx">     virtual void didAssociateFormControls(WebKit::WebPage*, const Vector&lt;RefPtr&lt;WebCore::Element&gt;&gt;&amp;) { }
</span><span class="cx">     virtual bool shouldNotifyOnFormChanges(WebKit::WebPage*) { return false; }
</span><ins>+    virtual void willBeginInputSession(WebKit::WebPage*, WebCore::Element*, WebKit::WebFrame*, RefPtr&lt;API::Object&gt;&amp; userData) { UNUSED_PARAM(userData); }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace InjectedBundle
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (166899 => 166900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-04-08 00:24:45 UTC (rev 166899)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-04-08 00:39:55 UTC (rev 166900)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import &quot;EditingRange.h&quot;
</span><span class="cx"> #import &quot;EditorState.h&quot;
</span><span class="cx"> #import &quot;GestureTypes.h&quot;
</span><ins>+#import &quot;InjectedBundleUserMessageCoders.h&quot;
</ins><span class="cx"> #import &quot;InteractionInformationAtPosition.h&quot;
</span><span class="cx"> #import &quot;LayerTreeHost.h&quot;
</span><span class="cx"> #import &quot;PluginView.h&quot;
</span><span class="lines">@@ -1685,7 +1686,9 @@
</span><span class="cx">         m_assistedNode = node;
</span><span class="cx">         AssistedNodeInformation information;
</span><span class="cx">         getAssistedNodeInformation(information);
</span><del>-        send(Messages::WebPageProxy::StartAssistingNode(information));
</del><ins>+        RefPtr&lt;API::Object&gt; userData;
+        m_formClient-&gt;willBeginInputSession(this, toElement(node), WebFrame::fromCoreFrame(*node-&gt;document().frame()), userData);
+        send(Messages::WebPageProxy::StartAssistingNode(information, InjectedBundleUserMessageEncoder(userData.get())));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>