<!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>[179088] 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/179088">179088</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-25 10:01:07 -0800 (Sun, 25 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Win] Add WebKit message loop interface.
https://bugs.webkit.org/show_bug.cgi?id=140857

Patch by peavo@outlook.com &lt;peavo@outlook.com&gt; on 2015-01-25
Reviewed by Brent Fulgham.

Added message loop interface which will run the message loop,
and perform required tasks (like calling CFRunLoopRunInMode)
on each iteration of the loop.

Source/WebKit:

* WebKit.vcxproj/WebKit/WebKit.vcxproj: Added new files to project.
* WebKit.vcxproj/WebKit/WebKit.vcxproj.filters: Ditto.

Source/WebKit/win:

* ForEachCoClass.h:
* Interfaces/WebKit.idl:
* Interfaces/WebKitMessageLoop.idl: Added.
* WebKitClassFactory.cpp:
* WebKitMessageLoop.cpp: Added.
(WebKitMessageLoop::WebKitMessageLoop):
(WebKitMessageLoop::~WebKitMessageLoop):
(WebKitMessageLoop::createInstance):
(WebKitMessageLoop::QueryInterface):
(WebKitMessageLoop::AddRef):
(WebKitMessageLoop::Release):
(WebKitMessageLoop::run):
(WebKitMessageLoop::performMessageLoopTasks):
* WebKitMessageLoop.h: Added.

Tools:

* WinLauncher/WinMain.cpp:
(wWinMain): Use new message loop interface.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxproj">trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxprojfilters">trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinForEachCoClassh">trunk/Source/WebKit/win/ForEachCoClass.h</a></li>
<li><a href="#trunkSourceWebKitwinInterfacesWebKitidl">trunk/Source/WebKit/win/Interfaces/WebKit.idl</a></li>
<li><a href="#trunkSourceWebKitwinWebKitClassFactorycpp">trunk/Source/WebKit/win/WebKitClassFactory.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWinLauncherWinMaincpp">trunk/Tools/WinLauncher/WinMain.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitwinInterfacesWebKitMessageLoopidl">trunk/Source/WebKit/win/Interfaces/WebKitMessageLoop.idl</a></li>
<li><a href="#trunkSourceWebKitwinWebKitMessageLoopcpp">trunk/Source/WebKit/win/WebKitMessageLoop.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebKitMessageLooph">trunk/Source/WebKit/win/WebKitMessageLoop.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Source/WebKit/ChangeLog        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-01-25  peavo@outlook.com  &lt;peavo@outlook.com&gt;
+
+        [Win] Add WebKit message loop interface.
+        https://bugs.webkit.org/show_bug.cgi?id=140857
+
+        Reviewed by Brent Fulgham.
+
+        Added message loop interface which will run the message loop,
+        and perform required tasks (like calling CFRunLoopRunInMode)
+        on each iteration of the loop.
+
+        * WebKit.vcxproj/WebKit/WebKit.vcxproj: Added new files to project.
+        * WebKit.vcxproj/WebKit/WebKit.vcxproj.filters: Ditto.
+
</ins><span class="cx"> 2015-01-22  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unused class EmojiFallbackFontSelector.
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -383,6 +383,7 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\win\WebKitLogging.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\..\win\WebKitMessageLoop.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\..\win\WebKitPrefix.cpp&quot;&gt;
</span><span class="cx">       &lt;PrecompiledHeader Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;Create&lt;/PrecompiledHeader&gt;
</span><span class="cx">       &lt;PrecompiledHeader Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;Create&lt;/PrecompiledHeader&gt;
</span><span class="lines">@@ -518,6 +519,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\WebKitDLL.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\WebKitGraphics.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\WebKitLogging.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\..\win\WebKitMessageLoop.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\WebKitPrefix.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\WebKitStatistics.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\WebKitStatisticsPrivate.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -330,6 +330,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\win\Plugins\npapi.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Sources\Plugins&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\..\win\WebKitMessageLoop.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&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;..\..\win\WebCoreSupport\EmbeddedWidget.h&quot;&gt;
</span><span class="lines">@@ -648,6 +651,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginStrategy.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;..\..\win\WebKitMessageLoop.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;None Include=&quot;WebKitPostBuild.cmd&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Source/WebKit/win/ChangeLog        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-01-25  peavo@outlook.com  &lt;peavo@outlook.com&gt;
+
+        [Win] Add WebKit message loop interface.
+        https://bugs.webkit.org/show_bug.cgi?id=140857
+
+        Reviewed by Brent Fulgham.
+
+        Added message loop interface which will run the message loop,
+        and perform required tasks (like calling CFRunLoopRunInMode)
+        on each iteration of the loop.
+
+        * ForEachCoClass.h:
+        * Interfaces/WebKit.idl:
+        * Interfaces/WebKitMessageLoop.idl: Added.
+        * WebKitClassFactory.cpp:
+        * WebKitMessageLoop.cpp: Added.
+        (WebKitMessageLoop::WebKitMessageLoop):
+        (WebKitMessageLoop::~WebKitMessageLoop):
+        (WebKitMessageLoop::createInstance):
+        (WebKitMessageLoop::QueryInterface):
+        (WebKitMessageLoop::AddRef):
+        (WebKitMessageLoop::Release):
+        (WebKitMessageLoop::run):
+        (WebKitMessageLoop::performMessageLoopTasks):
+        * WebKitMessageLoop.h: Added.
+
</ins><span class="cx"> 2015-01-23  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Teach WebKit to provide IAccessible2 'get_language'
</span></span></pre></div>
<a id="trunkSourceWebKitwinForEachCoClassh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ForEachCoClass.h (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ForEachCoClass.h        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Source/WebKit/win/ForEachCoClass.h        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx">     macro(WebGeolocationPosition) \
</span><span class="cx">     macro(WebSerializedJSValue) \
</span><span class="cx">     macro(WebUserContentURLPattern) \
</span><ins>+    macro(WebKitMessageLoop) \
</ins><span class="cx">     // end of macro
</span><span class="cx"> 
</span><span class="cx"> // Everything below this point is deprecated. Please do not use.
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesWebKitidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Interfaces/WebKit.idl (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/WebKit.idl        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Source/WebKit/win/Interfaces/WebKit.idl        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -139,6 +139,7 @@
</span><span class="cx"> #include &quot;IWebView.idl&quot;
</span><span class="cx"> #include &quot;IWebViewPrivate.idl&quot;
</span><span class="cx"> #include &quot;IWebWorkersPrivate.idl&quot;
</span><ins>+#include &quot;WebKitMessageLoop.idl&quot;
</ins><span class="cx"> 
</span><span class="cx"> #define __TYPELIB_VERSION__ __BUILD_NUMBER_MAJOR__##.##__BUILD_NUMBER_MINOR__
</span><span class="cx"> 
</span><span class="lines">@@ -300,4 +301,9 @@
</span><span class="cx">     coclass WebSecurityOrigin {
</span><span class="cx">         [default] interface IWebSecurityOrigin;
</span><span class="cx">     };
</span><ins>+
+    [uuid(21799291-0067-4593-993E-467877FDA58B)]
+    coclass WebKitMessageLoop {
+        [default] interface IWebKitMessageLoop;
+    };
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesWebKitMessageLoopidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/win/Interfaces/WebKitMessageLoop.idl (0 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/WebKitMessageLoop.idl                                (rev 0)
+++ trunk/Source/WebKit/win/Interfaces/WebKitMessageLoop.idl        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 DO_NO_IMPORTS
+import &quot;oaidl.idl&quot;;
+import &quot;ocidl.idl&quot;;
+#endif
+
+[
+    object,
+    oleautomation,
+    uuid(72457E23-F464-4308-931D-539E844DF9C5),
+    pointer_default(unique)
+]
+
+interface IWebKitMessageLoop : IUnknown
+{
+    /*!
+    @method run
+    @abstract Runs the WebKit message loop, and performs required WebKit tasks in the message loop.
+    The host can implement its own message loop, but then it needs to call the performMessageLoopTasks() method
+    for each iteration in its message loop.
+    @param hAccelTable A handle to the keyboard accelerator table for the application.
+    */
+
+    HRESULT run(HACCEL hAccelTable);
+
+    /*!
+    @method performMessageLoopTasks
+    @abstract Performs required message loop WebKit tasks.
+    This method needs to be called from the host message loop, if the host does not use the run() method.
+    */
+
+    HRESULT performMessageLoopTasks();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinWebKitClassFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebKitClassFactory.cpp (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebKitClassFactory.cpp        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Source/WebKit/win/WebKitClassFactory.cpp        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;WebIconDatabase.h&quot;
</span><span class="cx"> #include &quot;WebJavaScriptCollector.h&quot;
</span><span class="cx"> #include &quot;WebKit.h&quot;
</span><ins>+#include &quot;WebKitMessageLoop.h&quot;
</ins><span class="cx"> #include &quot;WebKitStatistics.h&quot;
</span><span class="cx"> #include &quot;WebMutableURLRequest.h&quot;
</span><span class="cx"> #include &quot;WebNotificationCenter.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebKitMessageLoopcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/win/WebKitMessageLoop.cpp (0 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebKitMessageLoop.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/WebKitMessageLoop.cpp        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -0,0 +1,110 @@
</span><ins>+/*
+* Copyright (C) 2015 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;config.h&quot;
+#include &quot;WebKitMessageLoop.h&quot;
+
+#include &quot;WebKitDLL.h&quot;
+
+#if USE(GLIB)
+#include &lt;glib.h&gt;
+#endif
+
+WebKitMessageLoop::WebKitMessageLoop()
+    : m_refCount(0)
+{
+    gClassCount++;
+    gClassNameCount().add(&quot;WebKitMessageLoop&quot;);
+}
+
+WebKitMessageLoop::~WebKitMessageLoop()
+{
+    gClassCount--;
+    gClassNameCount().remove(&quot;WebKitMessageLoop&quot;);
+}
+
+WebKitMessageLoop* WebKitMessageLoop::createInstance()
+{
+    WebKitMessageLoop* instance = new WebKitMessageLoop();
+    instance-&gt;AddRef();
+    return instance;
+}
+
+HRESULT WebKitMessageLoop::QueryInterface(REFIID riid, void** ppvObject)
+{
+    *ppvObject = 0;
+    if (IsEqualGUID(riid, IID_IUnknown))
+        *ppvObject = static_cast&lt;IWebKitMessageLoop*&gt;(this);
+    else if (IsEqualGUID(riid, CLSID_WebKitMessageLoop))
+        *ppvObject = static_cast&lt;WebKitMessageLoop*&gt;(this);
+    else if (IsEqualGUID(riid, IID_IWebKitMessageLoop))
+        *ppvObject = static_cast&lt;IWebKitMessageLoop*&gt;(this);
+    else
+        return E_NOINTERFACE;
+
+    AddRef();
+    return S_OK;
+}
+
+ULONG WebKitMessageLoop::AddRef()
+{
+    return ++m_refCount;
+}
+
+ULONG WebKitMessageLoop::Release()
+{
+    ULONG newRef = --m_refCount;
+    if (!newRef)
+        delete(this);
+
+    return newRef;
+}
+
+HRESULT WebKitMessageLoop::run(HACCEL hAccelTable)
+{
+    MSG msg = { 0 };
+
+    while (GetMessage(&amp;msg, 0, 0, 0)) {
+        performMessageLoopTasks();
+
+        if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;msg)) {
+            TranslateMessage(&amp;msg);
+            DispatchMessage(&amp;msg);
+        }
+    }
+    return S_OK;
+}
+
+HRESULT WebKitMessageLoop::performMessageLoopTasks()
+{
+#if USE(CF)
+    CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
+#endif
+#if USE(GLIB)
+    g_main_context_iteration(0, false);
+#endif
+    return S_OK;
+}
+
</ins></span></pre></div>
<a id="trunkSourceWebKitwinWebKitMessageLooph"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/win/WebKitMessageLoop.h (0 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebKitMessageLoop.h                                (rev 0)
+++ trunk/Source/WebKit/win/WebKitMessageLoop.h        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 WebKitMessageLoop_h
+#define WebKitMessageLoop_h
+
+#include &quot;WebKit.h&quot;
+
+class WebKitMessageLoop : public IWebKitMessageLoop {
+public:
+    WebKitMessageLoop();
+    ~WebKitMessageLoop();
+
+    static WebKitMessageLoop* createInstance();
+
+    // IUnknown
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) override;
+    virtual ULONG STDMETHODCALLTYPE AddRef() override;
+    virtual ULONG STDMETHODCALLTYPE Release() override;
+
+    // IWebKitMessageLoop
+    virtual HRESULT STDMETHODCALLTYPE run(HACCEL hAccelTable) override;
+    virtual HRESULT STDMETHODCALLTYPE performMessageLoopTasks() override;
+
+private:
+    ULONG m_refCount;
+};
+
+#endif
</ins></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Tools/ChangeLog        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-01-25  peavo@outlook.com  &lt;peavo@outlook.com&gt;
+
+        [Win] Add WebKit message loop interface.
+        https://bugs.webkit.org/show_bug.cgi?id=140857
+
+        Reviewed by Brent Fulgham.
+
+        Added message loop interface which will run the message loop,
+        and perform required tasks (like calling CFRunLoopRunInMode)
+        on each iteration of the loop.
+
+        * WinLauncher/WinMain.cpp:
+        (wWinMain): Use new message loop interface.
+
</ins><span class="cx"> 2015-01-24  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         update-webkit’s --internal option is unused
</span></span></pre></div>
<a id="trunkToolsWinLauncherWinMaincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WinLauncher/WinMain.cpp (179087 => 179088)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WinLauncher/WinMain.cpp        2015-01-25 08:20:02 UTC (rev 179087)
+++ trunk/Tools/WinLauncher/WinMain.cpp        2015-01-25 18:01:07 UTC (rev 179088)
</span><span class="lines">@@ -31,10 +31,6 @@
</span><span class="cx"> #include &quot;WinLauncherWebHost.h&quot;
</span><span class="cx"> #include &quot;Common.cpp&quot;
</span><span class="cx"> 
</span><del>-#if USE(GLIB)
-#include &lt;glib.h&gt;
-#endif
-
</del><span class="cx"> int WINAPI wWinMain(HINSTANCE, HINSTANCE, PWSTR, int nCmdShow)
</span><span class="cx"> {
</span><span class="cx"> #ifdef _CRTDBG_MAP_ALLOC
</span><span class="lines">@@ -161,18 +157,14 @@
</span><span class="cx"> 
</span><span class="cx">     // Main message loop:
</span><span class="cx">     __try {
</span><del>-        while (GetMessage(&amp;msg, 0, 0, 0)) {
-#if USE(CF)
-            CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
-#endif
-            if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;msg)) {
-                TranslateMessage(&amp;msg);
-                DispatchMessage(&amp;msg);
-            }
-#if USE(GLIB)
-            g_main_context_iteration(0, false);
-#endif
-        }
</del><ins>+        _com_ptr_t&lt;_com_IIID&lt;IWebKitMessageLoop, &amp;__uuidof(IWebKitMessageLoop)&gt;&gt; messageLoop;
+
+        hr = WebKitCreateInstance(CLSID_WebKitMessageLoop, 0, IID_IWebKitMessageLoop, reinterpret_cast&lt;void**&gt;(&amp;messageLoop.GetInterfacePtr()));
+        if (FAILED(hr))
+            goto exit;
+
+        messageLoop-&gt;run(hAccelTable);
+
</ins><span class="cx">     } __except(createCrashReport(GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { }
</span><span class="cx"> 
</span><span class="cx"> exit:
</span></span></pre>
</div>
</div>

</body>
</html>