Commit a67418ff authored by bdakin@apple.com's avatar bdakin@apple.com

WebCore: This fixes the layering violation I committed yesterday by moving

Page::instanceHandle into its own file just in the WebCore 
namespace.

Reviewed by Anders Carlsson.

Added WebCoreInstanceHandle.h + .cpp and removed PageWin.cpp
* WebCore.vcproj/WebCore.vcproj:
* page/win/PageWin.cpp: Removed.

Remove all instance handle code from Page.
* page/Page.h:

New files.
* platform/win/WebCoreInstanceHandle.cpp: Added.
* platform/win/WebCoreInstanceHandle.h: Added.
(WebCore::setInstanceHandle):
(WebCore::instanceHandle):

Switch to WebCore::instanceHandle() instead of 
Page::instanceHandle() and include the new header.
* platform/graphics/win/WKCACFLayerRenderer.cpp:
(WebCore::WKCACFLayerRenderer::acceleratedCompositingAvailable):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::Pasteboard):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::show):
(WebCore::PopupMenu::registerClass):
* platform/win/SharedTimerWin.cpp:
(WebCore::initializeOffScreenTimerWindow):
* plugins/win/PluginViewWin.cpp:
(WebCore::registerPluginView):
(WebCore::PluginView::platformStart):

WebKit/win: WebCore::Page::setInstanceHandle() is now just 
WebCore::setInstanceHandle()

Reviewed by Anders Carlsson.

* WebKitDLL.cpp:
(DllMain):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 40779bc1
2010-03-04 Beth Dakin <bdakin@apple.com>
Reviewed by Anders Carlsson.
This fixes the layering violation I committed yesterday by moving
Page::instanceHandle into its own file just in the WebCore
namespace.
Added WebCoreInstanceHandle.h + .cpp and removed PageWin.cpp
* WebCore.vcproj/WebCore.vcproj:
* page/win/PageWin.cpp: Removed.
Remove all instance handle code from Page.
* page/Page.h:
New files.
* platform/win/WebCoreInstanceHandle.cpp: Added.
* platform/win/WebCoreInstanceHandle.h: Added.
(WebCore::setInstanceHandle):
(WebCore::instanceHandle):
Switch to WebCore::instanceHandle() instead of
Page::instanceHandle() and include the new header.
* platform/graphics/win/WKCACFLayerRenderer.cpp:
(WebCore::WKCACFLayerRenderer::acceleratedCompositingAvailable):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::Pasteboard):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::show):
(WebCore::PopupMenu::registerClass):
* platform/win/SharedTimerWin.cpp:
(WebCore::initializeOffScreenTimerWindow):
* plugins/win/PluginViewWin.cpp:
(WebCore::registerPluginView):
(WebCore::PluginView::platformStart):
2010-03-04 Antonio Gomes <tonikitoo@webkit.org>
Unreviewed build fix.
......
......@@ -21095,10 +21095,6 @@
RelativePath="..\page\win\FrameWin.h"
>
</File>
<File
RelativePath="..\page\win\PageWin.cpp"
>
</File>
</Filter>
</Filter>
<Filter
......@@ -22269,6 +22265,14 @@
RelativePath="..\platform\win\WCDataObject.h"
>
</File>
<File
RelativePath="..\platform\win\WebCoreInstanceHandle.cpp"
>
</File>
<File
RelativePath="..\platform\win\WebCoreInstanceHandle.h"
>
</File>
<File
RelativePath="..\WebCorePrefix.cpp"
>
......
......@@ -31,10 +31,6 @@
#include "SchedulePair.h"
#endif
#if PLATFORM(WIN) || (PLATFORM(WX) && OS(WINDOWS)) || (PLATFORM(QT) && defined(Q_WS_WIN))
typedef struct HINSTANCE__* HINSTANCE;
#endif
namespace JSC {
class Debugger;
}
......@@ -207,12 +203,6 @@ namespace WebCore {
void setDebugger(JSC::Debugger*);
JSC::Debugger* debugger() const { return m_debugger; }
#if PLATFORM(WIN) || (PLATFORM(WX) && OS(WINDOWS)) || (PLATFORM(QT) && defined(Q_WS_WIN))
// The global DLL or application instance used for all windows.
static void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; }
static HINSTANCE instanceHandle() { return s_instanceHandle; }
#endif
static void removeAllVisitedLinks();
static void allVisitedStateChanged(PageGroup*);
......@@ -322,10 +312,6 @@ namespace WebCore {
RefPtr<StorageNamespace> m_sessionStorage;
#endif
#if PLATFORM(WIN) || (PLATFORM(WX) && defined(__WXMSW__)) || (PLATFORM(QT) && defined(Q_WS_WIN))
static HINSTANCE s_instanceHandle;
#endif
#if ENABLE(WML)
OwnPtr<WMLPageState> m_wmlPageState;
#endif
......
......@@ -29,9 +29,9 @@
#include "WKCACFLayerRenderer.h"
#include "Page.h"
#include "WKCACFContextFlusher.h"
#include "WKCACFLayer.h"
#include "WebCoreInstanceHandle.h"
#include <CoreGraphics/CGSRegion.h>
#include <QuartzCore/CACFContext.h>
#include <QuartzCore/CARenderOGL.h>
......@@ -152,7 +152,7 @@ bool WKCACFLayerRenderer::acceleratedCompositingAvailable()
WNDCLASSEX wcex = { 0 };
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.lpfnWndProc = DefWindowProc;
wcex.hInstance = Page::instanceHandle();
wcex.hInstance = WebCore::instanceHandle();
wcex.lpszClassName = L"CoreAnimationTesterWindowClass";
::RegisterClassEx(&wcex);
HWND testWindow = ::CreateWindow(L"CoreAnimationTesterWindowClass", L"CoreAnimationTesterWindow", WS_POPUP, -500, -500, 0, 0, 0, 0, 0, 0);
......
......@@ -40,6 +40,7 @@
#include "Range.h"
#include "RenderImage.h"
#include "TextEncoding.h"
#include "WebCoreInstanceHandle.h"
#include "markup.h"
namespace WebCore {
......@@ -88,7 +89,7 @@ Pasteboard::Pasteboard()
WNDCLASSEX wcex = {0};
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.lpfnWndProc = PasteboardOwnerWndProc;
wcex.hInstance = Page::instanceHandle();
wcex.hInstance = WebCore::instanceHandle();
wcex.lpszClassName = L"PasteboardOwnerWindowClass";
::RegisterClassEx(&wcex);
......
......@@ -39,6 +39,7 @@
#include "Scrollbar.h"
#include "ScrollbarTheme.h"
#include "SimpleFontData.h"
#include "WebCoreInstanceHandle.h"
#include <tchar.h>
#include <windows.h>
#include <windowsx.h>
......@@ -140,7 +141,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index)
m_popup = ::CreateWindowEx(exStyle, kPopupWindowClassName, _T("PopupMenu"),
WS_POPUP | WS_BORDER,
m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(),
hostWindow, 0, Page::instanceHandle(), this);
hostWindow, 0, WebCore::instanceHandle(), this);
if (!m_popup)
return;
......@@ -723,7 +724,7 @@ void PopupMenu::registerClass()
wcex.lpfnWndProc = PopupMenuWndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = sizeof(PopupMenu*); // For the PopupMenu pointer
wcex.hInstance = Page::instanceHandle();
wcex.hInstance = WebCore::instanceHandle();
wcex.hIcon = 0;
wcex.hCursor = LoadCursor(0, IDC_ARROW);
wcex.hbrBackground = 0;
......
......@@ -28,6 +28,7 @@
#include "Page.h"
#include "Settings.h"
#include "WebCoreInstanceHandle.h"
#include "Widget.h"
#include <wtf/Assertions.h>
#include <wtf/CurrentTime.h>
......@@ -125,12 +126,12 @@ static void initializeOffScreenTimerWindow()
memset(&wcex, 0, sizeof(WNDCLASSEX));
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.lpfnWndProc = TimerWindowWndProc;
wcex.hInstance = Page::instanceHandle();
wcex.hInstance = WebCore::instanceHandle();
wcex.lpszClassName = kTimerWindowClassName;
RegisterClassEx(&wcex);
timerWindowHandle = CreateWindow(kTimerWindowClassName, 0, 0,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, Page::instanceHandle(), 0);
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, WebCore::instanceHandle(), 0);
timerFiredMessage = RegisterWindowMessage(L"com.apple.WebKit.TimerFired");
}
......
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -10,24 +10,24 @@
* 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 COMPUTER, 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 COMPUTER, 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.
* THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
#include "config.h"
#include "Page.h"
#include "WebCoreInstanceHandle.h"
namespace WebCore {
HINSTANCE Page::s_instanceHandle = 0;
HINSTANCE WebCore::s_instanceHandle;
} // namespace WebCore
/*
* Copyright (C) 2010 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. 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 INC. 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 WebCoreInstanceHandle_h
#define WebCoreInstanceHandle_h
typedef struct HINSTANCE__* HINSTANCE;
namespace WebCore {
// The global DLL or application instance used for all windows.
extern HINSTANCE s_instanceHandle;
static void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; }
static HINSTANCE instanceHandle() { return s_instanceHandle; }
}
#endif // WebCoreInstanceHandle_h
......@@ -60,6 +60,7 @@
#include "RenderWidget.h"
#include "ScriptController.h"
#include "Settings.h"
#include "WebCoreInstanceHandle.h"
#include "c_instance.h"
#include "npruntime_impl.h"
#include "runtime_root.h"
......@@ -288,10 +289,10 @@ static bool registerPluginView()
haveRegisteredWindowClass = true;
#if PLATFORM(QT)
Page::setInstanceHandle((HINSTANCE)(qWinAppInst()));
WebCore::setInstanceHandle((HINSTANCE)(qWinAppInst()));
#endif
ASSERT(Page::instanceHandle());
ASSERT(WebCore::instanceHandle());
#if OS(WINCE)
WNDCLASS wcex = { 0 };
......@@ -308,7 +309,7 @@ static bool registerPluginView()
wcex.lpfnWndProc = DefWindowProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = Page::instanceHandle();
wcex.hInstance = WebCore::instanceHandle();
wcex.hIcon = 0;
wcex.hCursor = LoadCursor(0, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)COLOR_WINDOW;
......@@ -967,7 +968,7 @@ bool PluginView::platformStart()
HWND parentWindowHandle = windowHandleForPageClient(m_parentFrame->view()->hostWindow()->platformPageClient());
HWND window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags,
0, 0, 0, 0, parentWindowHandle, 0, Page::instanceHandle(), 0);
0, 0, 0, 0, parentWindowHandle, 0, WebCore::instanceHandle(), 0);
#if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX))
m_window = window;
......
2010-03-04 Beth Dakin <bdakin@apple.com>
Reviewed by Anders Carlsson.
WebCore::Page::setInstanceHandle() is now just
WebCore::setInstanceHandle()
* WebKitDLL.cpp:
(DllMain):
2010-03-03 Alice Liu <alice.liu@apple.com>
Reviewed by Jon Honeycutt.
......
......@@ -36,6 +36,7 @@
#include <WebCore/PageGroup.h>
#include <WebCore/RenderThemeWin.h>
#include <WebCore/SharedBuffer.h>
#include <WebCore/WebCoreInstanceHandle.h>
#include <WebCore/Widget.h>
#include <wtf/Vector.h>
#include <tchar.h>
......@@ -60,7 +61,7 @@ STDAPI_(BOOL) DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID /*lpRe
case DLL_PROCESS_ATTACH:
gLockCount = gClassCount = 0;
gInstance = hModule;
WebCore::Page::setInstanceHandle(hModule);
WebCore::setInstanceHandle(hModule);
return TRUE;
case DLL_PROCESS_DETACH:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment