From 1c3d0766a28b1c4b4195fe16e31893889606846a Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Wed, 15 Oct 2008 05:15:47 +0000 Subject: [PATCH] 2008-10-10 Darin Fisher Reviewed by Darin Adler. Add some PLATFORM(CHROMIUM) ifdefs to WebCore https://bugs.webkit.org/show_bug.cgi?id=21511 * loader/FTPDirectoryDocument.cpp: * loader/FTPDirectoryParser.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::finishedLoadingDocument): * platform/ContextMenuItem.h: * platform/Cursor.h: * platform/DragData.h: * platform/DragImage.h: * platform/Pasteboard.h: * platform/PlatformKeyboardEvent.h: (WebCore::PlatformKeyboardEvent::isSystemKey): * platform/PlatformMenuDescription.h: * platform/PlatformMouseEvent.h: * platform/PlatformWheelEvent.h: * platform/PopupMenu.h: * platform/ScrollView.h: * platform/Widget.h: * platform/network/NetworkStateNotifier.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@37599 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog | 26 +++++++++++++++++++ WebCore/loader/FTPDirectoryDocument.cpp | 2 +- WebCore/loader/FTPDirectoryParser.cpp | 2 +- WebCore/loader/FrameLoader.cpp | 3 ++- WebCore/platform/ContextMenuItem.h | 2 ++ WebCore/platform/Cursor.h | 4 +++ WebCore/platform/DragData.h | 2 ++ WebCore/platform/DragImage.h | 2 ++ WebCore/platform/Pasteboard.h | 8 ++++++ WebCore/platform/PlatformKeyboardEvent.h | 9 ++++--- WebCore/platform/PlatformMenuDescription.h | 2 ++ WebCore/platform/PlatformMouseEvent.h | 2 +- WebCore/platform/PlatformWheelEvent.h | 2 +- WebCore/platform/PopupMenu.h | 4 +++ WebCore/platform/ScrollView.h | 4 --- WebCore/platform/Widget.h | 4 +++ .../platform/network/NetworkStateNotifier.h | 9 ++++++- 17 files changed, 74 insertions(+), 13 deletions(-) diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index a22b7e55cbbb..b1f3b3bd2070 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,29 @@ +2008-10-10 Darin Fisher + + Reviewed by Darin Adler. + + Add some PLATFORM(CHROMIUM) ifdefs to WebCore + https://bugs.webkit.org/show_bug.cgi?id=21511 + + * loader/FTPDirectoryDocument.cpp: + * loader/FTPDirectoryParser.cpp: + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::finishedLoadingDocument): + * platform/ContextMenuItem.h: + * platform/Cursor.h: + * platform/DragData.h: + * platform/DragImage.h: + * platform/Pasteboard.h: + * platform/PlatformKeyboardEvent.h: + (WebCore::PlatformKeyboardEvent::isSystemKey): + * platform/PlatformMenuDescription.h: + * platform/PlatformMouseEvent.h: + * platform/PlatformWheelEvent.h: + * platform/PopupMenu.h: + * platform/ScrollView.h: + * platform/Widget.h: + * platform/network/NetworkStateNotifier.h: + 2008-10-14 Chris Marrin Reviewed by Darin Adler. diff --git a/WebCore/loader/FTPDirectoryDocument.cpp b/WebCore/loader/FTPDirectoryDocument.cpp index 786762bda57e..b333edb037c8 100644 --- a/WebCore/loader/FTPDirectoryDocument.cpp +++ b/WebCore/loader/FTPDirectoryDocument.cpp @@ -235,7 +235,7 @@ static struct tm *localTimeQt(const time_t *const timep, struct tm *result) } #define localtime_r(x, y) localTimeQt(x, y) -#elif PLATFORM(WIN) && !defined(localtime_r) +#elif PLATFORM(WIN_OS) && !defined(localtime_r) #define localtime_r(x, y) localtime_s((y), (x)) #endif diff --git a/WebCore/loader/FTPDirectoryParser.cpp b/WebCore/loader/FTPDirectoryParser.cpp index ef284db14d26..41e79c6c83f8 100644 --- a/WebCore/loader/FTPDirectoryParser.cpp +++ b/WebCore/loader/FTPDirectoryParser.cpp @@ -51,7 +51,7 @@ static struct tm *gmtimeQt(const time_t *const timep, struct tm *result) } #define gmtime_r(x, y) gmtimeQt(x, y) -#elif PLATFORM(WIN) && !defined(gmtime_r) +#elif PLATFORM(WIN_OS) && !defined(gmtime_r) #define gmtime_r(x, y) gmtime_s((y), (x)) #endif diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index 1887f87c2d58..f62d7aa10e14 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -3022,7 +3022,8 @@ void FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame() void FrameLoader::finishedLoadingDocument(DocumentLoader* loader) { -#if PLATFORM(WIN) + // FIXME: Platforms shouldn't differ here! +#if PLATFORM(WIN) || PLATFORM(CHROMIUM) if (m_creatingInitialEmptyDocument) return; #endif diff --git a/WebCore/platform/ContextMenuItem.h b/WebCore/platform/ContextMenuItem.h index 22e042f91ed6..26f88ecb66e3 100644 --- a/WebCore/platform/ContextMenuItem.h +++ b/WebCore/platform/ContextMenuItem.h @@ -169,6 +169,8 @@ namespace WebCore { }; #elif PLATFORM(WX) typedef wxMenuItem* PlatformMenuItemDescription; +#else + typedef void* PlatformMenuItemDescription; #endif class ContextMenuItem { diff --git a/WebCore/platform/Cursor.h b/WebCore/platform/Cursor.h index 86c615888faa..e53ca0cf06a8 100644 --- a/WebCore/platform/Cursor.h +++ b/WebCore/platform/Cursor.h @@ -38,6 +38,8 @@ typedef HICON HCURSOR; typedef struct _GdkCursor GdkCursor; #elif PLATFORM(QT) #include +#elif PLATFORM(CHROMIUM) +#include "PlatformCursor.h" #endif #if PLATFORM(MAC) @@ -76,6 +78,8 @@ namespace WebCore { typedef QCursor PlatformCursor; #elif PLATFORM(WX) typedef wxCursor* PlatformCursor; +#elif PLATFORM(CHROMIUM) + // See PlatformCursor.h #else typedef void* PlatformCursor; #endif diff --git a/WebCore/platform/DragData.h b/WebCore/platform/DragData.h index 467904d2b9b9..a2c56288f67f 100644 --- a/WebCore/platform/DragData.h +++ b/WebCore/platform/DragData.h @@ -54,6 +54,8 @@ typedef class wxDataObject* DragDataRef; #elif PLATFORM(GTK) // FIXME: this should probably be something gdk-specific typedef void* DragDataRef; +#elif PLATFORM(CHROMIUM) +#include "DragDataRef.h" #endif diff --git a/WebCore/platform/DragImage.h b/WebCore/platform/DragImage.h index 92dc66ae6224..744e4507a80c 100644 --- a/WebCore/platform/DragImage.h +++ b/WebCore/platform/DragImage.h @@ -44,6 +44,8 @@ QT_END_NAMESPACE typedef struct HBITMAP__* HBITMAP; #elif PLATFORM(WX) class wxDragImage; +#elif PLATFORM(CHROMIUM) +#include "DragImageRef.h" #endif //We need to #define YOffset as it needs to be shared with WebKit diff --git a/WebCore/platform/Pasteboard.h b/WebCore/platform/Pasteboard.h index 491b4c55e9ec..f98683f97dee 100644 --- a/WebCore/platform/Pasteboard.h +++ b/WebCore/platform/Pasteboard.h @@ -53,6 +53,10 @@ class NSArray; typedef struct HWND__* HWND; #endif +#if PLATFORM(CHROMIUM) +#include "PasteboardPrivate.h" +#endif + namespace WebCore { #if PLATFORM(MAC) @@ -120,6 +124,10 @@ private: #if PLATFORM(QT) bool m_selectionMode; #endif + +#if PLATFORM(CHROMIUM) + PasteboardPrivate p; +#endif }; } // namespace WebCore diff --git a/WebCore/platform/PlatformKeyboardEvent.h b/WebCore/platform/PlatformKeyboardEvent.h index c0be2efa1b93..4a6bc9e41ec6 100644 --- a/WebCore/platform/PlatformKeyboardEvent.h +++ b/WebCore/platform/PlatformKeyboardEvent.h @@ -132,7 +132,6 @@ namespace WebCore { #if PLATFORM(WIN) PlatformKeyboardEvent(HWND, WPARAM, LPARAM, Type, bool); - bool isSystemKey() const { return m_isSystemKey; } #endif #if PLATFORM(GTK) @@ -149,7 +148,11 @@ namespace WebCore { PlatformKeyboardEvent(wxKeyEvent&); #endif - private: +#if PLATFORM(WIN) || PLATFORM(CHROMIUM) + bool isSystemKey() const { return m_isSystemKey; } +#endif + + protected: Type m_type; String m_text; String m_unmodifiedText; @@ -166,7 +169,7 @@ namespace WebCore { #if PLATFORM(MAC) RetainPtr m_macEvent; #endif -#if PLATFORM(WIN) +#if PLATFORM(WIN) || PLATFORM(CHROMIUM) bool m_isSystemKey; #endif #if PLATFORM(GTK) diff --git a/WebCore/platform/PlatformMenuDescription.h b/WebCore/platform/PlatformMenuDescription.h index 7ecc4ce06654..65537eb3e13a 100644 --- a/WebCore/platform/PlatformMenuDescription.h +++ b/WebCore/platform/PlatformMenuDescription.h @@ -55,6 +55,8 @@ namespace WebCore { typedef GtkMenu* PlatformMenuDescription; #elif PLATFORM(WX) typedef wxMenu* PlatformMenuDescription; +#else + typedef void* PlatformMenuDescription; #endif } // namespace diff --git a/WebCore/platform/PlatformMouseEvent.h b/WebCore/platform/PlatformMouseEvent.h index 9252738d6dd6..1b92153d9986 100644 --- a/WebCore/platform/PlatformMouseEvent.h +++ b/WebCore/platform/PlatformMouseEvent.h @@ -137,7 +137,7 @@ namespace WebCore { #endif - private: + protected: IntPoint m_position; IntPoint m_globalPosition; MouseButton m_button; diff --git a/WebCore/platform/PlatformWheelEvent.h b/WebCore/platform/PlatformWheelEvent.h index ad8852d362c3..fc954edb8ff5 100644 --- a/WebCore/platform/PlatformWheelEvent.h +++ b/WebCore/platform/PlatformWheelEvent.h @@ -116,7 +116,7 @@ namespace WebCore { PlatformWheelEvent(const wxMouseEvent&, const wxPoint&); #endif - private: + protected: #if !PLATFORM(WIN) int horizontalLineMultiplier() const { return cLineMultiplier; } int verticalLineMultiplier() const { return cLineMultiplier; } diff --git a/WebCore/platform/PopupMenu.h b/WebCore/platform/PopupMenu.h index 785ce468e721..fc85d6045f38 100644 --- a/WebCore/platform/PopupMenu.h +++ b/WebCore/platform/PopupMenu.h @@ -57,6 +57,8 @@ typedef struct _GtkWidget GtkWidget; class wxMenu; #include #include +#elif PLATFORM(CHROMIUM) +#include "PopupMenuPrivate.h" #endif namespace WebCore { @@ -173,6 +175,8 @@ private: #elif PLATFORM(WX) wxMenu* m_menu; void OnMenuItemSelected(wxCommandEvent&); +#elif PLATFORM(CHROMIUM) + PopupMenuPrivate p; #endif }; diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h index 1fd7455bfd2d..be14f59c3b06 100644 --- a/WebCore/platform/ScrollView.h +++ b/WebCore/platform/ScrollView.h @@ -42,10 +42,6 @@ typedef struct _GtkAdjustment GtkAdjustment; #endif -#if PLATFORM(WIN) -typedef struct HRGN__* HRGN; -#endif - #if PLATFORM(WX) class wxScrollWinEvent; #endif diff --git a/WebCore/platform/Widget.h b/WebCore/platform/Widget.h index f5f28aa41503..f84600158376 100644 --- a/WebCore/platform/Widget.h +++ b/WebCore/platform/Widget.h @@ -65,6 +65,10 @@ class wxWindow; typedef wxWindow* PlatformWidget; #endif +#if PLATFORM(CHROMIUM) +#include "PlatformWidget.h" +#endif + #include "IntPoint.h" #include "IntRect.h" #include "IntSize.h" diff --git a/WebCore/platform/network/NetworkStateNotifier.h b/WebCore/platform/network/NetworkStateNotifier.h index 22f14a87b3b5..4bc74276fb1b 100644 --- a/WebCore/platform/network/NetworkStateNotifier.h +++ b/WebCore/platform/network/NetworkStateNotifier.h @@ -34,6 +34,10 @@ typedef const struct __CFArray * CFArrayRef; typedef const struct __SCDynamicStore * SCDynamicStoreRef; +#elif PLATFORM(CHROMIUM) + +#include "NetworkStateNotifierPrivate.h" + #elif PLATFORM(WIN) #include @@ -71,10 +75,13 @@ private: void registerForAddressChange(); HANDLE m_waitHandle; OVERLAPPED m_overlapped; + +#elif PLATFORM(CHROMIUM) + NetworkStateNotifierPrivate p; #endif }; -#if !PLATFORM(MAC) && !PLATFORM(WIN) +#if !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(CHROMIUM) inline NetworkStateNotifier::NetworkStateNotifier() : m_isOnLine(true) -- 2.36.0