<!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 <peavo@outlook.com> 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 <peavo@outlook.com>
+
+ [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 <akling@apple.com>
</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"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="..\..\win\WebKitLogging.cpp" />
</span><ins>+ <ClCompile Include="..\..\win\WebKitMessageLoop.cpp" />
</ins><span class="cx"> <ClCompile Include="..\..\win\WebKitPrefix.cpp">
</span><span class="cx"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
</span><span class="cx"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
</span><span class="lines">@@ -518,6 +519,7 @@
</span><span class="cx"> <ClInclude Include="..\..\win\WebKitDLL.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebKitGraphics.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebKitLogging.h" />
</span><ins>+ <ClInclude Include="..\..\win\WebKitMessageLoop.h" />
</ins><span class="cx"> <ClInclude Include="..\..\win\WebKitPrefix.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebKitStatistics.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebKitStatisticsPrivate.h" />
</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"> <ClCompile Include="..\..\win\Plugins\npapi.cpp">
</span><span class="cx"> <Filter>Sources\Plugins</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\..\win\WebKitMessageLoop.cpp">
+ <Filter>Sources</Filter>
+ </ClCompile>
</ins><span class="cx"> </ItemGroup>
</span><span class="cx"> <ItemGroup>
</span><span class="cx"> <ClInclude Include="..\..\win\WebCoreSupport\EmbeddedWidget.h">
</span><span class="lines">@@ -648,6 +651,9 @@
</span><span class="cx"> <ClInclude Include="..\..\win\Plugins\PluginStrategy.h">
</span><span class="cx"> <Filter>Header Files</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\..\win\WebKitMessageLoop.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ins><span class="cx"> </ItemGroup>
</span><span class="cx"> <ItemGroup>
</span><span class="cx"> <None Include="WebKitPostBuild.cmd" />
</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 <peavo@outlook.com>
+
+ [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 <bfulgham@apple.com>
</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 "IWebView.idl"
</span><span class="cx"> #include "IWebViewPrivate.idl"
</span><span class="cx"> #include "IWebWorkersPrivate.idl"
</span><ins>+#include "WebKitMessageLoop.idl"
</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 "oaidl.idl";
+import "ocidl.idl";
+#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 "WebIconDatabase.h"
</span><span class="cx"> #include "WebJavaScriptCollector.h"
</span><span class="cx"> #include "WebKit.h"
</span><ins>+#include "WebKitMessageLoop.h"
</ins><span class="cx"> #include "WebKitStatistics.h"
</span><span class="cx"> #include "WebMutableURLRequest.h"
</span><span class="cx"> #include "WebNotificationCenter.h"
</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 "config.h"
+#include "WebKitMessageLoop.h"
+
+#include "WebKitDLL.h"
+
+#if USE(GLIB)
+#include <glib.h>
+#endif
+
+WebKitMessageLoop::WebKitMessageLoop()
+ : m_refCount(0)
+{
+ gClassCount++;
+ gClassNameCount().add("WebKitMessageLoop");
+}
+
+WebKitMessageLoop::~WebKitMessageLoop()
+{
+ gClassCount--;
+ gClassNameCount().remove("WebKitMessageLoop");
+}
+
+WebKitMessageLoop* WebKitMessageLoop::createInstance()
+{
+ WebKitMessageLoop* instance = new WebKitMessageLoop();
+ instance->AddRef();
+ return instance;
+}
+
+HRESULT WebKitMessageLoop::QueryInterface(REFIID riid, void** ppvObject)
+{
+ *ppvObject = 0;
+ if (IsEqualGUID(riid, IID_IUnknown))
+ *ppvObject = static_cast<IWebKitMessageLoop*>(this);
+ else if (IsEqualGUID(riid, CLSID_WebKitMessageLoop))
+ *ppvObject = static_cast<WebKitMessageLoop*>(this);
+ else if (IsEqualGUID(riid, IID_IWebKitMessageLoop))
+ *ppvObject = static_cast<IWebKitMessageLoop*>(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(&msg, 0, 0, 0)) {
+ performMessageLoopTasks();
+
+ if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&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 "WebKit.h"
+
+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 <peavo@outlook.com>
+
+ [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 <mitz@apple.com>
</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 "WinLauncherWebHost.h"
</span><span class="cx"> #include "Common.cpp"
</span><span class="cx">
</span><del>-#if USE(GLIB)
-#include <glib.h>
-#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(&msg, 0, 0, 0)) {
-#if USE(CF)
- CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
-#endif
- if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-#if USE(GLIB)
- g_main_context_iteration(0, false);
-#endif
- }
</del><ins>+ _com_ptr_t<_com_IIID<IWebKitMessageLoop, &__uuidof(IWebKitMessageLoop)>> messageLoop;
+
+ hr = WebKitCreateInstance(CLSID_WebKitMessageLoop, 0, IID_IWebKitMessageLoop, reinterpret_cast<void**>(&messageLoop.GetInterfacePtr()));
+ if (FAILED(hr))
+ goto exit;
+
+ messageLoop->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>