<!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>[174471] trunk/Tools</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/174471">174471</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-10-08 13:01:28 -0700 (Wed, 08 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Win] Resolve various static analyzer warnings in Tools.
https://bugs.webkit.org/show_bug.cgi?id=137534

Reviewed by Dean Jackson.

* DumpRenderTree/cg/ImageDiffCG.cpp:
(main): User proper printf specifiers.
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::childrenCount): Handle possibility that
gcc_accChildCount returns with an error.
(accessibilityState): Ditto for gcc_accState.
* DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
(DRTDesktopNotificationPresenter::showDesktopNotification): Use proper
check for return value from 'isHTML'. HRESULT is not a boolean and cannot
be treated as such.
* DumpRenderTree/win/DumpRenderTree.cpp:
(DumpRenderTreeWndProc): Avoid possible infinite loop on teardown caused
by comparing an unsigned value as being greater-than zero.
* DumpRenderTree/win/EditingDelegate.cpp:
(dump): Pass proper character pointer type to printf.
(EditingDelegate::shouldBeginEditingInDOMRange): Ditto.
(EditingDelegate::shouldEndEditingInDOMRange): Ditto.
(EditingDelegate::shouldInsertNode): Ditto.
(EditingDelegate::shouldInsertText): Ditto.
(EditingDelegate::shouldDeleteDOMRange): Ditto.
(EditingDelegate::shouldChangeSelectedDOMRange): Ditto.
(EditingDelegate::shouldApplyStyle): Ditto.
* DumpRenderTree/win/EventSender.cpp:
(beginDragWithFilesCallback): Handle possible error case for GlobalAlloc.
* DumpRenderTree/win/EventSender.h: Add proper declaration for HRESULT to match
system headers.
* DumpRenderTree/win/PixelDumpSupportWin.cpp: Handle possible failure
from CreateDIBSection.
* DumpRenderTree/win/UIDelegate.cpp: Ensure proper type is passed to printf.
* TestWebKitAPI/Tests/WTF/MediaTime.cpp: Get rid of workaround for NaN under
older versions of MSVC we no longer support.
* TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp: Use proper types and API
for 64-bit builds.
* TestWebKitAPI/TestsController.cpp: Use NeverDestroyed like a good citizen.
* TestWebKitAPI/TestsController.h: Ditto.
* WinLauncher/Common.cpp: Handle possible failure from GetModuleFileName.
* WinLauncher/WinLauncher.cpp: Make order of operations explicit to avoid
performing bitwise | before the comparison is done.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreecgImageDiffCGcpp">trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp">trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDRTDesktopNotificationPresentercpp">trunk/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDumpRenderTreecpp">trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinEditingDelegatecpp">trunk/Tools/DumpRenderTree/win/EditingDelegate.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinEventSendercpp">trunk/Tools/DumpRenderTree/win/EventSender.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinEventSenderh">trunk/Tools/DumpRenderTree/win/EventSender.h</a></li>
<li><a href="#trunkToolsDumpRenderTreewinPixelDumpSupportWincpp">trunk/Tools/DumpRenderTree/win/PixelDumpSupportWin.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinUIDelegatecpp">trunk/Tools/DumpRenderTree/win/UIDelegate.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFMediaTimecpp">trunk/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitwinWebViewDestructioncpp">trunk/Tools/TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsControllercpp">trunk/Tools/TestWebKitAPI/TestsController.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsControllerh">trunk/Tools/TestWebKitAPI/TestsController.h</a></li>
<li><a href="#trunkToolsWinLauncherCommoncpp">trunk/Tools/WinLauncher/Common.cpp</a></li>
<li><a href="#trunkToolsWinLauncherWinLaunchercpp">trunk/Tools/WinLauncher/WinLauncher.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/ChangeLog        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2014-10-08  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [Win] Resolve various static analyzer warnings in Tools.
+        https://bugs.webkit.org/show_bug.cgi?id=137534
+
+        Reviewed by Dean Jackson.
+
+        * DumpRenderTree/cg/ImageDiffCG.cpp:
+        (main): User proper printf specifiers.
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::childrenCount): Handle possibility that
+        gcc_accChildCount returns with an error.
+        (accessibilityState): Ditto for gcc_accState.
+        * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+        (DRTDesktopNotificationPresenter::showDesktopNotification): Use proper
+        check for return value from 'isHTML'. HRESULT is not a boolean and cannot
+        be treated as such.
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (DumpRenderTreeWndProc): Avoid possible infinite loop on teardown caused
+        by comparing an unsigned value as being greater-than zero.
+        * DumpRenderTree/win/EditingDelegate.cpp:
+        (dump): Pass proper character pointer type to printf.
+        (EditingDelegate::shouldBeginEditingInDOMRange): Ditto.
+        (EditingDelegate::shouldEndEditingInDOMRange): Ditto.
+        (EditingDelegate::shouldInsertNode): Ditto.
+        (EditingDelegate::shouldInsertText): Ditto.
+        (EditingDelegate::shouldDeleteDOMRange): Ditto.
+        (EditingDelegate::shouldChangeSelectedDOMRange): Ditto.
+        (EditingDelegate::shouldApplyStyle): Ditto.
+        * DumpRenderTree/win/EventSender.cpp:
+        (beginDragWithFilesCallback): Handle possible error case for GlobalAlloc.
+        * DumpRenderTree/win/EventSender.h: Add proper declaration for HRESULT to match
+        system headers.
+        * DumpRenderTree/win/PixelDumpSupportWin.cpp: Handle possible failure
+        from CreateDIBSection.
+        * DumpRenderTree/win/UIDelegate.cpp: Ensure proper type is passed to printf.
+        * TestWebKitAPI/Tests/WTF/MediaTime.cpp: Get rid of workaround for NaN under
+        older versions of MSVC we no longer support.
+        * TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp: Use proper types and API
+        for 64-bit builds.
+        * TestWebKitAPI/TestsController.cpp: Use NeverDestroyed like a good citizen.
+        * TestWebKitAPI/TestsController.h: Ditto.
+        * WinLauncher/Common.cpp: Handle possible failure from GetModuleFileName.
+        * WinLauncher/WinLauncher.cpp: Make order of operations explicit to avoid
+        performing bitwise | before the comparison is done.
+
</ins><span class="cx"> 2014-10-08  Ada Chan  &lt;adachan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add a test for WKPageIsPlayingAudio().
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreecgImageDiffCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -223,11 +223,15 @@
</span><span class="cx">                     difference = max(difference, 0.01f); // round to 2 decimal places
</span><span class="cx">                 }
</span><span class="cx">             } else {
</span><del>-                if (CGImageGetWidth(actualImage.get()) != CGImageGetWidth(baselineImage.get()) || CGImageGetHeight(actualImage.get()) != CGImageGetHeight(baselineImage.get()))
-                    fprintf(stderr, &quot;Error: test and reference images have different sizes. Test image is %lux%lu, reference image is %lux%lu\n&quot;,
</del><ins>+                if (CGImageGetWidth(actualImage.get()) != CGImageGetWidth(baselineImage.get()) || CGImageGetHeight(actualImage.get()) != CGImageGetHeight(baselineImage.get())) {
+#if OS(WINDOWS)
+                    fprintf(stderr, &quot;Error: test and reference images have different sizes. Test image is %zux%zu, reference image is %Iux%Iu\n&quot;,
+#else
+                    fprintf(stderr, &quot;Error: test and reference images have different sizes. Test image is %zux%zu, reference image is %zux%zu\n&quot;,
+#endif
</ins><span class="cx">                         CGImageGetWidth(actualImage.get()), CGImageGetHeight(actualImage.get()),
</span><span class="cx">                         CGImageGetWidth(baselineImage.get()), CGImageGetHeight(baselineImage.get()));
</span><del>-                else if (imageHasAlpha(actualImage.get()) != imageHasAlpha(baselineImage.get()))
</del><ins>+                } else if (imageHasAlpha(actualImage.get()) != imageHasAlpha(baselineImage.get()))
</ins><span class="cx">                     fprintf(stderr, &quot;Error: test and reference images differ in alpha. Test image %s alpha, reference image %s alpha.\n&quot;,
</span><span class="cx">                         imageHasAlpha(actualImage.get()) ? &quot;has&quot; : &quot;does not have&quot;,
</span><span class="cx">                         imageHasAlpha(baselineImage.get()) ? &quot;has&quot; : &quot;does not have&quot;);
</span><span class="lines">@@ -239,7 +243,11 @@
</span><span class="cx">                     RetainPtr&lt;CGImageDestinationRef&gt; imageDest = adoptCF(CGImageDestinationCreateWithData(imageData.get(), kUTTypePNG, 1, 0));
</span><span class="cx">                     CGImageDestinationAddImage(imageDest.get(), diffImage.get(), 0);
</span><span class="cx">                     CGImageDestinationFinalize(imageDest.get());
</span><del>-                    printf(&quot;Content-Length: %lu\n&quot;, CFDataGetLength(imageData.get()));
</del><ins>+#if OS(WINDOWS)
+                    printf(&quot;Content-Length: %Iu\n&quot;, static_cast&lt;size_t&gt;(CFDataGetLength(imageData.get())));
+#else
+                    printf(&quot;Content-Length: %zu\n&quot;, static_cast&lt;size_t&gt;(CFDataGetLength(imageData.get())));
+#endif
</ins><span class="cx">                     fwrite(CFDataGetBytePtr(imageData.get()), 1, CFDataGetLength(imageData.get()), stdout);
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -113,7 +113,9 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     long childCount;
</span><del>-    m_element-&gt;get_accChildCount(&amp;childCount);
</del><ins>+    if (FAILED(m_element-&gt;get_accChildCount(&amp;childCount)))
+        return 0;
+
</ins><span class="cx">     return childCount;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -398,7 +400,8 @@
</span><span class="cx"> static DWORD accessibilityState(COMPtr&lt;IAccessible&gt; element)
</span><span class="cx"> {
</span><span class="cx">     VARIANT state;
</span><del>-    element-&gt;get_accState(self(), &amp;state);
</del><ins>+    if (FAILED(element-&gt;get_accState(self(), &amp;state)))
+        return 0;
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(V_VT(&amp;state) == VT_I4);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinDRTDesktopNotificationPresentercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     _bstr_t title, text, url;
</span><span class="cx">     BOOL html;
</span><span class="cx"> 
</span><del>-    if (!notification-&gt;isHTML(&amp;html) &amp;&amp; html) {
</del><ins>+    if (SUCCEEDED(notification-&gt;isHTML(&amp;html)) &amp;&amp; html) {
</ins><span class="cx">         notification-&gt;contentsURL(&amp;url.GetBSTR());    
</span><span class="cx">         printf(&quot;DESKTOP NOTIFICATION: contents at %S\n&quot;, static_cast&lt;wchar_t*&gt;(url));
</span><span class="cx">     } else {
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx"> {
</span><span class="cx">     switch (msg) {
</span><span class="cx">         case WM_DESTROY:
</span><del>-            for (unsigned i = openWindows().size() - 1; i &gt;= 0; --i) {
</del><ins>+            for (long i = openWindows().size() - 1; i &gt;= 0; --i) {
</ins><span class="cx">                 if (openWindows()[i] == hWnd) {
</span><span class="cx">                     openWindows().remove(i);
</span><span class="cx">                     windowToWebViewMap().remove(hWnd);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinEditingDelegatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/EditingDelegate.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/EditingDelegate.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/EditingDelegate.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -114,7 +114,7 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     wchar_t buffer[1024];
</span><del>-    _snwprintf(buffer, ARRAYSIZE(buffer), L&quot;range from %ld of %s to %ld of %s&quot;, startOffset, dumpPath(startContainer.get()), endOffset, dumpPath(endContainer.get()));
</del><ins>+    _snwprintf(buffer, ARRAYSIZE(buffer), L&quot;range from %ld of %s to %ld of %s&quot;, startOffset, dumpPath(startContainer.get()).c_str(), endOffset, dumpPath(endContainer.get()).c_str());
</ins><span class="cx">     return buffer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (::gTestRunner-&gt;dumpEditingCallbacks() &amp;&amp; !done)
</span><del>-        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n&quot;), dump(range));
</del><ins>+        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n&quot;), dump(range).c_str());
</ins><span class="cx"> 
</span><span class="cx">     *result = m_acceptsEditing;
</span><span class="cx">     return S_OK;
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (::gTestRunner-&gt;dumpEditingCallbacks() &amp;&amp; !done)
</span><del>-        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n&quot;), dump(range));
</del><ins>+        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n&quot;), dump(range).c_str());
</ins><span class="cx"> 
</span><span class="cx">     *result = m_acceptsEditing;
</span><span class="cx">     return S_OK;
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     if (::gTestRunner-&gt;dumpEditingCallbacks() &amp;&amp; !done)
</span><del>-        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n&quot;), dumpPath(node), dump(range), insertactionstring[action]);
</del><ins>+        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n&quot;), dumpPath(node).c_str(), dump(range).c_str(), insertactionstring[action]);
</ins><span class="cx"> 
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     if (::gTestRunner-&gt;dumpEditingCallbacks() &amp;&amp; !done)
</span><del>-        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n&quot;), text ? text : TEXT(&quot;&quot;), dump(range), insertactionstring[action]);
</del><ins>+        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n&quot;), text ? text : TEXT(&quot;&quot;), dump(range).c_str(), insertactionstring[action]);
</ins><span class="cx"> 
</span><span class="cx">     *result = m_acceptsEditing;
</span><span class="cx">     return S_OK;
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (::gTestRunner-&gt;dumpEditingCallbacks() &amp;&amp; !done)
</span><del>-        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldDeleteDOMRange:%s\n&quot;), dump(range));
</del><ins>+        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldDeleteDOMRange:%s\n&quot;), dump(range).c_str());
</ins><span class="cx"> 
</span><span class="cx">     *result = m_acceptsEditing;
</span><span class="cx">     return S_OK;
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     if (::gTestRunner-&gt;dumpEditingCallbacks() &amp;&amp; !done)
</span><del>-        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n&quot;), dump(currentRange), dump(proposedRange), affinitystring[selectionAffinity], boolstring[stillSelecting]);
</del><ins>+        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n&quot;), dump(currentRange).c_str(), dump(proposedRange).c_str(), affinitystring[selectionAffinity], boolstring[stillSelecting]);
</ins><span class="cx"> 
</span><span class="cx">     *result = m_acceptsEditing;
</span><span class="cx">     return S_OK;
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (::gTestRunner-&gt;dumpEditingCallbacks() &amp;&amp; !done)
</span><del>-        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n&quot;), TEXT(&quot;'style description'&quot;)/*[[style description] UTF8String]*/, dump(range));
</del><ins>+        _tprintf(TEXT(&quot;EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n&quot;), TEXT(&quot;'style description'&quot;)/*[[style description] UTF8String]*/, dump(range).c_str());
</ins><span class="cx"> 
</span><span class="cx">     *result = m_acceptsEditing;
</span><span class="cx">     return S_OK;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinEventSendercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/EventSender.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/EventSender.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/EventSender.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -696,6 +696,9 @@
</span><span class="cx">     hDropMedium.tymed = TYMED_HGLOBAL;
</span><span class="cx">     SIZE_T dropFilesSize = sizeof(DROPFILES) + (sizeof(WCHAR) * files.size());
</span><span class="cx">     hDropMedium.hGlobal = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, dropFilesSize);
</span><ins>+    if (!hDropMedium.hGlobal)
+        return JSValueMakeUndefined(context);
+
</ins><span class="cx">     DROPFILES* dropFiles = reinterpret_cast&lt;DROPFILES*&gt;(GlobalLock(hDropMedium.hGlobal));
</span><span class="cx">     memset(dropFiles, 0, sizeof(DROPFILES));
</span><span class="cx">     dropFiles-&gt;pFiles = sizeof(DROPFILES);
</span><span class="lines">@@ -710,6 +713,9 @@
</span><span class="cx">     hFileNameMedium.tymed = TYMED_HGLOBAL;
</span><span class="cx">     SIZE_T hFileNameSize = sizeof(WCHAR) * files.size();
</span><span class="cx">     hFileNameMedium.hGlobal = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, hFileNameSize);
</span><ins>+    if (!hFileNameMedium.hGlobal)
+        return JSValueMakeUndefined(context);
+
</ins><span class="cx">     WCHAR* hFileName = static_cast&lt;WCHAR*&gt;(GlobalLock(hFileNameMedium.hGlobal));
</span><span class="cx">     for (size_t i = 0; i &lt; files.size(); i++)
</span><span class="cx">         hFileName[i] = files[i];
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinEventSenderh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/EventSender.h (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/EventSender.h        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/EventSender.h        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -31,7 +31,13 @@
</span><span class="cx"> 
</span><span class="cx"> class DraggingInfo;
</span><span class="cx"> 
</span><del>-typedef long HRESULT;
</del><ins>+#ifdef __midl
+typedef LONG HRESULT;
+#else
+#include &lt;sal.h&gt;
+typedef _Return_type_success_(return &gt;= 0) long HRESULT;
+#endif // __midl
+
</ins><span class="cx"> typedef const struct OpaqueJSContext* JSContextRef;
</span><span class="cx"> typedef struct OpaqueJSValue* JSObjectRef;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinPixelDumpSupportWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/PixelDumpSupportWin.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/PixelDumpSupportWin.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/PixelDumpSupportWin.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> {
</span><span class="cx">     RECT frame;
</span><span class="cx">     if (!GetWindowRect(webViewWindow, &amp;frame))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     BITMAPINFO bmp = {0};
</span><span class="cx">     bmp.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
</span><span class="lines">@@ -69,7 +69,9 @@
</span><span class="cx">     bmp.bmiHeader.biCompression = BI_RGB;
</span><span class="cx"> 
</span><span class="cx">     void* bits = 0;
</span><del>-    HBITMAP bitmap = CreateDIBSection(0, &amp;bmp, DIB_RGB_COLORS, &amp;bits, 0, 0);
</del><ins>+    HBITMAP bitmap = ::CreateDIBSection(0, &amp;bmp, DIB_RGB_COLORS, &amp;bits, 0, 0);
+    if (!bitmap)
+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     auto memoryDC = adoptGDIObject(::CreateCompatibleDC(0));
</span><span class="cx">     ::SelectObject(memoryDC.get(), bitmap);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinUIDelegatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/UIDelegate.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/UIDelegate.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/DumpRenderTree/win/UIDelegate.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -487,7 +487,7 @@
</span><span class="cx">     origin-&gt;port(&amp;port);
</span><span class="cx"> 
</span><span class="cx">     if (!done &amp;&amp; gTestRunner-&gt;dumpDatabaseCallbacks())
</span><del>-        printf(&quot;UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%S, %S, %i} database:%S\n&quot;, protocol, host, port, databaseIdentifier);
</del><ins>+        printf(&quot;UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%S\n&quot;, static_cast&lt;const char*&gt;(protocol), static_cast&lt;const char*&gt;(host), port, databaseIdentifier);
</ins><span class="cx"> 
</span><span class="cx">     unsigned long long defaultQuota = 5 * 1024 * 1024;
</span><span class="cx">     double testDefaultQuota = gTestRunner-&gt;databaseDefaultQuota();
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFMediaTimecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -33,17 +33,6 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace std;
</span><span class="cx"> 
</span><del>-#if COMPILER(MSVC)
-// Work around Visual Studio 2008's lack of an INFINITY or NAN definition.
-#include &lt;limits&gt;
-#if !defined(INFINITY)
-#define INFINITY (numeric_limits&lt;double&gt;::infinity())
-#endif
-#if !defined(NAN)
-#define NAN (numeric_limits&lt;double&gt;::quiet_NaN())
-#endif
-#endif
-
</del><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><span class="cx"> std::ostream&amp; operator&lt;&lt;(std::ostream&amp; out, const MediaTime&amp; val)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitwinWebViewDestructioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -89,14 +89,28 @@
</span><span class="cx">     EXPECT_TRUE(::IsWindow(m_viewWindow));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if defined(_M_X64) || defined(__x86_64__)
+typedef ULONGLONG __tick_count;
+static ULONGLONG currentTickCount()
+{
+    return ::GetTickCount64();
+}
+#else
+typedef DWORD __tick_count;
+static DWORD currentTickCount()
+{
+    return ::GetTickCount();
+}
+#endif
+
</ins><span class="cx"> void WebViewDestruction::runMessagePump(DWORD timeoutMilliseconds)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: We should move this functionality to PlatformUtilities at some point.
</span><span class="cx"> 
</span><del>-    DWORD startTickCount = ::GetTickCount();
</del><ins>+    __tick_count startTickCount = currentTickCount();
</ins><span class="cx">     MSG msg;
</span><span class="cx">     BOOL result;
</span><del>-    while ((result = ::PeekMessageW(&amp;msg, 0, 0, 0, PM_REMOVE)) &amp;&amp; ::GetTickCount() - startTickCount &lt;= timeoutMilliseconds) {
</del><ins>+    while ((result = ::PeekMessageW(&amp;msg, 0, 0, 0, PM_REMOVE)) &amp;&amp; currentTickCount() - startTickCount &lt;= static_cast&lt;__tick_count&gt;(timeoutMilliseconds)) {
</ins><span class="cx">         if (result == -1)
</span><span class="cx">             break;
</span><span class="cx">         ::TranslateMessage(&amp;msg);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestsController.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestsController.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/TestWebKitAPI/TestsController.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> TestsController&amp; TestsController::shared()
</span><span class="cx"> {
</span><del>-    static TestsController&amp; shared = *new TestsController;
</del><ins>+    static NeverDestroyed&lt;TestsController&gt; shared;
</ins><span class="cx">     return shared;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestsController.h (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestsController.h        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/TestWebKitAPI/TestsController.h        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #ifndef TestsController_h
</span><span class="cx"> #define TestsController_h
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
+
</ins><span class="cx"> namespace TestWebKitAPI {
</span><span class="cx"> 
</span><span class="cx"> class TestsController {
</span><span class="lines">@@ -37,6 +39,8 @@
</span><span class="cx"> private:
</span><span class="cx">     TestsController();
</span><span class="cx">     ~TestsController();
</span><ins>+
+    friend class WTF::NeverDestroyed&lt;TestsController&gt;;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre></div>
<a id="trunkToolsWinLauncherCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/Common.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/Common.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/WinLauncher/Common.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -150,7 +150,9 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     wchar_t executablePath[MAX_PATH];
</span><del>-    ::GetModuleFileNameW(0, executablePath, MAX_PATH);
</del><ins>+    if (!::GetModuleFileNameW(0, executablePath, MAX_PATH))
+        return false;
+
</ins><span class="cx">     ::PathRemoveExtensionW(executablePath);
</span><span class="cx"> 
</span><span class="cx">     directory = _bstr_t(appDataDirectory) + L&quot;\\&quot; + ::PathFindFileNameW(executablePath);
</span></span></pre></div>
<a id="trunkToolsWinLauncherWinLaunchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinLauncher.cpp (174470 => 174471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinLauncher.cpp        2014-10-08 19:34:03 UTC (rev 174470)
+++ trunk/Tools/WinLauncher/WinLauncher.cpp        2014-10-08 20:01:28 UTC (rev 174471)
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    UINT backSetting = MF_BYCOMMAND | (backCount) ? MF_ENABLED : MF_DISABLED;
</del><ins>+    UINT backSetting = MF_BYCOMMAND | ((backCount) ? MF_ENABLED : MF_DISABLED);
</ins><span class="cx">     ::EnableMenuItem(menu, IDM_HISTORY_BACKWARD, backSetting);
</span><span class="cx"> 
</span><span class="cx">     int forwardCount = 0;
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    UINT forwardSetting = MF_BYCOMMAND | (forwardCount) ? MF_ENABLED : MF_DISABLED;
</del><ins>+    UINT forwardSetting = MF_BYCOMMAND | ((forwardCount) ? MF_ENABLED : MF_DISABLED);
</ins><span class="cx">     ::EnableMenuItem(menu, IDM_HISTORY_FORWARD, forwardSetting);
</span><span class="cx"> 
</span><span class="cx">     IWebHistoryItemPtr currentItem;
</span></span></pre>
</div>
</div>

</body>
</html>