<!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>[174664] trunk</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/174664">174664</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-10-13 16:10:20 -0700 (Mon, 13 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Win] Implement a page load profiling tool
https://bugs.webkit.org/show_bug.cgi?id=137673

Reviewed by Dean Jackson.

Source/WebKit/win:

Add a new predicate (isMainFrame) to the IWebFrame interface so
that we can make decisions about a frames position in the page
load hierarchy in client programs.

* Interfaces/IWebFrame.idl: Added new isMainFrame
predicate to interface definition.
* WebFrame.cpp:
(WebFrame::isMainFrame): Added.
* WebFrame.h:

Tools:

Add a tool to capture and summarize page load statistics.

* WinLauncher/Common.cpp:
(parseCommandLine): Move from WinMain.cpp so that it can
be shared with internal tools.
* WinLauncher/PageLoadTestClient.cpp: Added.
(PageLoadTestClient::PageLoadTestClient):
(PageLoadTestClient::pageLoadStartedAtTime):
(PageLoadTestClient::didStartProvisionalLoad):
(PageLoadTestClient::didCommitLoad):
(PageLoadTestClient::didFirstLayoutForMainFrame):
(PageLoadTestClient::didHandleOnLoadEvents):
(PageLoadTestClient::didFinishLoad):
(PageLoadTestClient::didFailLoad):
(PageLoadTestClient::didInitiateResourceLoad):
(PageLoadTestClient::didEndResourceLoad):
(PageLoadTestClient::pageLoadEndedAtTime):
(PageLoadTestClient::endPageLoad):
(PageLoadTestClient::clearPageLoadState):
(PageLoadTestClient::shouldConsiderPageLoadEnded):
(PageLoadTestClient::maybeEndPageLoadSoon):
(PageLoadTestClient::setPageURL):
(PageLoadTestClient::dumpRunStatistics):
* WinLauncher/PrintWebUIDelegate.cpp:
(PrintWebUIDelegate::createWebViewWithRequest): Handle
nullptr URL properly.
* WinLauncher/ResourceLoadDelegate.cpp: Added.
(ResourceLoadDelegate::QueryInterface):
(ResourceLoadDelegate::AddRef):
(ResourceLoadDelegate::Release):
(ResourceLoadDelegate::identifierForInitialRequest):
(ResourceLoadDelegate::willSendRequest):
(ResourceLoadDelegate::didReceiveAuthenticationChallenge):
(ResourceLoadDelegate::didCancelAuthenticationChallenge):
(ResourceLoadDelegate::didReceiveResponse):
(ResourceLoadDelegate::didReceiveContentLength):
(ResourceLoadDelegate::didFinishLoadingFromDataSource):
(ResourceLoadDelegate::didFailLoadingWithError):
(ResourceLoadDelegate::plugInFailedWithError):
* WinLauncher/ResourceLoadDelegate.h: Added.
(ResourceLoadDelegate::ResourceLoadDelegate):
* WinLauncher/WinLauncher.cpp:
(WinLauncher::WinLauncher): Accept argument to indicate we want to capture
page loading statistics.
(WinLauncher::setFrameLoadDelegatePrivate): Get rid of stub implementation
and set private load delegate state.
(WinLauncher::setResourceLoadDelegate): Replace stub with a full implementation
that sets the view's resource load delegate.
(WinLauncher::loadURL): If no URL is passed, load the test document.
* WinLauncher/WinLauncher.h:
(WinLauncher::pageLoadTestClient):
* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj: Updated for new source files.
* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj.filters: Ditto.
* WinLauncher/WinLauncherWebHost.cpp:
(WinLauncherWebHost::updateAddressBar): Hook into page load statistics routine.
(WinLauncherWebHost::loadURL): Moved 'SendMessage' call to its own method so that
it could be used from other source files.
(WinLauncherWebHost::didFinishLoadForFrame): Added overload to capture statistics.
(WinLauncherWebHost::didStartProvisionalLoadForFrame): Ditto.
(WinLauncherWebHost::didFailLoadWithError): Ditto.
(WinLauncherWebHost::didHandleOnloadEventsForFrame): Ditto.
(WinLauncherWebHost::didFirstLayoutInFrame): Ditto.
(WinLauncherWebHost::didFinishDocumentLoadForFrame): Ditto.
(WinLauncherWebHost::didFirstVisuallyNonEmptyLayoutInFrame): Ditto.
(WinLauncherWebHost::didStartProvisionalLoadForFrame): Deleted.
* WinLauncher/WinLauncherWebHost.h:
* WinLauncher/WinMain.cpp:
(wWinMain): Create and use new delegates for gathering page load data.
* WinLauncher/stdafx.h: Need to add &lt;wtf/Platform&gt; include for various macros used in build.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinInterfacesIWebFrameidl">trunk/Source/WebKit/win/Interfaces/IWebFrame.idl</a></li>
<li><a href="#trunkSourceWebKitwinWebFramecpp">trunk/Source/WebKit/win/WebFrame.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebFrameh">trunk/Source/WebKit/win/WebFrame.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWinLauncherCommoncpp">trunk/Tools/WinLauncher/Common.cpp</a></li>
<li><a href="#trunkToolsWinLauncherPrintWebUIDelegatecpp">trunk/Tools/WinLauncher/PrintWebUIDelegate.cpp</a></li>
<li><a href="#trunkToolsWinLauncherWinLaunchercpp">trunk/Tools/WinLauncher/WinLauncher.cpp</a></li>
<li><a href="#trunkToolsWinLauncherWinLauncherh">trunk/Tools/WinLauncher/WinLauncher.h</a></li>
<li><a href="#trunkToolsWinLauncherWinLaunchervcxprojWinLauncherLibvcxproj">trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj</a></li>
<li><a href="#trunkToolsWinLauncherWinLaunchervcxprojWinLauncherLibvcxprojfilters">trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj.filters</a></li>
<li><a href="#trunkToolsWinLauncherWinLauncherWebHostcpp">trunk/Tools/WinLauncher/WinLauncherWebHost.cpp</a></li>
<li><a href="#trunkToolsWinLauncherWinLauncherWebHosth">trunk/Tools/WinLauncher/WinLauncherWebHost.h</a></li>
<li><a href="#trunkToolsWinLauncherWinMaincpp">trunk/Tools/WinLauncher/WinMain.cpp</a></li>
<li><a href="#trunkToolsWinLauncherstdafxh">trunk/Tools/WinLauncher/stdafx.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsWinLauncherPageLoadTestClientcpp">trunk/Tools/WinLauncher/PageLoadTestClient.cpp</a></li>
<li><a href="#trunkToolsWinLauncherPageLoadTestClienth">trunk/Tools/WinLauncher/PageLoadTestClient.h</a></li>
<li><a href="#trunkToolsWinLauncherResourceLoadDelegatecpp">trunk/Tools/WinLauncher/ResourceLoadDelegate.cpp</a></li>
<li><a href="#trunkToolsWinLauncherResourceLoadDelegateh">trunk/Tools/WinLauncher/ResourceLoadDelegate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Source/WebKit/win/ChangeLog        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-10-13  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [Win] Implement a page load profiling tool
+        https://bugs.webkit.org/show_bug.cgi?id=137673
+
+        Reviewed by Dean Jackson.
+
+        Add a new predicate (isMainFrame) to the IWebFrame interface so
+        that we can make decisions about a frames position in the page
+        load hierarchy in client programs.
+
+        * Interfaces/IWebFrame.idl: Added new isMainFrame
+        predicate to interface definition.
+        * WebFrame.cpp:
+        (WebFrame::isMainFrame): Added.
+        * WebFrame.h:
+
</ins><span class="cx"> 2014-10-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesIWebFrameidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Interfaces/IWebFrame.idl (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/IWebFrame.idl        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Source/WebKit/win/Interfaces/IWebFrame.idl        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2007, 2008, 2014 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -268,4 +268,10 @@
</span><span class="cx">         - (DOMWindow *)DOMWindow;
</span><span class="cx">     */
</span><span class="cx">     HRESULT DOMWindow([out, retval] IDOMWindow** window);
</span><ins>+
+    /*!
+    @method isMainFrame
+    @description Returns TRUE if the frame is the main frame.
+    */
+    HRESULT isMainFrame([out, retval] BOOL* flag);
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebFrame.cpp (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebFrame.cpp        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Source/WebKit/win/WebFrame.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006-2009, 2011, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2009, 2011, 2013-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) Research In Motion Limited 2009. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -2097,3 +2097,13 @@
</span><span class="cx">     coreFrame-&gt;view()-&gt;updateBackgroundRecursively(backgroundColor, webView()-&gt;transparent());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+HRESULT WebFrame::isMainFrame(BOOL* value)
+{
+    if (!value)
+        return E_POINTER;
+
+    Frame* coreFrame = core(this);
+    *value = coreFrame-&gt;isMainFrame();
+
+    return S_OK;
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinWebFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebFrame.h (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebFrame.h        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Source/WebKit/win/WebFrame.h        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2011, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2007, 2011, 2013-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -287,6 +287,8 @@
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE selectAll();
</span><span class="cx">     
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE deselectAll();
</span><ins>+
+    virtual HRESULT STDMETHODCALLTYPE isMainFrame(BOOL*);
</ins><span class="cx">     
</span><span class="cx">     // FrameLoaderClient
</span><span class="cx">     virtual void frameLoaderDestroyed();
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/ChangeLog        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -1,3 +1,80 @@
</span><ins>+2014-10-13  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [Win] Implement a page load profiling tool
+        https://bugs.webkit.org/show_bug.cgi?id=137673
+
+        Reviewed by Dean Jackson.
+
+        Add a tool to capture and summarize page load statistics.
+
+        * WinLauncher/Common.cpp:
+        (parseCommandLine): Move from WinMain.cpp so that it can
+        be shared with internal tools.
+        * WinLauncher/PageLoadTestClient.cpp: Added.
+        (PageLoadTestClient::PageLoadTestClient):
+        (PageLoadTestClient::pageLoadStartedAtTime):
+        (PageLoadTestClient::didStartProvisionalLoad):
+        (PageLoadTestClient::didCommitLoad):
+        (PageLoadTestClient::didFirstLayoutForMainFrame):
+        (PageLoadTestClient::didHandleOnLoadEvents):
+        (PageLoadTestClient::didFinishLoad):
+        (PageLoadTestClient::didFailLoad):
+        (PageLoadTestClient::didInitiateResourceLoad):
+        (PageLoadTestClient::didEndResourceLoad):
+        (PageLoadTestClient::pageLoadEndedAtTime):
+        (PageLoadTestClient::endPageLoad):
+        (PageLoadTestClient::clearPageLoadState):
+        (PageLoadTestClient::shouldConsiderPageLoadEnded):
+        (PageLoadTestClient::maybeEndPageLoadSoon):
+        (PageLoadTestClient::setPageURL):
+        (PageLoadTestClient::dumpRunStatistics):
+        * WinLauncher/PrintWebUIDelegate.cpp:
+        (PrintWebUIDelegate::createWebViewWithRequest): Handle
+        nullptr URL properly.
+        * WinLauncher/ResourceLoadDelegate.cpp: Added.
+        (ResourceLoadDelegate::QueryInterface):
+        (ResourceLoadDelegate::AddRef):
+        (ResourceLoadDelegate::Release):
+        (ResourceLoadDelegate::identifierForInitialRequest):
+        (ResourceLoadDelegate::willSendRequest):
+        (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+        (ResourceLoadDelegate::didCancelAuthenticationChallenge):
+        (ResourceLoadDelegate::didReceiveResponse):
+        (ResourceLoadDelegate::didReceiveContentLength):
+        (ResourceLoadDelegate::didFinishLoadingFromDataSource):
+        (ResourceLoadDelegate::didFailLoadingWithError):
+        (ResourceLoadDelegate::plugInFailedWithError):
+        * WinLauncher/ResourceLoadDelegate.h: Added.
+        (ResourceLoadDelegate::ResourceLoadDelegate):
+        * WinLauncher/WinLauncher.cpp:
+        (WinLauncher::WinLauncher): Accept argument to indicate we want to capture
+        page loading statistics.
+        (WinLauncher::setFrameLoadDelegatePrivate): Get rid of stub implementation
+        and set private load delegate state.
+        (WinLauncher::setResourceLoadDelegate): Replace stub with a full implementation
+        that sets the view's resource load delegate.
+        (WinLauncher::loadURL): If no URL is passed, load the test document.
+        * WinLauncher/WinLauncher.h:
+        (WinLauncher::pageLoadTestClient):
+        * WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj: Updated for new source files.
+        * WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj.filters: Ditto.
+        * WinLauncher/WinLauncherWebHost.cpp:
+        (WinLauncherWebHost::updateAddressBar): Hook into page load statistics routine.
+        (WinLauncherWebHost::loadURL): Moved 'SendMessage' call to its own method so that
+        it could be used from other source files.
+        (WinLauncherWebHost::didFinishLoadForFrame): Added overload to capture statistics.
+        (WinLauncherWebHost::didStartProvisionalLoadForFrame): Ditto.
+        (WinLauncherWebHost::didFailLoadWithError): Ditto.
+        (WinLauncherWebHost::didHandleOnloadEventsForFrame): Ditto.
+        (WinLauncherWebHost::didFirstLayoutInFrame): Ditto.
+        (WinLauncherWebHost::didFinishDocumentLoadForFrame): Ditto.
+        (WinLauncherWebHost::didFirstVisuallyNonEmptyLayoutInFrame): Ditto.
+        (WinLauncherWebHost::didStartProvisionalLoadForFrame): Deleted.
+        * WinLauncher/WinLauncherWebHost.h:
+        * WinLauncher/WinMain.cpp:
+        (wWinMain): Create and use new delegates for gathering page load data.
+        * WinLauncher/stdafx.h: Need to add &lt;wtf/Platform&gt; include for various macros used in build.
+
</ins><span class="cx"> 2014-10-13  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Improve the test image diffs page
</span></span></pre></div>
<a id="trunkToolsWinLauncherCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/Common.cpp (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/Common.cpp        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/Common.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;AccessibilityDelegate.h&quot;
</span><span class="cx"> #include &quot;DOMDefaultImpl.h&quot;
</span><span class="cx"> #include &quot;PrintWebUIDelegate.h&quot;
</span><ins>+#include &quot;ResourceLoadDelegate.h&quot;
</ins><span class="cx"> #include &quot;WinLauncher.h&quot;
</span><span class="cx"> #include &quot;WinLauncherReplace.h&quot;
</span><span class="cx"> #include &lt;WebKit/WebKitCOMAPI.h&gt;
</span><span class="lines">@@ -685,6 +686,26 @@
</span><span class="cx">         setWindowText(dialog, IDC_SITE_ICONS_WITH_DATA, count);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void parseCommandLine(bool&amp; usesLayeredWebView, bool&amp; useFullDesktop, bool&amp; pageLoadTesting, _bstr_t&amp; requestedURL)
+{
+    usesLayeredWebView = false;
+    useFullDesktop = false;
+    pageLoadTesting = false;
+
+    int argc = 0;
+    WCHAR** argv = CommandLineToArgvW(GetCommandLineW(), &amp;argc);
+    for (int i = 1; i &lt; argc; ++i) {
+        if (!wcsicmp(argv[i], L&quot;--transparent&quot;))
+            usesLayeredWebView = true;
+        else if (!wcsicmp(argv[i], L&quot;--desktop&quot;))
+            useFullDesktop = true;
+        else if (!requestedURL)
+            requestedURL = argv[i];
+        else if (!wcsicmp(argv[i], L&quot;--performance&quot;))
+            pageLoadTesting = true;
+    }
+}
+
</ins><span class="cx"> extern &quot;C&quot; __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCmdLine, int nCmdShow)
</span><span class="cx"> {
</span><span class="cx">     return wWinMain(hInstance, hPrevInstance, lpstrCmdLine, nCmdShow);
</span></span></pre></div>
<a id="trunkToolsWinLauncherPageLoadTestClientcpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/WinLauncher/PageLoadTestClient.cpp (0 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/PageLoadTestClient.cpp                                (rev 0)
+++ trunk/Tools/WinLauncher/PageLoadTestClient.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -0,0 +1,244 @@
</span><ins>+/*
+* Copyright (C) 2014 Apple Inc.  All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include &quot;stdafx.h&quot;
+#include &quot;PageLoadTestClient.h&quot;
+
+#include &quot;WinLauncher.h&quot;
+#include &lt;WebCore/PlatformExportMacros.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/FilePrintStream.h&gt;
+#include &lt;cmath&gt;
+
+static const CFTimeInterval waitForNewResourceLoadDuration = 0.1;
+
+PageLoadTestClient::PageLoadTestClient(WinLauncher* host, bool pageLoadTesting)
+    : m_host(host)
+    , m_pageLoadEndTime(0)
+    , m_totalTime(0)
+    , m_totalSquareRootsOfTime(0)
+    , m_longestTime(0)
+    , m_geometricMeanProductSum(1.0)
+    , m_frames(0)
+    , m_onLoadEvents(0)
+    , m_currentURLIndex(0)
+    , m_currentRepetition(0)
+    , m_pagesTimed(0)
+    , m_repetitions(pageLoadTesting ? 20 : 1)
+    , m_waitForLoadToReallyEnd(this, &amp;PageLoadTestClient::endPageLoad)
+    , m_currentPageLoadFinished(false)
+    , m_pageLoadTesting(pageLoadTesting)
+{
+}
+
+void PageLoadTestClient::pageLoadStartedAtTime(CFAbsoluteTime startTime)
+{
+    m_startTimes.append(startTime);
+}
+
+void PageLoadTestClient::didStartProvisionalLoad(IWebFrame&amp; frame)
+{
+    BOOL mainFrame;
+    if (FAILED(frame.isMainFrame(&amp;mainFrame)))
+        return;
+
+    if (mainFrame) {
+        clearPageLoadState();
+        pageLoadStartedAtTime(CFAbsoluteTimeGetCurrent());
+    }
+}
+
+void PageLoadTestClient::didCommitLoad()
+{
+    ++m_frames;
+}
+
+void PageLoadTestClient::didFirstLayoutForMainFrame()
+{
+    // Nothing to do
+}
+
+void PageLoadTestClient::didHandleOnLoadEvents()
+{
+    ++m_onLoadEvents;
+    maybeEndPageLoadSoon();
+}
+
+void PageLoadTestClient::didFinishLoad()
+{
+    m_currentPageLoadFinished = true;
+    maybeEndPageLoadSoon();
+}
+
+void PageLoadTestClient::didFailLoad()
+{
+    --m_frames;
+}
+
+void PageLoadTestClient::didInitiateResourceLoad(uint64_t resourceIdentifier)
+{
+    if (!resourceIdentifier) {
+        WTFLogAlways(&quot;Saw resourceIdentifier=0. This must be a bug in the loader code. The results may be invalid.&quot;);
+        return;
+    }
+    m_loadingSubresources.add(resourceIdentifier);
+}
+
+void PageLoadTestClient::didEndResourceLoad(uint64_t resourceIdentifier)
+{
+    if (!resourceIdentifier) {
+        WTFLogAlways(&quot;Saw resourceIdentifier=0. This must be a bug in the loader code. The results may be invalid.&quot;);
+        return;
+    }
+    auto found = m_loadingSubresources.find(resourceIdentifier);
+    if (found == m_loadingSubresources.end())
+        return;
+    m_loadingSubresources.remove(found);
+    maybeEndPageLoadSoon();
+}
+
+void PageLoadTestClient::pageLoadEndedAtTime(CFAbsoluteTime endTime)
+{
+    ASSERT(m_endTimes.size() == m_currentRepetition);
+    m_endTimes.append(endTime);
+
+    if (m_currentRepetition) {
+        CFTimeInterval pageLoadTime = (m_endTimes[m_currentRepetition] - m_startTimes[m_currentRepetition]);
+        if (pageLoadTime &gt; m_longestTime)
+            m_longestTime = pageLoadTime;
+
+        m_totalTime += pageLoadTime;
+        m_totalSquareRootsOfTime += std::sqrt(pageLoadTime);
+        m_pagesTimed++;
+        m_geometricMeanProductSum *= pageLoadTime;
+    }
+
+    if (m_pageLoadTesting) {
+        ++m_currentRepetition;
+        if (m_currentRepetition != m_repetitions)
+            m_host-&gt;loadURL(m_url);
+        else {
+            dumpRunStatistics();
+            m_host-&gt;exitProgram();
+        }
+    }
+}
+
+void PageLoadTestClient::endPageLoad(Timer&lt;PageLoadTestClient&gt;* timer)
+{
+    ASSERT_UNUSED(timer, timer == &amp;m_waitForLoadToReallyEnd);
+
+    if (!shouldConsiderPageLoadEnded())
+        return;
+    pageLoadEndedAtTime(m_pageLoadEndTime);
+    clearPageLoadState();
+}
+
+void PageLoadTestClient::clearPageLoadState()
+{
+    m_currentPageLoadFinished = false;
+    m_frames = 0;
+    m_onLoadEvents = 0;
+    m_pageLoadEndTime = 0;
+    m_loadingSubresources.clear();
+    m_waitForLoadToReallyEnd.invalidate();
+}
+
+bool PageLoadTestClient::shouldConsiderPageLoadEnded() const
+{
+    return m_currentPageLoadFinished &amp;&amp; m_onLoadEvents == m_frames &amp;&amp; m_loadingSubresources.isEmpty();
+}
+
+void PageLoadTestClient::maybeEndPageLoadSoon()
+{
+    if (!shouldConsiderPageLoadEnded())
+        return;
+    m_pageLoadEndTime = CFAbsoluteTimeGetCurrent();
+    if (m_waitForLoadToReallyEnd.isValid())
+        m_waitForLoadToReallyEnd.invalidate();
+    m_waitForLoadToReallyEnd.schedule(waitForNewResourceLoadDuration, false);
+}
+
+#if OS(WINDOWS)
+void PageLoadTestClient::setPageURL(const _bstr_t&amp; pageURL)
+{
+    m_url = pageURL;
+}
+#endif
+
+void PageLoadTestClient::dumpRunStatistics()
+{
+    const long maxPathLength = 1024;
+
+    char filenameSuffix[maxPathLength + 1];
+
+#if PLATFORM(WIN)
+    DWORD pid = GetCurrentProcessId();
+    _snprintf(filenameSuffix, sizeof(filenameSuffix), &quot;.%d.txt&quot;, pid);
+#else
+    long pid = getpid();
+    snprintf(filenameSuffix, sizeof(filenameSuffix), &quot;.%d.txt&quot;, pid);
+#endif
+
+    const char* filename = &quot;webkit_performance_log&quot;;
+    char actualFilename[maxPathLength + 1];
+
+#if PLATFORM(WIN)
+    _snprintf(actualFilename, sizeof(actualFilename), &quot;%s%s&quot;, filename, filenameSuffix);
+#else
+    snprintf(actualFilename, sizeof(actualFilename), &quot;%s%s&quot;, filename, filenameSuffix);
+#endif
+
+    std::unique_ptr&lt;WTF::FilePrintStream&gt; file = WTF::FilePrintStream::open(actualFilename, &quot;w&quot;);
+    if (!file) {
+        WTFLogAlways(&quot;Warning: Could not open page load performance data file %s for writing.\n&quot;, actualFilename);
+        return;
+    }
+
+    WTFLogAlways(&quot;*** Page load performance data output to \&quot;%s\&quot; ***\n&quot;, actualFilename);
+
+    file-&gt;print(&quot;INDIVIDUAL URL LOAD TIMES:\n&quot;);
+
+    CFTimeInterval pageLoadTime = m_endTimes.last() - m_startTimes.last();
+    file-&gt;printf(&quot;Load Time = %.1f ms\t%s\n&quot;, pageLoadTime * 1000.0, static_cast&lt;const char*&gt;(m_url));
+
+    double meanTime = 0;
+    double squareMeanRootTime = 0;
+    double geometricMeanTime = 0;
+    if (m_pagesTimed) {
+        meanTime = m_totalTime / m_pagesTimed;
+        squareMeanRootTime = (m_totalSquareRootsOfTime / m_pagesTimed) * (m_totalSquareRootsOfTime / m_pagesTimed);
+        geometricMeanTime = std::pow(m_geometricMeanProductSum, (1.0 / m_pagesTimed));
+    }
+
+    file-&gt;printf(&quot;FINISHED:    Total Time = %.1f ms\n&quot;, m_totalTime * 1000.0);
+    file-&gt;printf(&quot;           Longest Time = %.1f ms\n&quot;, m_longestTime * 1000.0);
+    file-&gt;printf(&quot;              Mean Time = %.1f ms\n&quot;, meanTime * 1000.0);
+    file-&gt;printf(&quot;  Square-Mean-Root Time = %.1f ms\n&quot;, squareMeanRootTime * 1000.0);
+    file-&gt;printf(&quot;    Geometric Mean Time = %.1f ms\n&quot;, geometricMeanTime * 1000.0);
+    file-&gt;printf(&quot;---------------------------------------------------------------------------------------------------\n&quot;);
+
+    file-&gt;flush();
+}
</ins></span></pre></div>
<a id="trunkToolsWinLauncherPageLoadTestClienth"></a>
<div class="addfile"><h4>Added: trunk/Tools/WinLauncher/PageLoadTestClient.h (0 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/PageLoadTestClient.h                                (rev 0)
+++ trunk/Tools/WinLauncher/PageLoadTestClient.h        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+/*
+* Copyright (C) 2014 Apple Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef PageLoadTestClient_h
+#define PageLoadTestClient_h
+
+#include &lt;CoreFoundation/CFDate.h&gt;
+#include &lt;WebKit/WebKit.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+template &lt;class TimerFiredClass&gt;
+class Timer {
+    WTF_MAKE_NONCOPYABLE(Timer);
+public:
+    typedef void (TimerFiredClass::*TimerFiredFunction)(Timer*);
+
+    Timer(TimerFiredClass* object, TimerFiredFunction function)
+        : m_object(object)
+        , m_function(function)
+    {
+        ASSERT_ARG(object, object);
+        ASSERT_ARG(function, function);
+    }
+
+    ~Timer() { invalidate(); }
+
+    void invalidate()
+    {
+        if (!isValid())
+            return;
+
+        CFRunLoopTimerInvalidate(m_timer.get());
+        m_timer = nullptr;
+    }
+
+    bool isValid() const
+    {
+        return m_timer &amp;&amp; CFRunLoopTimerIsValid(m_timer.get());
+    }
+
+    void schedule(CFTimeInterval interval, bool repeating)
+    {
+        ASSERT(!isValid());
+
+        CFTimeInterval repeatInterval = repeating ? interval : 0;
+        CFRunLoopTimerContext context = { 0, this, 0, 0, 0 };
+        m_timer = adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + interval, repeatInterval, 0, 0, runLoopTimerFired, &amp;context));
+
+        CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_timer.get(), kCFRunLoopCommonModes);
+    }
+
+private:
+    void fire() { (m_object-&gt;*m_function)(this); }
+
+    static void runLoopTimerFired(CFRunLoopTimerRef timerRef, void* info)
+    {
+        Timer* timer = static_cast&lt;Timer*&gt;(info);
+        ASSERT_ARG(timerRef, timer-&gt;m_timer == timerRef);
+
+        if (!CFRunLoopTimerDoesRepeat(timerRef))
+            CFRunLoopTimerInvalidate(timerRef);
+
+#ifdef __OBJC__
+        @autoreleasepool
+#endif
+        {
+            timer-&gt;fire();
+        }
+    }
+
+    TimerFiredClass* m_object;
+    TimerFiredFunction m_function;
+
+    RetainPtr&lt;CFRunLoopTimerRef&gt; m_timer;
+};
+
+class WinLauncher;
+
+class PageLoadTestClient {
+    WTF_MAKE_NONCOPYABLE(PageLoadTestClient);
+public:
+    PageLoadTestClient(WinLauncher* host, bool pageLoadTesting = false);
+
+#if OS(WINDOWS)
+    void setPageURL(const _bstr_t&amp;);
+#endif
+
+    void didStartProvisionalLoad(IWebFrame&amp;);
+    void didCommitLoad();
+    void didFirstLayoutForMainFrame();
+    void didHandleOnLoadEvents();
+    void didFinishLoad();
+    void didFailLoad();
+    void didInitiateResourceLoad(uint64_t);
+    void didEndResourceLoad(uint64_t);
+
+private:
+    void endPageLoad(Timer&lt;PageLoadTestClient&gt;*);
+    void maybeEndPageLoadSoon();
+    void clearPageLoadState();
+    bool shouldConsiderPageLoadEnded() const;
+
+    virtual void pageLoadStartedAtTime(CFAbsoluteTime);
+    virtual void pageLoadEndedAtTime(CFAbsoluteTime);
+    void dumpRunStatistics();
+
+    WinLauncher* m_host;
+    CFAbsoluteTime m_pageLoadEndTime;
+    CFTimeInterval m_totalTime;
+    CFTimeInterval m_totalSquareRootsOfTime;
+    CFTimeInterval m_longestTime;
+    Vector&lt;CFAbsoluteTime&gt; m_startTimes;
+    Vector&lt;CFAbsoluteTime&gt; m_endTimes;
+    HashSet&lt;uint64_t&gt; m_loadingSubresources;
+    Timer&lt;PageLoadTestClient&gt; m_waitForLoadToReallyEnd;
+#if OS(WINDOWS)
+    _bstr_t m_url;
+#endif
+    double m_geometricMeanProductSum;
+    unsigned m_frames;
+    unsigned m_onLoadEvents;
+    unsigned m_currentURLIndex;
+    unsigned m_currentRepetition;
+    unsigned m_pagesTimed;
+    unsigned m_repetitions;
+
+    bool m_currentPageLoadFinished;
+    bool m_pageLoadTesting;
+};
+
+#endif // PageLoadTestClient_h
</ins></span></pre></div>
<a id="trunkToolsWinLauncherPrintWebUIDelegatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/PrintWebUIDelegate.cpp (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/PrintWebUIDelegate.cpp        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/PrintWebUIDelegate.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HRESULT STDMETHODCALLTYPE PrintWebUIDelegate::createWebViewWithRequest(IWebView*, IWebURLRequest* request, IWebView**)
</del><ins>+HRESULT PrintWebUIDelegate::createWebViewWithRequest(IWebView*, IWebURLRequest* request, IWebView**)
</ins><span class="cx"> {
</span><span class="cx">     if (!request)
</span><span class="cx">         return E_POINTER;
</span><span class="lines">@@ -64,6 +64,9 @@
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return E_FAIL;
</span><span class="cx"> 
</span><ins>+    if (!url)
+        return S_OK;
+
</ins><span class="cx">     std::wstring command = std::wstring(L&quot;\&quot;&quot;) + executablePath + L&quot;\&quot; &quot; + (const wchar_t*)url;
</span><span class="cx"> 
</span><span class="cx">     PROCESS_INFORMATION processInformation;
</span></span></pre></div>
<a id="trunkToolsWinLauncherResourceLoadDelegatecpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/WinLauncher/ResourceLoadDelegate.cpp (0 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/ResourceLoadDelegate.cpp                                (rev 0)
+++ trunk/Tools/WinLauncher/ResourceLoadDelegate.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+/*
+* Copyright (C) 2014 Apple Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include &quot;stdafx.h&quot;
+#include &quot;ResourceLoadDelegate.h&quot;
+
+#include &quot;PageLoadTestClient.h&quot;
+#include &quot;WinLauncher.h&quot;
+#include &lt;WebKit/WebKitCOMAPI.h&gt;
+#include &lt;comip.h&gt;
+#include &lt;commctrl.h&gt;
+#include &lt;commdlg.h&gt;
+#include &lt;objbase.h&gt;
+#include &lt;shlwapi.h&gt;
+#include &lt;wininet.h&gt;
+
+HRESULT ResourceLoadDelegate::QueryInterface(REFIID riid, void** ppvObject)
+{
+    *ppvObject = 0;
+    if (IsEqualIID(riid, IID_IUnknown))
+        *ppvObject = static_cast&lt;IWebResourceLoadDelegate*&gt;(this);
+    else if (IsEqualIID(riid, IID_IWebResourceLoadDelegate))
+        *ppvObject = static_cast&lt;IWebResourceLoadDelegate*&gt;(this);
+    else
+        return E_NOINTERFACE;
+
+    AddRef();
+    return S_OK;
+}
+
+ULONG ResourceLoadDelegate::AddRef(void)
+{
+    return ++m_refCount;
+}
+
+ULONG ResourceLoadDelegate::Release(void)
+{
+    ULONG newRef = --m_refCount;
+    if (!newRef)
+        delete this;
+
+    return newRef;
+}
+
+HRESULT ResourceLoadDelegate::identifierForInitialRequest(IWebView*, IWebURLRequest*, IWebDataSource*, unsigned long identifier)
+{
+    if (!m_client)
+        return E_FAIL;
+
+    m_client-&gt;pageLoadTestClient().didInitiateResourceLoad(identifier);
+
+    return S_OK;
+}
+
+HRESULT ResourceLoadDelegate::willSendRequest(IWebView*, unsigned long, IWebURLRequest*, IWebURLResponse*, IWebDataSource*, IWebURLRequest**)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT ResourceLoadDelegate::didReceiveAuthenticationChallenge(IWebView*, unsigned long, IWebURLAuthenticationChallenge*, IWebDataSource*)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT ResourceLoadDelegate::didCancelAuthenticationChallenge(IWebView*, unsigned long, IWebURLAuthenticationChallenge*, IWebDataSource*)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT ResourceLoadDelegate::didReceiveResponse(IWebView*, unsigned long, IWebURLResponse*, IWebDataSource*)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT ResourceLoadDelegate::didReceiveContentLength(IWebView*, unsigned long, UINT, IWebDataSource*)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT ResourceLoadDelegate::didFinishLoadingFromDataSource(IWebView*, unsigned long identifier, IWebDataSource*)
+{
+    if (!m_client)
+        return E_FAIL;
+
+    m_client-&gt;pageLoadTestClient().didEndResourceLoad(identifier);
+
+    return S_OK;
+}
+
+HRESULT ResourceLoadDelegate::didFailLoadingWithError(IWebView*, unsigned long identifier, IWebError*, IWebDataSource*)
+{
+    if (!m_client)
+        return E_FAIL;
+
+    m_client-&gt;pageLoadTestClient().didEndResourceLoad(identifier);
+
+    return S_OK;
+}
+
+HRESULT ResourceLoadDelegate::plugInFailedWithError(IWebView*, IWebError*, IWebDataSource*)
+{
+    return E_NOTIMPL;
+}
</ins></span></pre></div>
<a id="trunkToolsWinLauncherResourceLoadDelegateh"></a>
<div class="addfile"><h4>Added: trunk/Tools/WinLauncher/ResourceLoadDelegate.h (0 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/ResourceLoadDelegate.h                                (rev 0)
+++ trunk/Tools/WinLauncher/ResourceLoadDelegate.h        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+* Copyright (C) 2014 Apple Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef ResourceLoadDelegate_h
+#define ResourceLoadDelegate_h
+
+#include &lt;WebKit/WebKit.h&gt;
+
+class WinLauncher;
+
+class ResourceLoadDelegate : public IWebResourceLoadDelegate {
+public:
+    ResourceLoadDelegate(WinLauncher* client)
+        : m_refCount(1), m_client(client) { }
+
+    // IUnknown
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+    virtual ULONG STDMETHODCALLTYPE AddRef(void);
+    virtual ULONG STDMETHODCALLTYPE Release(void);
+
+    // IWebResourceLoadDelegate
+    virtual HRESULT STDMETHODCALLTYPE identifierForInitialRequest(IWebView*, IWebURLRequest*, IWebDataSource*, unsigned long identifier);
+    virtual HRESULT STDMETHODCALLTYPE willSendRequest(IWebView*, unsigned long identifier, IWebURLRequest*, IWebURLResponse* redirectResponse, IWebDataSource*, IWebURLRequest** newRequest);
+    virtual HRESULT STDMETHODCALLTYPE didReceiveAuthenticationChallenge(IWebView*, unsigned long identifier, IWebURLAuthenticationChallenge*, IWebDataSource*);
+    virtual HRESULT STDMETHODCALLTYPE didCancelAuthenticationChallenge(IWebView*, unsigned long identifier, IWebURLAuthenticationChallenge*, IWebDataSource*);
+    virtual HRESULT STDMETHODCALLTYPE didReceiveResponse(IWebView*, unsigned long identifier, IWebURLResponse*, IWebDataSource*);
+    virtual HRESULT STDMETHODCALLTYPE didReceiveContentLength(IWebView*, unsigned long identifier, UINT length, IWebDataSource*);
+    virtual HRESULT STDMETHODCALLTYPE didFinishLoadingFromDataSource(IWebView*, unsigned long identifier, IWebDataSource*);
+    virtual HRESULT STDMETHODCALLTYPE didFailLoadingWithError(IWebView*, unsigned long identifier, IWebError*, IWebDataSource*);
+    virtual HRESULT STDMETHODCALLTYPE plugInFailedWithError(IWebView*, IWebError*, IWebDataSource*);
+
+private:
+    WinLauncher* m_client;
+    int m_refCount;
+};
+
+#endif // ResourceLoadDelegate
</ins></span></pre></div>
<a id="trunkToolsWinLauncherWinLaunchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinLauncher.cpp (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinLauncher.cpp        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/WinLauncher.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -51,10 +51,11 @@
</span><span class="cx"> 
</span><span class="cx"> typedef _com_ptr_t&lt;_com_IIID&lt;IWebMutableURLRequest, &amp;__uuidof(IWebMutableURLRequest)&gt;&gt; IWebMutableURLRequestPtr;
</span><span class="cx"> 
</span><del>-WinLauncher::WinLauncher(HWND mainWnd, HWND urlBarWnd, bool useLayeredWebView)
</del><ins>+WinLauncher::WinLauncher(HWND mainWnd, HWND urlBarWnd, bool useLayeredWebView, bool pageLoadTesting)
</ins><span class="cx">     : m_hMainWnd(mainWnd)
</span><span class="cx">     , m_hURLBarWnd(urlBarWnd)
</span><span class="cx">     , m_useLayeredWebView(useLayeredWebView)
</span><ins>+    , m_pageLoadTestClient(std::make_unique&lt;PageLoadTestClient&gt;(this, pageLoadTesting))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -122,6 +123,11 @@
</span><span class="cx">     return m_webView-&gt;setFrameLoadDelegate(frameLoadDelegate);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+HRESULT WinLauncher::setFrameLoadDelegatePrivate(IWebFrameLoadDelegatePrivate* frameLoadDelegatePrivate)
+{
+    return m_webViewPrivate-&gt;setFrameLoadDelegatePrivate(frameLoadDelegatePrivate);
+}
+
</ins><span class="cx"> HRESULT WinLauncher::setUIDelegate(IWebUIDelegate* uiDelegate)
</span><span class="cx"> {
</span><span class="cx">     m_uiDelegate = uiDelegate;
</span><span class="lines">@@ -134,6 +140,13 @@
</span><span class="cx">     return m_webView-&gt;setAccessibilityDelegate(accessibilityDelegate);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+HRESULT WinLauncher::setResourceLoadDelegate(IWebResourceLoadDelegate* resourceLoadDelegate)
+{
+    m_resourceLoadDelegate = resourceLoadDelegate;
+    return m_webView-&gt;setResourceLoadDelegate(resourceLoadDelegate);
+}
+
</ins><span class="cx"> IWebFramePtr WinLauncher::mainFrame()
</span><span class="cx"> {
</span><span class="cx">     IWebFramePtr framePtr;
</span><span class="lines">@@ -348,6 +361,9 @@
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return hr;
</span><span class="cx"> 
</span><ins>+    if (!passedURL)
+        return frame-&gt;loadHTMLString(_bstr_t(defaultHTML).GetBSTR(), 0);
+
</ins><span class="cx">     IWebMutableURLRequestPtr request;
</span><span class="cx">     hr = WebKitCreateInstance(CLSID_WebMutableURLRequest, 0, IID_IWebMutableURLRequest, (void**)&amp;request);
</span><span class="cx">     if (FAILED(hr))
</span><span class="lines">@@ -366,3 +382,8 @@
</span><span class="cx"> 
</span><span class="cx">     return hr;
</span><span class="cx"> }
</span><ins>+
+void WinLauncher::exitProgram()
+{
+    ::PostMessage(m_hMainWnd, static_cast&lt;UINT&gt;(WM_COMMAND), MAKELPARAM(IDM_EXIT, 0), 0);
+}
</ins></span></pre></div>
<a id="trunkToolsWinLauncherWinLauncherh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinLauncher.h (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinLauncher.h        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/WinLauncher.h        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -23,7 +23,9 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#include &quot;PageLoadTestClient.h&quot;
</ins><span class="cx"> #include &lt;WebKit/WebKit.h&gt;
</span><ins>+#include &lt;memory&gt;
</ins><span class="cx"> #include &lt;vector&gt;
</span><span class="cx"> 
</span><span class="cx"> typedef _com_ptr_t&lt;_com_IIID&lt;IWebFrame, &amp;__uuidof(IWebFrame)&gt;&gt; IWebFramePtr;
</span><span class="lines">@@ -39,10 +41,11 @@
</span><span class="cx"> typedef _com_ptr_t&lt;_com_IIID&lt;IWebInspector, &amp;__uuidof(IWebInspector)&gt;&gt; IWebInspectorPtr;
</span><span class="cx"> typedef _com_ptr_t&lt;_com_IIID&lt;IWebCoreStatistics, &amp;__uuidof(IWebCoreStatistics)&gt;&gt; IWebCoreStatisticsPtr;
</span><span class="cx"> typedef _com_ptr_t&lt;_com_IIID&lt;IWebCache, &amp;__uuidof(IWebCache)&gt;&gt; IWebCachePtr;
</span><ins>+typedef _com_ptr_t&lt;_com_IIID&lt;IWebResourceLoadDelegate, &amp;__uuidof(IWebResourceLoadDelegate)&gt;&gt; IWebResourceLoadDelegatePtr;
</ins><span class="cx"> 
</span><span class="cx"> class WinLauncher {
</span><span class="cx"> public:
</span><del>-    WinLauncher(HWND mainWnd, HWND urlBarWnd, bool useLayeredWebView = false);
</del><ins>+    WinLauncher(HWND mainWnd, HWND urlBarWnd, bool useLayeredWebView = false, bool pageLoadTesting = false);
</ins><span class="cx"> 
</span><span class="cx">     HRESULT init();
</span><span class="cx">     HRESULT prepareViews(HWND mainWnd, const RECT&amp; clientRect, const BSTR&amp; requestedURL, HWND&amp; viewWnd);
</span><span class="lines">@@ -53,12 +56,15 @@
</span><span class="cx">     void launchInspector();
</span><span class="cx">     void navigateForwardOrBackward(HWND hWnd, UINT menuID);
</span><span class="cx">     void navigateToHistory(HWND hWnd, UINT menuID);
</span><ins>+    void exitProgram();
</ins><span class="cx">     bool seedInitialDefaultPreferences();
</span><span class="cx">     bool setToDefaultPreferences();
</span><span class="cx"> 
</span><span class="cx">     HRESULT setFrameLoadDelegate(IWebFrameLoadDelegate*);
</span><ins>+    HRESULT setFrameLoadDelegatePrivate(IWebFrameLoadDelegatePrivate*);
</ins><span class="cx">     HRESULT setUIDelegate(IWebUIDelegate*);
</span><span class="cx">     HRESULT setAccessibilityDelegate(IAccessibilityDelegate*);
</span><ins>+    HRESULT setResourceLoadDelegate(IWebResourceLoadDelegate*);
</ins><span class="cx"> 
</span><span class="cx">     IWebPreferencesPtr standardPreferences() { return m_standardPreferences;  }
</span><span class="cx">     IWebPreferencesPrivatePtr privatePreferences() { return m_prefsPrivate; }
</span><span class="lines">@@ -72,9 +78,13 @@
</span><span class="cx">     bool goBack();
</span><span class="cx">     bool goForward();
</span><span class="cx"> 
</span><ins>+    PageLoadTestClient&amp; pageLoadTestClient() { return *m_pageLoadTestClient; }
+
</ins><span class="cx"> private:
</span><span class="cx">     std::vector&lt;IWebHistoryItemPtr&gt; m_historyItems;
</span><span class="cx"> 
</span><ins>+    std::unique_ptr&lt;PageLoadTestClient&gt; m_pageLoadTestClient;
+
</ins><span class="cx">     IWebViewPtr m_webView;
</span><span class="cx">     IWebViewPrivatePtr m_webViewPrivate;
</span><span class="cx"> 
</span><span class="lines">@@ -86,6 +96,7 @@
</span><span class="cx">     IWebFrameLoadDelegatePtr m_frameLoadDelegate;
</span><span class="cx">     IWebUIDelegatePtr m_uiDelegate;
</span><span class="cx">     IAccessibilityDelegatePtr m_accessibilityDelegate;
</span><ins>+    IWebResourceLoadDelegatePtr m_resourceLoadDelegate;
</ins><span class="cx"> 
</span><span class="cx">     IWebCoreStatisticsPtr m_statistics;
</span><span class="cx">     IWebCachePtr m_webCache;
</span></span></pre></div>
<a id="trunkToolsWinLauncherWinLaunchervcxprojWinLauncherLibvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -218,7 +218,9 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\DOMDefaultImpl.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\PageLoadTestClient.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\PrintWebUIDelegate.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\ResourceLoadDelegate.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\stdafx.cpp&quot;&gt;
</span><span class="cx">       &lt;PrecompiledHeader Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;Create&lt;/PrecompiledHeader&gt;
</span><span class="cx">       &lt;PrecompiledHeader Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;Create&lt;/PrecompiledHeader&gt;
</span><span class="lines">@@ -240,7 +242,9 @@
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\AccessibilityDelegate.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\DOMDefaultImpl.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\PageLoadTestClient.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\PrintWebUIDelegate.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\ResourceLoadDelegate.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\stdafx.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\WinLauncher.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\WinLauncherReplace.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkToolsWinLauncherWinLaunchervcxprojWinLauncherLibvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj.filters (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj.filters        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj.filters        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -49,6 +49,12 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Common.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Source Files&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\ResourceLoadDelegate.cpp&quot;&gt;
+      &lt;Filter&gt;Source Files&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\PageLoadTestClient.cpp&quot;&gt;
+      &lt;Filter&gt;Source Files&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">   &lt;/ItemGroup&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\DOMDefaultImpl.h&quot;&gt;
</span><span class="lines">@@ -75,6 +81,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\WinLauncherWebHost.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Header Files&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\ResourceLoadDelegate.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\PageLoadTestClient.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">   &lt;/ItemGroup&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;ResourceCompile Include=&quot;WinLauncherLib.rc&quot;&gt;
</span></span></pre></div>
<a id="trunkToolsWinLauncherWinLauncherWebHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinLauncherWebHost.cpp (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinLauncherWebHost.cpp        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/WinLauncherWebHost.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2008, 2013 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2008, 2013-2014 Apple Inc.  All rights reserved.
</ins><span class="cx">  * Copyright (C) 2009, 2011 Brent Fulgham.  All rights reserved.
</span><span class="cx">  * Copyright (C) 2009, 2010, 2011 Appcelerator, Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2013 Alex Christensen. All rights reserved.
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;WinLauncherWebHost.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMDefaultImpl.h&quot;
</span><ins>+#include &quot;PageLoadTestClient.h&quot;
</ins><span class="cx"> #include &quot;WinLauncher.h&quot;
</span><span class="cx"> #include &lt;WebKit/WebKit.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -82,11 +83,21 @@
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    ::SendMessage(m_hURLBarWnd, static_cast&lt;UINT&gt;(WM_SETTEXT), 0, reinterpret_cast&lt;LPARAM&gt;(frameURL.GetBSTR()));
</del><ins>+    if (frameURL.length()) {
+        m_client-&gt;pageLoadTestClient().setPageURL(frameURL);
+        m_client-&gt;pageLoadTestClient().didCommitLoad();
+    }
</ins><span class="cx"> 
</span><ins>+    loadURL(frameURL);
+
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WinLauncherWebHost::loadURL(_bstr_t&amp; url)
+{
+    ::SendMessage(m_hURLBarWnd, static_cast&lt;UINT&gt;(WM_SETTEXT), 0, reinterpret_cast&lt;LPARAM&gt;(url.GetBSTR()));
+}
+
</ins><span class="cx"> HRESULT WinLauncherWebHost::didFailProvisionalLoadWithError(IWebView*, IWebError *error, IWebFrame*)
</span><span class="cx"> {
</span><span class="cx">     _bstr_t errorDescription;
</span><span class="lines">@@ -134,6 +145,15 @@
</span><span class="cx"> 
</span><span class="cx"> HRESULT WinLauncherWebHost::didFinishLoadForFrame(IWebView* webView, IWebFrame* frame)
</span><span class="cx"> {
</span><ins>+    if (!frame || !webView)
+        return E_POINTER;
+
+    BOOL mainFrame;
+    if (SUCCEEDED(frame-&gt;isMainFrame(&amp;mainFrame))) {
+        if (mainFrame)
+            m_client-&gt;pageLoadTestClient().didFinishLoad();
+    }
+
</ins><span class="cx">     IDOMDocumentPtr doc;
</span><span class="cx">     frame-&gt;DOMDocument(&amp;doc.GetInterfacePtr());
</span><span class="cx"> 
</span><span class="lines">@@ -158,3 +178,54 @@
</span><span class="cx"> 
</span><span class="cx">     return hr;
</span><span class="cx"> }
</span><ins>+
+HRESULT WinLauncherWebHost::didStartProvisionalLoadForFrame(IWebView*, IWebFrame* frame)
+{
+    if (!frame)
+        return E_FAIL;
+
+    m_client-&gt;pageLoadTestClient().didStartProvisionalLoad(*frame);
+    return S_OK;
+}
+
+HRESULT WinLauncherWebHost::didFailLoadWithError(IWebView*, IWebError*, IWebFrame*)
+{
+    m_client-&gt;pageLoadTestClient().didFailLoad();
+    return S_OK;
+}
+
+HRESULT WinLauncherWebHost::didHandleOnloadEventsForFrame(IWebView* sender, IWebFrame* frame)
+{
+    IWebDataSourcePtr dataSource;
+    HRESULT hr = frame-&gt;dataSource(&amp;dataSource.GetInterfacePtr());
+    if (FAILED(hr) || !dataSource)
+        hr = frame-&gt;provisionalDataSource(&amp;dataSource.GetInterfacePtr());
+    if (FAILED(hr) || !dataSource)
+        return 0;
+
+    IWebMutableURLRequestPtr request;
+    hr = dataSource-&gt;request(&amp;request.GetInterfacePtr());
+    if (FAILED(hr) || !request)
+        return 0;
+
+    _bstr_t frameURL;
+    hr = request-&gt;mainDocumentURL(frameURL.GetAddress());
+    if (FAILED(hr))
+        return 0;
+
+    if (frameURL.length())
+        m_client-&gt;pageLoadTestClient().didHandleOnLoadEvents();
+
+    return S_OK;
+}
+
+HRESULT WinLauncherWebHost::didFirstLayoutInFrame(IWebView*, IWebFrame* frame)
+{
+    BOOL mainFrame;
+    if (SUCCEEDED(frame-&gt;isMainFrame(&amp;mainFrame))) {
+        if (mainFrame)
+            m_client-&gt;pageLoadTestClient().didFirstLayoutForMainFrame();
+    }
+
+    return S_OK;
+}
</ins></span></pre></div>
<a id="trunkToolsWinLauncherWinLauncherWebHosth"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinLauncherWebHost.h (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinLauncherWebHost.h        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/WinLauncherWebHost.h        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> class WinLauncher;
</span><span class="cx"> 
</span><del>-class WinLauncherWebHost : public IWebFrameLoadDelegate {
</del><ins>+class WinLauncherWebHost : public IWebFrameLoadDelegate, public IWebFrameLoadDelegatePrivate {
</ins><span class="cx"> public:
</span><span class="cx">     WinLauncherWebHost(WinLauncher* client, HWND urlBar)
</span><span class="cx">         : m_refCount(1), m_client(client), m_hURLBarWnd(urlBar) { }
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">     virtual ULONG STDMETHODCALLTYPE Release();
</span><span class="cx"> 
</span><span class="cx">     // IWebFrameLoadDelegate
</span><del>-    virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(IWebView*, IWebFrame*) { return S_OK; }
</del><ins>+    virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(IWebView*, IWebFrame*);
</ins><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(IWebView*, IWebFrame*) { return S_OK; }
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(IWebView*, IWebError*, IWebFrame*);
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(IWebView* webView, IWebFrame*)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didChangeIcons(IWebView*, IWebFrame*) { return S_OK; }
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(IWebView*, HBITMAP, IWebFrame*) { return S_OK; }
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(IWebView*, IWebFrame*);   
</span><del>-    virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(IWebView*, IWebError*, IWebFrame*) { return S_OK; }
</del><ins>+    virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(IWebView*, IWebError*, IWebFrame*);
</ins><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(IWebView*, IWebFrame*) { return S_OK; }
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(IWebView*, BSTR url, double delaySeconds, DATE fireDate, IWebFrame*) { return S_OK; }
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(IWebView*, IWebFrame*) { return S_OK; }
</span><span class="lines">@@ -64,6 +64,14 @@
</span><span class="cx">     virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(IWebView*, JSContextRef, JSObjectRef)  { return S_OK; }
</span><span class="cx">     virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(IWebView*, JSContextRef, JSObjectRef, IWebFrame*) { return S_OK; }
</span><span class="cx"> 
</span><ins>+    // IWebFrameLoadDelegatePrivate
+    virtual HRESULT STDMETHODCALLTYPE didFinishDocumentLoadForFrame(IWebView* sender, IWebFrame*) { return S_OK; }
+    virtual HRESULT STDMETHODCALLTYPE didFirstLayoutInFrame(IWebView* sender, IWebFrame*);
+    virtual HRESULT STDMETHODCALLTYPE didHandleOnloadEventsForFrame(IWebView*, IWebFrame*);
+    virtual HRESULT STDMETHODCALLTYPE didFirstVisuallyNonEmptyLayoutInFrame(IWebView* sender, IWebFrame*)  { return S_OK; }
+
+    void loadURL(_bstr_t&amp;);
+
</ins><span class="cx"> protected:
</span><span class="cx">     HRESULT updateAddressBar(IWebView&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWinLauncherWinMaincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinMain.cpp (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinMain.cpp        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/WinMain.cpp        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -53,19 +53,11 @@
</span><span class="cx"> 
</span><span class="cx">     bool usesLayeredWebView = false;
</span><span class="cx">     bool useFullDesktop = false;
</span><del>-
</del><ins>+    bool pageLoadTesting = false;
</ins><span class="cx">     _bstr_t requestedURL;
</span><del>-    int argc = 0;
-    WCHAR** argv = CommandLineToArgvW(GetCommandLineW(), &amp;argc);
-    for (int i = 1; i &lt; argc; ++i) {
-        if (!wcsicmp(argv[i], L&quot;--transparent&quot;))
-            usesLayeredWebView = true;
-        else if (!wcsicmp(argv[i], L&quot;--desktop&quot;))
-            useFullDesktop = true;
-        else if (!requestedURL)
-            requestedURL = argv[i];
-    }
</del><span class="cx"> 
</span><ins>+    parseCommandLine(usesLayeredWebView, useFullDesktop, pageLoadTesting, requestedURL);
+
</ins><span class="cx">     // Initialize global strings
</span><span class="cx">     LoadString(hInst, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
</span><span class="cx">     LoadString(hInst, IDC_WINLAUNCHER, szWindowClass, MAX_LOADSTRING);
</span><span class="lines">@@ -107,7 +99,9 @@
</span><span class="cx"> 
</span><span class="cx">     RECT clientRect = { s_windowPosition.x, s_windowPosition.y, s_windowPosition.x + s_windowSize.cx, s_windowPosition.y + s_windowSize.cy };
</span><span class="cx"> 
</span><del>-    gWinLauncher = new WinLauncher(hMainWnd, hURLBarWnd, usesLayeredWebView);
</del><ins>+    WinLauncherWebHost* webHost = nullptr;
+
+    gWinLauncher = new WinLauncher(hMainWnd, hURLBarWnd, usesLayeredWebView, pageLoadTesting);
</ins><span class="cx">     if (!gWinLauncher)
</span><span class="cx">         goto exit;
</span><span class="cx"> 
</span><span class="lines">@@ -124,10 +118,16 @@
</span><span class="cx">     if (!setCacheFolder())
</span><span class="cx">         goto exit;
</span><span class="cx"> 
</span><del>-    hr = gWinLauncher-&gt;setFrameLoadDelegate(new WinLauncherWebHost(gWinLauncher, hURLBarWnd));
</del><ins>+    webHost = new WinLauncherWebHost(gWinLauncher, hURLBarWnd);
+
+    hr = gWinLauncher-&gt;setFrameLoadDelegate(webHost);
</ins><span class="cx">     if (FAILED(hr))
</span><span class="cx">         goto exit;
</span><span class="cx"> 
</span><ins>+    hr = gWinLauncher-&gt;setFrameLoadDelegatePrivate(webHost);
+    if (FAILED(hr))
+        goto exit;
+
</ins><span class="cx">     hr = gWinLauncher-&gt;setUIDelegate(new PrintWebUIDelegate());
</span><span class="cx">     if (FAILED (hr))
</span><span class="cx">         goto exit;
</span><span class="lines">@@ -136,6 +136,10 @@
</span><span class="cx">     if (FAILED (hr))
</span><span class="cx">         goto exit;
</span><span class="cx"> 
</span><ins>+    hr = gWinLauncher-&gt;setResourceLoadDelegate(new ResourceLoadDelegate(gWinLauncher));
+    if (FAILED(hr))
+        goto exit;
+
</ins><span class="cx">     hr = gWinLauncher-&gt;prepareViews(hMainWnd, clientRect, requestedURL.GetBSTR(), gViewWindow);
</span><span class="cx">     if (FAILED(hr) || !gViewWindow)
</span><span class="cx">         goto exit;
</span></span></pre></div>
<a id="trunkToolsWinLauncherstdafxh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/stdafx.h (174663 => 174664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/stdafx.h        2014-10-13 22:46:59 UTC (rev 174663)
+++ trunk/Tools/WinLauncher/stdafx.h        2014-10-13 23:10:20 UTC (rev 174664)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> #include &lt;windows.h&gt;
</span><span class="cx"> #include &lt;wininet.h&gt;
</span><span class="cx"> #include &lt;wtf/ExportMacros.h&gt;
</span><ins>+#include &lt;wtf/Platform.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if 0
</span><span class="cx"> // Visual Studio Leak Detection
</span></span></pre>
</div>
</div>

</body>
</html>