Diff
Modified: trunk/Source/WTF/ChangeLog (153482 => 153483)
--- trunk/Source/WTF/ChangeLog 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WTF/ChangeLog 2013-07-30 18:54:18 UTC (rev 153483)
@@ -1,3 +1,19 @@
+2013-07-30 Patrick Gansterer <[email protected]>
+
+ Move WindowsExtras.h from WebCore to WTF
+ https://bugs.webkit.org/show_bug.cgi?id=118125
+
+ Reviewed by Anders Carlsson.
+
+ Move it to WTF to be able to use the functions in WTF too.
+
+ * wtf/WindowsExtras.h: Renamed from Source/WebCore/platform/win/WindowsExtras.h.
+ (WTF::getRegistryValue):
+ (WTF::getWindowPointer):
+ (WTF::setWindowPointer):
+ * wtf/win/MainThreadWin.cpp:
+ (WTF::initializeMainThreadPlatform):
+
2013-07-29 Carlos Garcia Campos <[email protected]>
Unreviewed. Fix make distcheck.
Copied: trunk/Source/WTF/wtf/WindowsExtras.h (from rev 153482, trunk/Source/WebCore/platform/win/WindowsExtras.h) (0 => 153483)
--- trunk/Source/WTF/wtf/WindowsExtras.h (rev 0)
+++ trunk/Source/WTF/wtf/WindowsExtras.h 2013-07-30 18:54:18 UTC (rev 153483)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2012 Patrick Gansterer <[email protected]>
+ *
+ * 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 AND ITS CONTRIBUTORS "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 OR ITS 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 WindowsExtras_h
+#define WindowsExtras_h
+
+#if OS(WINDOWS)
+
+#include <windows.h>
+#include <objbase.h>
+#include <shlwapi.h>
+
+#ifndef HWND_MESSAGE
+const HWND HWND_MESSAGE = 0;
+#endif
+
+namespace WTF {
+
+inline HRESULT getRegistryValue(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
+{
+#if OS(WINCE)
+ HKEY key;
+ if (::RegOpenKeyExW(hkey, pszSubKey, 0, 0, &key) != ERROR_SUCCESS)
+ return ERROR_INVALID_NAME;
+ HRESULT result = ::RegQueryValueExW(key, pszValue, 0, pdwType, static_cast<LPBYTE>(pvData), pcbData);
+ ::RegCloseKey(key);
+ return result;
+#else
+ return ::SHGetValueW(hkey, pszSubKey, pszValue, pdwType, pvData, pcbData);
+#endif
+}
+
+inline void* getWindowPointer(HWND hWnd, int index)
+{
+#if OS(WINCE)
+ return reinterpret_cast<void*>(::GetWindowLong(hWnd, index));
+#else
+ return reinterpret_cast<void*>(::GetWindowLongPtr(hWnd, index));
+#endif
+}
+
+inline void* setWindowPointer(HWND hWnd, int index, void* value)
+{
+#if OS(WINCE)
+ return reinterpret_cast<void*>(::SetWindowLong(hWnd, index, reinterpret_cast<LONG>(value)));
+#else
+ return reinterpret_cast<void*>(::SetWindowLongPtr(hWnd, index, reinterpret_cast<LONG_PTR>(value)));
+#endif
+}
+
+} // namespace WTF
+
+using WTF::getRegistryValue;
+using WTF::getWindowPointer;
+using WTF::setWindowPointer;
+
+#endif // OS(WINDOWS)
+
+#endif // WindowsExtras_h
Modified: trunk/Source/WTF/wtf/win/MainThreadWin.cpp (153482 => 153483)
--- trunk/Source/WTF/wtf/win/MainThreadWin.cpp 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WTF/wtf/win/MainThreadWin.cpp 2013-07-30 18:54:18 UTC (rev 153483)
@@ -32,7 +32,7 @@
#include "Assertions.h"
#include "Threading.h"
-#include <windows.h>
+#include "WindowsExtras.h"
namespace WTF {
@@ -54,18 +54,14 @@
if (threadingWindowHandle)
return;
- HWND hWndParent = 0;
WNDCLASSW wcex;
memset(&wcex, 0, sizeof(WNDCLASSW));
wcex.lpfnWndProc = ThreadingWindowWndProc;
wcex.lpszClassName = kThreadingWindowClassName;
RegisterClassW(&wcex);
-#if !OS(WINCE)
- hWndParent = HWND_MESSAGE;
-#endif
threadingWindowHandle = CreateWindowW(kThreadingWindowClassName, 0, 0,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, hWndParent, 0, 0, 0);
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, 0, 0);
threadingFiredMessage = RegisterWindowMessageW(L"com.apple.WebKit.MainThreadFired");
initializeCurrentThreadInternal("Main Thread");
Modified: trunk/Source/WebCore/ChangeLog (153482 => 153483)
--- trunk/Source/WebCore/ChangeLog 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/ChangeLog 2013-07-30 18:54:18 UTC (rev 153483)
@@ -1,3 +1,24 @@
+2013-07-30 Patrick Gansterer <[email protected]>
+
+ Move WindowsExtras.h from WebCore to WTF
+ https://bugs.webkit.org/show_bug.cgi?id=118125
+
+ Reviewed by Anders Carlsson.
+
+ Move it to WTF to be able to use the functions in WTF too.
+
+ * platform/PlatformKeyboardEvent.h:
+ * platform/PlatformMouseEvent.h:
+ * platform/PlatformWheelEvent.h:
+ * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
+ * platform/win/MIMETypeRegistryWin.cpp:
+ * platform/win/PasteboardWin.cpp:
+ * platform/win/PopupMenuWin.cpp:
+ * platform/win/RunLoopWin.cpp:
+ * platform/win/SharedTimerWin.cpp:
+ * platform/win/WindowMessageListener.h:
+ * plugins/win/PluginDatabaseWin.cpp:
+
2013-07-30 Christophe Dumez <[email protected]>
Pass column as 4th argument to WorkerGlobalScope.onerror and Window.onerror handlers
Modified: trunk/Source/WebCore/platform/PlatformKeyboardEvent.h (153482 => 153483)
--- trunk/Source/WebCore/platform/PlatformKeyboardEvent.h 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/PlatformKeyboardEvent.h 2013-07-30 18:54:18 UTC (rev 153483)
@@ -28,9 +28,7 @@
#define PlatformKeyboardEvent_h
#include "PlatformEvent.h"
-#if OS(WINDOWS)
-#include "WindowsExtras.h"
-#endif
+#include <wtf/WindowsExtras.h>
#include <wtf/text/WTFString.h>
#if PLATFORM(MAC)
Modified: trunk/Source/WebCore/platform/PlatformMouseEvent.h (153482 => 153483)
--- trunk/Source/WebCore/platform/PlatformMouseEvent.h 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/PlatformMouseEvent.h 2013-07-30 18:54:18 UTC (rev 153483)
@@ -28,9 +28,7 @@
#include "IntPoint.h"
#include "PlatformEvent.h"
-#if OS(WINDOWS)
-#include "WindowsExtras.h"
-#endif
+#include <wtf/WindowsExtras.h>
#if PLATFORM(GTK)
typedef struct _GdkEventButton GdkEventButton;
Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (153482 => 153483)
--- trunk/Source/WebCore/platform/PlatformWheelEvent.h 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h 2013-07-30 18:54:18 UTC (rev 153483)
@@ -28,9 +28,7 @@
#include "IntPoint.h"
#include "PlatformEvent.h"
-#if OS(WINDOWS)
-#include "WindowsExtras.h"
-#endif
+#include <wtf/WindowsExtras.h>
#if PLATFORM(GTK)
typedef struct _GdkEventScroll GdkEventScroll;
Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h (153482 => 153483)
--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h 2013-07-30 18:54:18 UTC (rev 153483)
@@ -26,10 +26,8 @@
#ifndef MediaPlayerPrivateFullscreenWindow_h
#define MediaPlayerPrivateFullscreenWindow_h
-#if OS(WINDOWS)
-#include "WindowsExtras.h"
-#endif
#include <wtf/RefPtr.h>
+#include <wtf/WindowsExtras.h>
#if USE(ACCELERATED_COMPOSITING)
#include "CACFLayerTreeHostClient.h"
Modified: trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp (153482 => 153483)
--- trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp 2013-07-30 18:54:18 UTC (rev 153483)
@@ -26,10 +26,10 @@
#include "config.h"
#include "MIMETypeRegistry.h"
-#include "WindowsExtras.h"
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
#include <wtf/MainThread.h>
+#include <wtf/WindowsExtras.h>
namespace WebCore {
Modified: trunk/Source/WebCore/platform/win/PasteboardWin.cpp (153482 => 153483)
--- trunk/Source/WebCore/platform/win/PasteboardWin.cpp 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/win/PasteboardWin.cpp 2013-07-30 18:54:18 UTC (rev 153483)
@@ -48,8 +48,8 @@
#include "SharedBuffer.h"
#include "TextEncoding.h"
#include "WebCoreInstanceHandle.h"
-#include "WindowsExtras.h"
#include "markup.h"
+#include <wtf/WindowsExtras.h>
#include <wtf/text/CString.h>
namespace WebCore {
Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.cpp (153482 => 153483)
--- trunk/Source/WebCore/platform/win/PopupMenuWin.cpp 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.cpp 2013-07-30 18:54:18 UTC (rev 153483)
@@ -45,7 +45,7 @@
#include "SimpleFontData.h"
#include "TextRun.h"
#include "WebCoreInstanceHandle.h"
-#include "WindowsExtras.h"
+#include <wtf/WindowsExtras.h>
#include <windows.h>
#include <windowsx.h>
Modified: trunk/Source/WebCore/platform/win/RunLoopWin.cpp (153482 => 153483)
--- trunk/Source/WebCore/platform/win/RunLoopWin.cpp 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/win/RunLoopWin.cpp 2013-07-30 18:54:18 UTC (rev 153483)
@@ -26,8 +26,8 @@
#include "config.h"
#include "RunLoop.h"
-#include "WindowsExtras.h"
#include <wtf/CurrentTime.h>
+#include <wtf/WindowsExtras.h>
using namespace std;
Modified: trunk/Source/WebCore/platform/win/SharedTimerWin.cpp (153482 => 153483)
--- trunk/Source/WebCore/platform/win/SharedTimerWin.cpp 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/win/SharedTimerWin.cpp 2013-07-30 18:54:18 UTC (rev 153483)
@@ -32,8 +32,8 @@
#include "Widget.h"
#include <wtf/Assertions.h>
#include <wtf/CurrentTime.h>
+#include <wtf/WindowsExtras.h>
-#include "WindowsExtras.h"
#include <mmsystem.h>
#if PLATFORM(WIN)
Modified: trunk/Source/WebCore/platform/win/WindowMessageListener.h (153482 => 153483)
--- trunk/Source/WebCore/platform/win/WindowMessageListener.h 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/win/WindowMessageListener.h 2013-07-30 18:54:18 UTC (rev 153483)
@@ -29,9 +29,7 @@
#ifndef WindowMessageListener_h
#define WindowMessageListener_h
-#if OS(WINDOWS)
-#include "WindowsExtras.h"
-#endif
+#include <windows.h>
namespace WebCore {
Deleted: trunk/Source/WebCore/platform/win/WindowsExtras.h (153482 => 153483)
--- trunk/Source/WebCore/platform/win/WindowsExtras.h 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/platform/win/WindowsExtras.h 2013-07-30 18:54:18 UTC (rev 153483)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2012 Patrick Gansterer <[email protected]>
- *
- * 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 AND ITS CONTRIBUTORS "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 OR ITS 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 WindowsExtras_h
-#define WindowsExtras_h
-
-#include <windows.h>
-#include <objbase.h>
-#include <shlwapi.h>
-
-namespace WebCore {
-
-#ifndef HWND_MESSAGE
-const HWND HWND_MESSAGE = 0;
-#endif
-
-inline HRESULT getRegistryValue(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData)
-{
-#if OS(WINCE)
- HKEY key;
- if (::RegOpenKeyExW(hkey, pszSubKey, 0, 0, &key) != ERROR_SUCCESS)
- return ERROR_INVALID_NAME;
- HRESULT result = ::RegQueryValueExW(key, pszValue, 0, pdwType, static_cast<LPBYTE>(pvData), pcbData);
- ::RegCloseKey(key);
- return result;
-#else
- return ::SHGetValueW(hkey, pszSubKey, pszValue, pdwType, pvData, pcbData);
-#endif
-}
-
-inline void* getWindowPointer(HWND hWnd, int index)
-{
-#if OS(WINCE)
- return reinterpret_cast<void*>(::GetWindowLong(hWnd, index));
-#else
- return reinterpret_cast<void*>(::GetWindowLongPtr(hWnd, index));
-#endif
-}
-
-inline void* setWindowPointer(HWND hWnd, int index, void* value)
-{
-#if OS(WINCE)
- return reinterpret_cast<void*>(::SetWindowLong(hWnd, index, reinterpret_cast<LONG>(value)));
-#else
- return reinterpret_cast<void*>(::SetWindowLongPtr(hWnd, index, reinterpret_cast<LONG_PTR>(value)));
-#endif
-}
-
-} // namespace WebCore
-
-#endif // WindowsExtras_h
Modified: trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp (153482 => 153483)
--- trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp 2013-07-30 18:28:35 UTC (rev 153482)
+++ trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp 2013-07-30 18:54:18 UTC (rev 153483)
@@ -31,7 +31,7 @@
#include "Frame.h"
#include "KURL.h"
#include "PluginPackage.h"
-#include "WindowsExtras.h"
+#include <wtf/WindowsExtras.h>
#if OS(WINCE)
// WINCE doesn't support Registry Key Access Rights. The parameter should always be 0