<!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>[203245] 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/203245">203245</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2016-07-14 14:52:52 -0700 (Thu, 14 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Automation: FrameNotFound errors happen a lot for the main frame
https://bugs.webkit.org/show_bug.cgi?id=159777
rdar://problem/27224628

Send both pageID and frameID, and have the WebProcess side resolve the
mainFrame from 0 based on the known pageID. This avoids a race waiting
for the DidCreateMainFrame message.

Reviewed by Brian Burg.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::webFrameIDForHandle):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::computeElementLayout):
(WebKit::WebAutomationSession::getAllCookies):
(WebKit::WebAutomationSession::deleteSingleCookie):
(WebKit::WebAutomationSession::webFrameProxyForHandle): Deleted.
(WebKit::WebAutomationSession::webFrameIDForHandle): Added.
* UIProcess/Automation/WebAutomationSession.h:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
(WebKit::WebAutomationSessionProxy::resolveParentFrame):
(WebKit::WebAutomationSessionProxy::focusFrame):
(WebKit::WebAutomationSessionProxy::computeElementLayout):
(WebKit::WebAutomationSessionProxy::takeScreenshot):
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAutomationWebAutomationSessioncpp">trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAutomationWebAutomationSessionh">trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxycpp">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxyh">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxymessagesin">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (203244 => 203245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-07-14 21:43:03 UTC (rev 203244)
+++ trunk/Source/WebKit2/ChangeLog        2016-07-14 21:52:52 UTC (rev 203245)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-07-14  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Web Automation: FrameNotFound errors happen a lot for the main frame
+        https://bugs.webkit.org/show_bug.cgi?id=159777
+        rdar://problem/27224628
+
+        Send both pageID and frameID, and have the WebProcess side resolve the
+        mainFrame from 0 based on the known pageID. This avoids a race waiting
+        for the DidCreateMainFrame message.
+
+        Reviewed by Brian Burg.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::webFrameIDForHandle):
+        (WebKit::WebAutomationSession::switchToBrowsingContext):
+        (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
+        (WebKit::WebAutomationSession::resolveChildFrameHandle):
+        (WebKit::WebAutomationSession::resolveParentFrameHandle):
+        (WebKit::WebAutomationSession::computeElementLayout):
+        (WebKit::WebAutomationSession::getAllCookies):
+        (WebKit::WebAutomationSession::deleteSingleCookie):
+        (WebKit::WebAutomationSession::webFrameProxyForHandle): Deleted.
+        (WebKit::WebAutomationSession::webFrameIDForHandle): Added.
+        * UIProcess/Automation/WebAutomationSession.h:
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
+        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
+        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
+        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
+        (WebKit::WebAutomationSessionProxy::resolveParentFrame):
+        (WebKit::WebAutomationSessionProxy::focusFrame):
+        (WebKit::WebAutomationSessionProxy::computeElementLayout):
+        (WebKit::WebAutomationSessionProxy::takeScreenshot):
+        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
+        (WebKit::WebAutomationSessionProxy::deleteCookie):
+        * WebProcess/Automation/WebAutomationSessionProxy.h:
+        * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
+
</ins><span class="cx"> 2016-07-14  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Use SocketProvider to create SocketStreamHandles
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAutomationWebAutomationSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp (203244 => 203245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp        2016-07-14 21:43:03 UTC (rev 203244)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp        2016-07-14 21:52:52 UTC (rev 203245)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include &lt;WebCore/UUID.h&gt;
</span><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><ins>+#include &lt;wtf/Optional.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/StringConcatenate.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace Inspector;
</span><span class="lines">@@ -165,19 +166,16 @@
</span><span class="cx">     return handle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebFrameProxy* WebAutomationSession::webFrameProxyForHandle(const String&amp; handle, WebPageProxy&amp; page)
</del><ins>+Optional&lt;uint64_t&gt; WebAutomationSession::webFrameIDForHandle(const String&amp; handle)
</ins><span class="cx"> {
</span><span class="cx">     if (handle.isEmpty())
</span><del>-        return page.mainFrame();
</del><ins>+        return 0;
</ins><span class="cx"> 
</span><span class="cx">     auto iter = m_handleWebFrameMap.find(handle);
</span><span class="cx">     if (iter == m_handleWebFrameMap.end())
</span><del>-        return nullptr;
</del><ins>+        return Nullopt;
</ins><span class="cx"> 
</span><del>-    if (WebFrameProxy* frame = page.process().webFrame(iter-&gt;value))
-        return frame;
-
-    return nullptr;
</del><ins>+    return iter-&gt;value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebAutomationSession::handleForWebFrameID(uint64_t frameID)
</span><span class="lines">@@ -294,8 +292,8 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* frame = webFrameProxyForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString(), *page);
-    if (!frame)
</del><ins>+    Optional&lt;uint64_t&gt; frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
+    if (!frameID)
</ins><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We don't need to track this in WK2. Remove in a follow up.
</span><span class="lines">@@ -302,7 +300,7 @@
</span><span class="cx">     m_activeBrowsingContextHandle = browsingContextHandle;
</span><span class="cx"> 
</span><span class="cx">     page-&gt;setFocus(true);
</span><del>-    page-&gt;process().send(Messages::WebAutomationSessionProxy::FocusFrame(frame-&gt;frameID()), 0);
</del><ins>+    page-&gt;process().send(Messages::WebAutomationSessionProxy::FocusFrame(page-&gt;pageID(), frameID.value()), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::resizeWindowOfBrowsingContext(Inspector::ErrorString&amp; errorString, const String&amp; handle, const Inspector::InspectorObject&amp; sizeObject)
</span><span class="lines">@@ -472,8 +470,8 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* frame = webFrameProxyForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString(), *page);
-    if (!frame)
</del><ins>+    Optional&lt;uint64_t&gt; frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
+    if (!frameID)
</ins><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; argumentsVector;
</span><span class="lines">@@ -491,7 +489,7 @@
</span><span class="cx">     uint64_t callbackID = m_nextEvaluateJavaScriptCallbackID++;
</span><span class="cx">     m_evaluateJavaScriptFunctionCallbacks.set(callbackID, WTFMove(callback));
</span><span class="cx"> 
</span><del>-    page-&gt;process().send(Messages::WebAutomationSessionProxy::EvaluateJavaScriptFunction(frame-&gt;frameID(), function, argumentsVector, expectsImplicitCallbackArgument, callbackTimeout, callbackID), 0);
</del><ins>+    page-&gt;process().send(Messages::WebAutomationSessionProxy::EvaluateJavaScriptFunction(page-&gt;pageID(), frameID.value(), function, argumentsVector, expectsImplicitCallbackArgument, callbackTimeout, callbackID), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::didEvaluateJavaScriptFunction(uint64_t callbackID, const String&amp; result, const String&amp; errorType)
</span><span class="lines">@@ -515,8 +513,8 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* frame = webFrameProxyForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString(), *page);
-    if (!frame)
</del><ins>+    Optional&lt;uint64_t&gt; frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
+    if (!frameID)
</ins><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
</span><span class="cx"> 
</span><span class="cx">     uint64_t callbackID = m_nextResolveFrameCallbackID++;
</span><span class="lines">@@ -523,17 +521,17 @@
</span><span class="cx">     m_resolveChildFrameHandleCallbacks.set(callbackID, WTFMove(callback));
</span><span class="cx"> 
</span><span class="cx">     if (optionalNodeHandle) {
</span><del>-        page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveChildFrameWithNodeHandle(frame-&gt;frameID(), *optionalNodeHandle, callbackID), 0);
</del><ins>+        page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveChildFrameWithNodeHandle(page-&gt;pageID(), frameID.value(), *optionalNodeHandle, callbackID), 0);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (optionalName) {
</span><del>-        page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveChildFrameWithName(frame-&gt;frameID(), *optionalName, callbackID), 0);
</del><ins>+        page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveChildFrameWithName(page-&gt;pageID(), frameID.value(), *optionalName, callbackID), 0);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (optionalOrdinal) {
</span><del>-        page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveChildFrameWithOrdinal(frame-&gt;frameID(), *optionalOrdinal, callbackID), 0);
</del><ins>+        page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveChildFrameWithOrdinal(page-&gt;pageID(), frameID.value(), *optionalOrdinal, callbackID), 0);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -558,14 +556,14 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* frame = webFrameProxyForHandle(frameHandle, *page);
-    if (!frame)
</del><ins>+    Optional&lt;uint64_t&gt; frameID = webFrameIDForHandle(frameHandle);
+    if (!frameID)
</ins><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
</span><span class="cx"> 
</span><span class="cx">     uint64_t callbackID = m_nextResolveParentFrameCallbackID++;
</span><span class="cx">     m_resolveParentFrameHandleCallbacks.set(callbackID, WTFMove(callback));
</span><span class="cx"> 
</span><del>-    page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveParentFrame(frame-&gt;frameID(), callbackID), 0);
</del><ins>+    page-&gt;process().send(Messages::WebAutomationSessionProxy::ResolveParentFrame(page-&gt;pageID(), frameID.value(), callbackID), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::didResolveParentFrame(uint64_t callbackID, uint64_t frameID, const String&amp; errorType)
</span><span class="lines">@@ -586,8 +584,8 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* frame = webFrameProxyForHandle(frameHandle, *page);
-    if (!frame)
</del><ins>+    Optional&lt;uint64_t&gt; frameID = webFrameIDForHandle(frameHandle);
+    if (!frameID)
</ins><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
</span><span class="cx"> 
</span><span class="cx">     uint64_t callbackID = m_nextComputeElementLayoutCallbackID++;
</span><span class="lines">@@ -596,7 +594,7 @@
</span><span class="cx">     bool scrollIntoViewIfNeeded = optionalScrollIntoViewIfNeeded ? *optionalScrollIntoViewIfNeeded : false;
</span><span class="cx">     bool useViewportCoordinates = optionalUseViewportCoordinates ? *optionalUseViewportCoordinates : false;
</span><span class="cx"> 
</span><del>-    page-&gt;process().send(Messages::WebAutomationSessionProxy::ComputeElementLayout(frame-&gt;frameID(), nodeHandle, scrollIntoViewIfNeeded, useViewportCoordinates, callbackID), 0);
</del><ins>+    page-&gt;process().send(Messages::WebAutomationSessionProxy::ComputeElementLayout(page-&gt;pageID(), frameID.value(), nodeHandle, scrollIntoViewIfNeeded, useViewportCoordinates, callbackID), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::didComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, const String&amp; errorType)
</span><span class="lines">@@ -711,15 +709,13 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* mainFrame = page-&gt;mainFrame();
-    ASSERT(mainFrame);
-    if (!mainFrame)
-        FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
</del><ins>+    // Always send the main frame ID as 0 so it is resolved on the WebProcess side. This avoids a race when page-&gt;mainFrame() is null still.
+    const uint64_t mainFrameID = 0;
</ins><span class="cx"> 
</span><span class="cx">     uint64_t callbackID = m_nextGetCookiesCallbackID++;
</span><span class="cx">     m_getCookieCallbacks.set(callbackID, WTFMove(callback));
</span><span class="cx"> 
</span><del>-    page-&gt;process().send(Messages::WebAutomationSessionProxy::GetCookiesForFrame(mainFrame-&gt;frameID(), callbackID), 0);
</del><ins>+    page-&gt;process().send(Messages::WebAutomationSessionProxy::GetCookiesForFrame(page-&gt;pageID(), mainFrameID, callbackID), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Ref&lt;Inspector::Protocol::Automation::Cookie&gt; buildObjectForCookie(const WebCore::Cookie&amp; cookie)
</span><span class="lines">@@ -767,15 +763,13 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* mainFrame = page-&gt;mainFrame();
-    ASSERT(mainFrame);
-    if (!mainFrame)
-        FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
</del><ins>+    // Always send the main frame ID as 0 so it is resolved on the WebProcess side. This avoids a race when page-&gt;mainFrame() is null still.
+    const uint64_t mainFrameID = 0;
</ins><span class="cx"> 
</span><span class="cx">     uint64_t callbackID = m_nextDeleteCookieCallbackID++;
</span><span class="cx">     m_deleteCookieCallbacks.set(callbackID, WTFMove(callback));
</span><span class="cx"> 
</span><del>-    page-&gt;process().send(Messages::WebAutomationSessionProxy::DeleteCookie(mainFrame-&gt;frameID(), cookieName, callbackID), 0);
</del><ins>+    page-&gt;process().send(Messages::WebAutomationSessionProxy::DeleteCookie(page-&gt;pageID(), mainFrameID, cookieName, callbackID), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::didDeleteCookie(uint64_t callbackID, const String&amp; errorType)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAutomationWebAutomationSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h (203244 => 203245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h        2016-07-14 21:43:03 UTC (rev 203244)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h        2016-07-14 21:52:52 UTC (rev 203245)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx">     String handleForWebPageProxy(const WebPageProxy&amp;);
</span><span class="cx">     RefPtr&lt;Inspector::Protocol::Automation::BrowsingContext&gt; buildBrowsingContextForPage(WebPageProxy&amp;);
</span><span class="cx"> 
</span><del>-    WebFrameProxy* webFrameProxyForHandle(const String&amp;, WebPageProxy&amp;);
</del><ins>+    Optional&lt;uint64_t&gt; webFrameIDForHandle(const String&amp;);
</ins><span class="cx">     String handleForWebFrameID(uint64_t frameID);
</span><span class="cx">     String handleForWebFrameProxy(const WebFrameProxy&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp (203244 => 203245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp        2016-07-14 21:43:03 UTC (rev 203244)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp        2016-07-14 21:52:52 UTC (rev 203245)
</span><span class="lines">@@ -226,9 +226,13 @@
</span><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidEvaluateJavaScriptFunction(callbackID, String(), errorType), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::evaluateJavaScriptFunction(uint64_t frameID, const String&amp; function, Vector&lt;String&gt; arguments, bool expectsImplicitCallbackArgument, int callbackTimeout, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::evaluateJavaScriptFunction(uint64_t pageID, uint64_t frameID, const String&amp; function, Vector&lt;String&gt; arguments, bool expectsImplicitCallbackArgument, int callbackTimeout, uint64_t callbackID)
</ins><span class="cx"> {
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page)
+        return;
+
+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -289,11 +293,18 @@
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidEvaluateJavaScriptFunction(callbackID, result, errorType), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::resolveChildFrameWithOrdinal(uint64_t frameID, uint32_t ordinal, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::resolveChildFrameWithOrdinal(uint64_t pageID, uint64_t frameID, uint32_t ordinal, uint64_t callbackID)
</ins><span class="cx"> {
</span><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page) {
+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
+        WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, 0, windowNotFoundErrorType), 0);
+        return;
+    }
+
</ins><span class="cx">     String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</span><span class="cx"> 
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame) {
</span><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, 0, frameNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="lines">@@ -320,11 +331,18 @@
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, childFrame-&gt;frameID(), String()), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::resolveChildFrameWithNodeHandle(uint64_t frameID, const String&amp; nodeHandle, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::resolveChildFrameWithNodeHandle(uint64_t pageID, uint64_t frameID, const String&amp; nodeHandle, uint64_t callbackID)
</ins><span class="cx"> {
</span><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page) {
+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
+        WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, 0, windowNotFoundErrorType), 0);
+        return;
+    }
+
</ins><span class="cx">     String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</span><span class="cx"> 
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame) {
</span><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, 0, frameNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="lines">@@ -351,11 +369,18 @@
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, frameFromElement-&gt;frameID(), String()), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::resolveChildFrameWithName(uint64_t frameID, const String&amp; name, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::resolveChildFrameWithName(uint64_t pageID, uint64_t frameID, const String&amp; name, uint64_t callbackID)
</ins><span class="cx"> {
</span><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page) {
+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
+        WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, 0, windowNotFoundErrorType), 0);
+        return;
+    }
+
</ins><span class="cx">     String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</span><span class="cx"> 
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame) {
</span><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, 0, frameNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="lines">@@ -382,11 +407,18 @@
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveChildFrame(callbackID, childFrame-&gt;frameID(), String()), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::resolveParentFrame(uint64_t frameID, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::resolveParentFrame(uint64_t pageID, uint64_t frameID, uint64_t callbackID)
</ins><span class="cx"> {
</span><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page) {
+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
+        WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveParentFrame(callbackID, 0, windowNotFoundErrorType), 0);
+        return;
+    }
+
</ins><span class="cx">     String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</span><span class="cx"> 
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame) {
</span><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveParentFrame(callbackID, 0, frameNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="lines">@@ -401,9 +433,13 @@
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidResolveParentFrame(callbackID, parentFrame-&gt;frameID(), String()), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::focusFrame(uint64_t frameID)
</del><ins>+void WebAutomationSessionProxy::focusFrame(uint64_t pageID, uint64_t frameID)
</ins><span class="cx"> {
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page)
+        return;
+
+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -422,12 +458,19 @@
</span><span class="cx">     coreDOMWindow-&gt;focus(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::computeElementLayout(uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID)
</ins><span class="cx"> {
</span><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page) {
+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
+        WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), windowNotFoundErrorType), 0);
+        return;
+    }
+
</ins><span class="cx">     String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</span><span class="cx">     String nodeNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound);
</span><span class="cx"> 
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame) {
</span><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="lines">@@ -466,10 +509,10 @@
</span><span class="cx"> void WebAutomationSessionProxy::takeScreenshot(uint64_t pageID, uint64_t callbackID)
</span><span class="cx"> {
</span><span class="cx">     ShareableBitmap::Handle handle;
</span><del>-    String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
</del><span class="cx"> 
</span><span class="cx">     WebPage* page = WebProcess::singleton().webPage(pageID);
</span><span class="cx">     if (!page) {
</span><ins>+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
</ins><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidTakeScreenshot(callbackID, handle, windowNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -493,12 +536,18 @@
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidTakeScreenshot(callbackID, handle, String()), 0);    
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::getCookiesForFrame(uint64_t frameID, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::getCookiesForFrame(uint64_t pageID, uint64_t frameID, uint64_t callbackID)
</ins><span class="cx"> {
</span><del>-    String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</del><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page) {
+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
+        WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidGetCookiesForFrame(callbackID, Vector&lt;WebCore::Cookie&gt;(), windowNotFoundErrorType), 0);
+        return;
+    }
</ins><span class="cx"> 
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame || !frame-&gt;coreFrame() || !frame-&gt;coreFrame()-&gt;document()) {
</span><ins>+        String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</ins><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidGetCookiesForFrame(callbackID, Vector&lt;WebCore::Cookie&gt;(), frameNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -511,12 +560,18 @@
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidGetCookiesForFrame(callbackID, foundCookies, String()), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAutomationSessionProxy::deleteCookie(uint64_t frameID, String cookieName, uint64_t callbackID)
</del><ins>+void WebAutomationSessionProxy::deleteCookie(uint64_t pageID, uint64_t frameID, String cookieName, uint64_t callbackID)
</ins><span class="cx"> {
</span><del>-    String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</del><ins>+    WebPage* page = WebProcess::singleton().webPage(pageID);
+    if (!page) {
+        String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);
+        WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidDeleteCookie(callbackID, windowNotFoundErrorType), 0);
+        return;
+    }
</ins><span class="cx"> 
</span><del>-    WebFrame* frame = WebProcess::singleton().webFrame(frameID);
</del><ins>+    WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page-&gt;mainWebFrame();
</ins><span class="cx">     if (!frame || !frame-&gt;coreFrame() || !frame-&gt;coreFrame()-&gt;document()) {
</span><ins>+        String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);
</ins><span class="cx">         WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidDeleteCookie(callbackID, frameNotFoundErrorType), 0);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h (203244 => 203245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h        2016-07-14 21:43:03 UTC (rev 203244)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h        2016-07-14 21:52:52 UTC (rev 203245)
</span><span class="lines">@@ -58,16 +58,16 @@
</span><span class="cx">     void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Called by WebAutomationSessionProxy messages
</span><del>-    void evaluateJavaScriptFunction(uint64_t frameID, const String&amp; function, Vector&lt;String&gt; arguments, bool expectsImplicitCallbackArgument, int callbackTimeout, uint64_t callbackID);
-    void resolveChildFrameWithOrdinal(uint64_t frameID, uint32_t ordinal, uint64_t callbackID);
-    void resolveChildFrameWithNodeHandle(uint64_t frameID, const String&amp; nodeHandle, uint64_t callbackID);
-    void resolveChildFrameWithName(uint64_t frameID, const String&amp; name, uint64_t callbackID);
-    void resolveParentFrame(uint64_t frameID, uint64_t callbackID);
-    void focusFrame(uint64_t frameID);
-    void computeElementLayout(uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID);
</del><ins>+    void evaluateJavaScriptFunction(uint64_t pageID, uint64_t frameID, const String&amp; function, Vector&lt;String&gt; arguments, bool expectsImplicitCallbackArgument, int callbackTimeout, uint64_t callbackID);
+    void resolveChildFrameWithOrdinal(uint64_t pageID, uint64_t frameID, uint32_t ordinal, uint64_t callbackID);
+    void resolveChildFrameWithNodeHandle(uint64_t pageID, uint64_t frameID, const String&amp; nodeHandle, uint64_t callbackID);
+    void resolveChildFrameWithName(uint64_t pageID, uint64_t frameID, const String&amp; name, uint64_t callbackID);
+    void resolveParentFrame(uint64_t pageID, uint64_t frameID, uint64_t callbackID);
+    void focusFrame(uint64_t pageID, uint64_t frameID);
+    void computeElementLayout(uint64_t pageID, uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID);
</ins><span class="cx">     void takeScreenshot(uint64_t pageID, uint64_t callbackID);
</span><del>-    void getCookiesForFrame(uint64_t frameID, uint64_t callbackID);
-    void deleteCookie(uint64_t frameID, String cookieName, uint64_t callbackID);
</del><ins>+    void getCookiesForFrame(uint64_t pageID, uint64_t frameID, uint64_t callbackID);
+    void deleteCookie(uint64_t pageID, uint64_t frameID, String cookieName, uint64_t callbackID);
</ins><span class="cx"> 
</span><span class="cx">     String m_sessionIdentifier;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in (203244 => 203245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in        2016-07-14 21:43:03 UTC (rev 203244)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in        2016-07-14 21:52:52 UTC (rev 203245)
</span><span class="lines">@@ -21,19 +21,19 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><span class="cx"> messages -&gt; WebAutomationSessionProxy {
</span><del>-    EvaluateJavaScriptFunction(uint64_t frameID, String function, Vector&lt;String&gt; arguments, bool expectsImplicitCallbackArgument, int callbackTimeout, uint64_t callbackID)
</del><ins>+    EvaluateJavaScriptFunction(uint64_t pageID, uint64_t frameID, String function, Vector&lt;String&gt; arguments, bool expectsImplicitCallbackArgument, int callbackTimeout, uint64_t callbackID)
</ins><span class="cx"> 
</span><del>-    ResolveChildFrameWithOrdinal(uint64_t frameID, uint32_t ordinal, uint64_t callbackID)
-    ResolveChildFrameWithNodeHandle(uint64_t frameID, String nodeHandle, uint64_t callbackID)
-    ResolveChildFrameWithName(uint64_t frameID, String name, uint64_t callbackID)
-    ResolveParentFrame(uint64_t frameID, uint64_t callbackID)
</del><ins>+    ResolveChildFrameWithOrdinal(uint64_t pageID, uint64_t frameID, uint32_t ordinal, uint64_t callbackID)
+    ResolveChildFrameWithNodeHandle(uint64_t pageID, uint64_t frameID, String nodeHandle, uint64_t callbackID)
+    ResolveChildFrameWithName(uint64_t pageID, uint64_t frameID, String name, uint64_t callbackID)
+    ResolveParentFrame(uint64_t pageID, uint64_t frameID, uint64_t callbackID)
</ins><span class="cx"> 
</span><del>-    FocusFrame(uint64_t frameID)
</del><ins>+    FocusFrame(uint64_t pageID, uint64_t frameID)
</ins><span class="cx"> 
</span><del>-    ComputeElementLayout(uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID)
</del><ins>+    ComputeElementLayout(uint64_t pageID, uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID)
</ins><span class="cx"> 
</span><span class="cx">     TakeScreenshot(uint64_t pageID, uint64_t callbackID)
</span><span class="cx"> 
</span><del>-    GetCookiesForFrame(uint64_t frameID, uint64_t callbackID)
-    DeleteCookie(uint64_t frameID, String cookieName, uint64_t callbackID)
</del><ins>+    GetCookiesForFrame(uint64_t pageID, uint64_t frameID, uint64_t callbackID)
+    DeleteCookie(uint64_t pageID, uint64_t frameID, String cookieName, uint64_t callbackID)
</ins><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>