Title: [117085] trunk/Source/WebKit2
Revision
117085
Author
[email protected]
Date
2012-05-15 09:38:03 -0700 (Tue, 15 May 2012)

Log Message

Guard some AppKit-specific code in WebKit2 with USE(APPKIT)
https://bugs.webkit.org/show_bug.cgi?id=86444

Reviewed by Sam Weinig.

* Shared/NativeWebKeyboardEvent.h:
(NativeWebKeyboardEvent):
(WebKit::NativeWebKeyboardEvent::nativeEvent):
* Shared/NativeWebMouseEvent.h:
(NativeWebMouseEvent):
(WebKit::NativeWebMouseEvent::nativeEvent):
* Shared/NativeWebWheelEvent.h:
(NativeWebWheelEvent):
(WebKit::NativeWebWheelEvent::nativeEvent):
* Shared/mac/ArgumentCodersMac.h:
(CoreIPC):
* Shared/mac/ArgumentCodersMac.mm:
(CoreIPC::typeFromObject):
(CoreIPC::encode):
(CoreIPC::decode):
* Shared/mac/WebEventFactory.mm:
* WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
(WebKit::WebPopupMenu::setUpPlatformData):
* WebProcess/mac/WebProcessMainMac.mm:
(WebKit::WebProcessMain):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (117084 => 117085)


--- trunk/Source/WebKit2/ChangeLog	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-15 16:38:03 UTC (rev 117085)
@@ -1,3 +1,31 @@
+2012-05-14  Andy Estes  <[email protected]>
+
+        Guard some AppKit-specific code in WebKit2 with USE(APPKIT)
+        https://bugs.webkit.org/show_bug.cgi?id=86444
+
+        Reviewed by Sam Weinig.
+
+        * Shared/NativeWebKeyboardEvent.h:
+        (NativeWebKeyboardEvent):
+        (WebKit::NativeWebKeyboardEvent::nativeEvent):
+        * Shared/NativeWebMouseEvent.h:
+        (NativeWebMouseEvent):
+        (WebKit::NativeWebMouseEvent::nativeEvent):
+        * Shared/NativeWebWheelEvent.h:
+        (NativeWebWheelEvent):
+        (WebKit::NativeWebWheelEvent::nativeEvent):
+        * Shared/mac/ArgumentCodersMac.h:
+        (CoreIPC):
+        * Shared/mac/ArgumentCodersMac.mm:
+        (CoreIPC::typeFromObject):
+        (CoreIPC::encode):
+        (CoreIPC::decode):
+        * Shared/mac/WebEventFactory.mm:
+        * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
+        (WebKit::WebPopupMenu::setUpPlatformData):
+        * WebProcess/mac/WebProcessMainMac.mm:
+        (WebKit::WebProcessMain):
+
 2012-05-15  Dinu Jacob  <[email protected]>
 
         [Qt][WK2] fast/loader/create-frame-in-DOMContentLoaded.html crashes

Modified: trunk/Source/WebKit2/Shared/NativeWebKeyboardEvent.h (117084 => 117085)


--- trunk/Source/WebKit2/Shared/NativeWebKeyboardEvent.h	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/Shared/NativeWebKeyboardEvent.h	2012-05-15 16:38:03 UTC (rev 117085)
@@ -46,7 +46,7 @@
 
 class NativeWebKeyboardEvent : public WebKeyboardEvent {
 public:
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     NativeWebKeyboardEvent(NSEvent *, NSView *);
 #elif PLATFORM(WIN)
     NativeWebKeyboardEvent(HWND, UINT message, WPARAM, LPARAM);
@@ -60,7 +60,7 @@
     NativeWebKeyboardEvent(const Evas_Event_Key_Up*);
 #endif
 
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     NSEvent *nativeEvent() const { return m_nativeEvent.get(); }
 #elif PLATFORM(WIN)
     const MSG* nativeEvent() const { return &m_nativeEvent; }
@@ -73,7 +73,7 @@
 #endif
 
 private:
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     RetainPtr<NSEvent> m_nativeEvent;
 #elif PLATFORM(WIN)
     MSG m_nativeEvent;

Modified: trunk/Source/WebKit2/Shared/NativeWebMouseEvent.h (117084 => 117085)


--- trunk/Source/WebKit2/Shared/NativeWebMouseEvent.h	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/Shared/NativeWebMouseEvent.h	2012-05-15 16:38:03 UTC (rev 117085)
@@ -44,7 +44,7 @@
 
 class NativeWebMouseEvent : public WebMouseEvent {
 public:
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     NativeWebMouseEvent(NSEvent *, NSView *);
 #elif PLATFORM(WIN)
     NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool);
@@ -59,7 +59,7 @@
     NativeWebMouseEvent(const Evas_Event_Mouse_Move*, const Evas_Point*);
 #endif
 
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     NSEvent* nativeEvent() const { return m_nativeEvent.get(); }
 #elif PLATFORM(WIN)
     const MSG* nativeEvent() const { return &m_nativeEvent; }
@@ -72,7 +72,7 @@
 #endif
 
 private:
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     RetainPtr<NSEvent> m_nativeEvent;
 #elif PLATFORM(WIN)
     MSG m_nativeEvent;

Modified: trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h (117084 => 117085)


--- trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h	2012-05-15 16:38:03 UTC (rev 117085)
@@ -44,7 +44,7 @@
 
 class NativeWebWheelEvent : public WebWheelEvent {
 public:
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     NativeWebWheelEvent(NSEvent *, NSView *);
 #elif PLATFORM(WIN)
     NativeWebWheelEvent(HWND, UINT message, WPARAM, LPARAM);
@@ -57,7 +57,7 @@
     NativeWebWheelEvent(const Evas_Event_Mouse_Wheel*, const Evas_Point*);
 #endif
 
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     NSEvent* nativeEvent() const { return m_nativeEvent.get(); }
 #elif PLATFORM(WIN)
     const MSG* nativeEvent() const { return &m_nativeEvent; }
@@ -70,7 +70,7 @@
 #endif
 
 private:
-#if PLATFORM(MAC)
+#if USE(APPKIT)
     RetainPtr<NSEvent> m_nativeEvent;
 #elif PLATFORM(WIN)
     MSG m_nativeEvent;

Modified: trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h (117084 => 117085)


--- trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h	2012-05-15 16:38:03 UTC (rev 117085)
@@ -37,17 +37,21 @@
 void encode(ArgumentEncoder*, NSAttributedString *);
 bool decode(ArgumentDecoder*, RetainPtr<NSAttributedString>&);
 
+#if USE(APPKIT)
 // NSColor
 void encode(ArgumentEncoder*, NSColor *);
 bool decode(ArgumentDecoder*, RetainPtr<NSColor>&);
+#endif
 
 // NSDictionary
 void encode(ArgumentEncoder*, NSDictionary *);
 bool decode(ArgumentDecoder*, RetainPtr<NSDictionary>&);
 
+#if USE(APPKIT)
 // NSFont
 void encode(ArgumentEncoder*, NSFont *);
 bool decode(ArgumentDecoder*, RetainPtr<NSFont>&);
+#endif
 
 // NSNumber
 void encode(ArgumentEncoder*, NSNumber *);

Modified: trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm (117084 => 117085)


--- trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm	2012-05-15 16:38:03 UTC (rev 117085)
@@ -39,9 +39,13 @@
 
 enum NSType {
     NSAttributedStringType,
+#if USE(APPKIT)
     NSColorType,
+#endif
     NSDictionaryType,
+#if USE(APPKIT)
     NSFontType,
+#endif
     NSNumberType,
     NSStringType,
     Unknown,
@@ -53,12 +57,16 @@
 
     if ([object isKindOfClass:[NSAttributedString class]])
         return NSAttributedStringType;
+#if USE(APPKIT)
     if ([object isKindOfClass:[NSColor class]])
         return NSColorType;
+#endif
     if ([object isKindOfClass:[NSDictionary class]])
         return NSDictionaryType;
+#if USE(APPKIT)
     if ([object isKindOfClass:[NSFont class]])
         return NSFontType;
+#endif
     if ([object isKindOfClass:[NSNumber class]])
         return NSNumberType;
     if ([object isKindOfClass:[NSString class]])
@@ -77,15 +85,19 @@
     case NSAttributedStringType:
         encode(encoder, static_cast<NSAttributedString *>(object));
         return;
+#if USE(APPKIT)
     case NSColorType:
         encode(encoder, static_cast<NSColor *>(object));
         return;
+#endif
     case NSDictionaryType:
         encode(encoder, static_cast<NSDictionary *>(object));
         return;
+#if USE(APPKIT)
     case NSFontType:
         encode(encoder, static_cast<NSFont *>(object));
         return;
+#endif
     case NSNumberType:
         encode(encoder, static_cast<NSNumber *>(object));
         return;
@@ -113,6 +125,7 @@
         result = string;
         return true;
     }
+#if USE(APPKIT)
     case NSColorType: {
         RetainPtr<NSColor> color;
         if (!decode(decoder, color))
@@ -120,6 +133,7 @@
         result = color;
         return true;
     }
+#endif
     case NSDictionaryType: {
         RetainPtr<NSDictionary> dictionary;
         if (!decode(decoder, dictionary))
@@ -127,6 +141,7 @@
         result = dictionary;
         return true;
     }
+#if USE(APPKIT)
     case NSFontType: {
         RetainPtr<NSFont> font;
         if (!decode(decoder, font))
@@ -134,6 +149,7 @@
         result = font;
         return true;
     }
+#endif
     case NSNumberType: {
         RetainPtr<NSNumber> number;
         if (!decode(decoder, number))
@@ -226,6 +242,7 @@
     return true;
 }
 
+#if USE(APPKIT)
 void encode(ArgumentEncoder* encoder, NSColor *color)
 {
     encoder->encode(colorFromNSColor(color));
@@ -240,6 +257,7 @@
     result = nsColor(color);
     return true;
 }
+#endif
 
 void encode(ArgumentEncoder* encoder, NSDictionary *dictionary)
 {
@@ -291,7 +309,7 @@
     return true;
 }
 
-
+#if USE(APPKIT)
 void encode(ArgumentEncoder* encoder, NSFont *font)
 {
     // NSFont could use CTFontRef code if we had it in ArgumentCodersCF.
@@ -309,6 +327,7 @@
 
     return true;
 }
+#endif
 
 void encode(ArgumentEncoder* encoder, NSNumber *number)
 {

Modified: trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm (117084 => 117085)


--- trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm	2012-05-15 16:38:03 UTC (rev 117085)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "WebEventFactory.h"
 
+#if USE(APPKIT)
+
 #import "WebKitSystemInterface.h"
 #import <wtf/ASCIICType.h>
 #import <WebCore/PlatformEventFactoryMac.h>
@@ -470,3 +472,5 @@
 #endif
 
 } // namespace WebKit
+
+#endif // USE(APPKIT)

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm (117084 => 117085)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm	2012-05-15 16:38:03 UTC (rev 117085)
@@ -37,6 +37,7 @@
 
 void WebPopupMenu::setUpPlatformData(const IntRect&, PlatformPopupMenuData& data)
 {
+#if USE(APPKIT)
     // FIXME: font will be nil here for custom fonts, we should fix that.
     NSFont *font = m_popupClient->menuStyle().font().primaryFont()->getNSFont();
     if (!font)
@@ -48,6 +49,9 @@
     
     data.fontInfo.fontAttributeDictionary = fontDescriptorAttributes;
     data.shouldPopOver = m_popupClient->shouldPopOver();
+#else
+    UNUSED_PARAM(data);
+#endif
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm (117084 => 117085)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm	2012-05-15 16:34:20 UTC (rev 117084)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm	2012-05-15 16:38:03 UTC (rev 117085)
@@ -52,9 +52,11 @@
 extern "C" kern_return_t bootstrap_register2(mach_port_t, name_t, mach_port_t, uint64_t);
 #endif
 
+#if USE(APPKIT)
 @interface NSApplication (WebNSApplicationDetails)
 -(void)_installAutoreleasePoolsOnCurrentThreadIfNecessary;
 @end
+#endif
 
 #define SHOW_CRASH_REPORTER 1
 
@@ -168,12 +170,14 @@
 
     [pool drain];
 
+#if USE(APPKIT)
      // Initialize AppKit.
     [NSApplication sharedApplication];
 
     // Installs autorelease pools on the current CFRunLoop which prevents memory from accumulating between user events.
     // FIXME: Remove when <rdar://problem/8929426> is fixed.
     [[NSApplication sharedApplication] _installAutoreleasePoolsOnCurrentThreadIfNecessary];
+#endif
 
     WKAXRegisterRemoteApp();
     
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to