<!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 <mitz@apple.com>
+
+ 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 <jinwoo7.song@samsung.com>
</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&) = 0;
</span><span class="cx">
</span><del>- virtual void startAssistingNode(const AssistedNodeInformation&) = 0;
</del><ins>+ virtual void startAssistingNode(const AssistedNodeInformation&, 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&, 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& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
</span><span class="cx">
</span><del>- void startAssistingNode(const AssistedNodeInformation&);
</del><ins>+ void startAssistingNode(const AssistedNodeInformation&, IPC::MessageDecoder&);
</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<WebCore::FloatQuad> 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&) override;
</span><span class="cx">
</span><del>- virtual void startAssistingNode(const AssistedNodeInformation&) override;
</del><ins>+ virtual void startAssistingNode(const AssistedNodeInformation&, 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&, 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 "_WKDownloadInternal.h"
</del><ins>+#import "APIData.h"
</ins><span class="cx"> #import "DataReference.h"
</span><span class="cx"> #import "DownloadProxy.h"
</span><span class="cx"> #import "FindIndicator.h"
</span><span class="lines">@@ -39,12 +39,16 @@
</span><span class="cx"> #import "WKWebViewInternal.h"
</span><span class="cx"> #import "WebContextMenuProxy.h"
</span><span class="cx"> #import "WebEditCommandProxy.h"
</span><ins>+#import "WebProcessProxy.h"
+#import "_WKDownloadInternal.h"
</ins><span class="cx"> #import <UIKit/UIImagePickerController_Private.h>
</span><span class="cx"> #import <UIKit/UIWebTouchEventsGestureRecognizer.h>
</span><span class="cx"> #import <WebCore/NotImplemented.h>
</span><span class="cx"> #import <WebCore/PlatformScreen.h>
</span><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx">
</span><ins>+#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_webView->_page->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& nodeInformation)
</del><ins>+void PageClientImpl::startAssistingNode(const AssistedNodeInformation& nodeInformation, API::Object* userData)
</ins><span class="cx"> {
</span><del>- [m_contentView _startAssistingNode:nodeInformation];
</del><ins>+ MESSAGE_CHECK(!userData || userData->type() == API::Object::Type::Data);
+
+ NSObject <NSSecureCoding> *userObject = nil;
+ if (API::Data* data = static_cast<API::Data*>(userData)) {
+ auto nsData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(data->bytes())) length:data->size() freeWhenDone:NO]);
+ auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:nsData.get()]);
+ [unarchiver setRequiresSecureCoding:YES];
+ @try {
+ userObject = [unarchiver decodeObjectOfClass:[NSObject class] forKey:@"userObject"];
+ } @catch (NSException *exception) {
+ LOG_ERROR("Failed to decode user data: %@", 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&)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
</span><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius;
</span><span class="cx">
</span><del>-- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information;
</del><ins>+- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information userObject:(NSObject <NSSecureCoding> *)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&)information
</del><ins>+- (void)_startAssistingNode:(const AssistedNodeInformation&)information userObject:(NSObject <NSSecureCoding> *)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 "RemoteLayerTreeTransaction.h"
</span><span class="cx"> #import "ViewUpdateDispatcherMessages.h"
</span><span class="cx"> #import "WKBrowsingContextControllerInternal.h"
</span><ins>+#import "WebContextUserMessageCoders.h"
</ins><span class="cx"> #import "WebKitSystemInterfaceIOS.h"
</span><span class="cx"> #import "WebPageMessages.h"
</span><span class="cx"> #import "WebProcessProxy.h"
</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& information)
</del><ins>+void WebPageProxy::startAssistingNode(const AssistedNodeInformation& information, IPC::MessageDecoder& decoder)
</ins><span class="cx"> {
</span><del>- m_pageClient.startAssistingNode(information);
</del><ins>+ RefPtr<API::Object> 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 <NSSecureCoding> *)_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 "APIData.h"
</ins><span class="cx"> #import "RemoteObjectRegistry.h"
</span><span class="cx"> #import "RemoteObjectRegistryMessages.h"
</span><span class="cx"> #import "WKBrowsingContextHandleInternal.h"
</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<API::Object>& userData) override
+ {
+ auto formDelegate = m_controller->_formDelegate.get();
+
+ if (![formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:willBeginInputSessionForElement:inFrame:)])
+ return;
+
+ NSObject <NSSecureCoding> *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:@"userObject"];
+ } @catch (NSException *exception) {
+ LOG_ERROR("Failed to encode user object: %@", 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<std::pair<WTF::String, WTF::String>>&) { }
</span><span class="cx"> virtual void didAssociateFormControls(WebKit::WebPage*, const Vector<RefPtr<WebCore::Element>>&) { }
</span><span class="cx"> virtual bool shouldNotifyOnFormChanges(WebKit::WebPage*) { return false; }
</span><ins>+ virtual void willBeginInputSession(WebKit::WebPage*, WebCore::Element*, WebKit::WebFrame*, RefPtr<API::Object>& 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 "EditingRange.h"
</span><span class="cx"> #import "EditorState.h"
</span><span class="cx"> #import "GestureTypes.h"
</span><ins>+#import "InjectedBundleUserMessageCoders.h"
</ins><span class="cx"> #import "InteractionInformationAtPosition.h"
</span><span class="cx"> #import "LayerTreeHost.h"
</span><span class="cx"> #import "PluginView.h"
</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<API::Object> userData;
+ m_formClient->willBeginInputSession(this, toElement(node), WebFrame::fromCoreFrame(*node->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>