diff options
Diffstat (limited to 'Source/WebKit2/Shared')
| -rw-r--r-- | Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h | 5 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp | 4 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/PrintInfo.cpp | 11 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebBatteryStatus.cpp | 18 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebContextMenuItemData.cpp | 33 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebEvent.cpp | 14 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebGeolocationPosition.cpp | 7 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebMouseEvent.cpp | 39 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebNetworkInfo.cpp | 12 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebPlatformTouchPoint.cpp | 27 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebPopupItem.cpp | 45 | ||||
| -rw-r--r-- | Source/WebKit2/Shared/WebTouchEvent.cpp | 11 |
12 files changed, 175 insertions, 51 deletions
diff --git a/Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h b/Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h index e8194b587..631d053eb 100644 --- a/Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h +++ b/Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h @@ -29,6 +29,7 @@ // Messages sent from the injected bundle to the WebContext. #include "MessageID.h" +#include "StringReference.h" namespace WebContextLegacyMessage { @@ -43,6 +44,10 @@ namespace CoreIPC { template<> struct MessageKindTraits<WebContextLegacyMessage::Kind> { static const MessageClass messageClass = MessageClassWebContextLegacy; + static StringReference messageReceiverName() + { + return StringReference("WebContextLegacyMessage"); + } }; } diff --git a/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp b/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp index 747172504..ff2bef140 100644 --- a/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp +++ b/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp @@ -73,7 +73,7 @@ void NPIdentifierData::encode(CoreIPC::ArgumentEncoder* encoder) const if (m_isString) encoder->encode(m_string); else - encoder->encode(static_cast<int32_t>(m_number)); + encoder->encode(m_number); } bool NPIdentifierData::decode(CoreIPC::ArgumentDecoder* decoder, NPIdentifierData& result) @@ -84,7 +84,7 @@ bool NPIdentifierData::decode(CoreIPC::ArgumentDecoder* decoder, NPIdentifierDat if (result.m_isString) return decoder->decode(result.m_string); - return decoder->decode(static_cast<int32_t>(result.m_number)); + return decoder->decode(result.m_number); } } // namespace WebKit diff --git a/Source/WebKit2/Shared/PrintInfo.cpp b/Source/WebKit2/Shared/PrintInfo.cpp index ce11935ad..107884a07 100644 --- a/Source/WebKit2/Shared/PrintInfo.cpp +++ b/Source/WebKit2/Shared/PrintInfo.cpp @@ -45,7 +45,10 @@ PrintInfo::PrintInfo() void PrintInfo::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(pageSetupScaleFactor, availablePaperWidth, availablePaperHeight)); + encoder->encode(pageSetupScaleFactor); + encoder->encode(availablePaperWidth); + encoder->encode(availablePaperHeight); + #if PLATFORM(GTK) CoreIPC::encode(encoder, printSettings.get()); CoreIPC::encode(encoder, pageSetup.get()); @@ -54,7 +57,11 @@ void PrintInfo::encode(CoreIPC::ArgumentEncoder* encoder) const bool PrintInfo::decode(CoreIPC::ArgumentDecoder* decoder, PrintInfo& info) { - if (!decoder->decode(CoreIPC::Out(info.pageSetupScaleFactor, info.availablePaperWidth, info.availablePaperHeight))) + if (!decoder->decode(info.pageSetupScaleFactor)) + return false; + if (!decoder->decode(info.availablePaperWidth)) + return false; + if (!decoder->decode(info.availablePaperHeight)) return false; #if PLATFORM(GTK) diff --git a/Source/WebKit2/Shared/WebBatteryStatus.cpp b/Source/WebKit2/Shared/WebBatteryStatus.cpp index c8d806da9..30a5e59a1 100644 --- a/Source/WebKit2/Shared/WebBatteryStatus.cpp +++ b/Source/WebKit2/Shared/WebBatteryStatus.cpp @@ -47,12 +47,24 @@ WebBatteryStatus::~WebBatteryStatus() void WebBatteryStatus::Data::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(isCharging, chargingTime, dischargingTime, level)); + encoder->encode(isCharging); + encoder->encode(chargingTime); + encoder->encode(dischargingTime); + encoder->encode(level); } -bool WebBatteryStatus::Data::decode(CoreIPC::ArgumentDecoder* decoder, Data& data) +bool WebBatteryStatus::Data::decode(CoreIPC::ArgumentDecoder* decoder, Data& result) { - return decoder->decode(CoreIPC::Out(data.isCharging, data.chargingTime, data.dischargingTime, data.level)); + if (!decoder->decode(result.isCharging)) + return false; + if (!decoder->decode(result.chargingTime)) + return false; + if (!decoder->decode(result.dischargingTime)) + return false; + if (!decoder->decode(result.level)) + return false; + + return true; } } // namespace WebKit diff --git a/Source/WebKit2/Shared/WebContextMenuItemData.cpp b/Source/WebKit2/Shared/WebContextMenuItemData.cpp index 1eb1c495b..901ce9c47 100644 --- a/Source/WebKit2/Shared/WebContextMenuItemData.cpp +++ b/Source/WebKit2/Shared/WebContextMenuItemData.cpp @@ -106,29 +106,48 @@ void WebContextMenuItemData::setUserData(APIObject* userData) void WebContextMenuItemData::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(static_cast<uint32_t>(m_type), static_cast<uint32_t>(m_action), m_title, m_checked, m_enabled, m_submenu)); + encoder->encodeEnum(m_type); + encoder->encodeEnum(m_action); + encoder->encode(m_title); + encoder->encode(m_checked); + encoder->encode(m_enabled); + encoder->encode(m_submenu); } bool WebContextMenuItemData::decode(CoreIPC::ArgumentDecoder* decoder, WebContextMenuItemData& item) { - uint32_t type; - uint32_t action; + WebCore::ContextMenuItemType type; + if (!decoder->decodeEnum(type)) + return false; + + WebCore::ContextMenuAction action; + if (!decoder->decodeEnum(action)) + return false; + String title; + if (!decoder->decode(title)) + return false; + bool checked; + if (!decoder->decode(checked)) + return false; + bool enabled; - Vector<WebContextMenuItemData> submenu; + if (!decoder->decode(enabled)) + return false; - if (!decoder->decode(CoreIPC::Out(type, action, title, checked, enabled, submenu))) + Vector<WebContextMenuItemData> submenu; + if (!decoder->decode(submenu)) return false; switch (type) { case WebCore::ActionType: case WebCore::SeparatorType: case WebCore::CheckableActionType: - item = WebContextMenuItemData(static_cast<WebCore::ContextMenuItemType>(type), static_cast<WebCore::ContextMenuAction>(action), title, enabled, checked); + item = WebContextMenuItemData(type, action, title, enabled, checked); break; case WebCore::SubmenuType: - item = WebContextMenuItemData(static_cast<WebCore::ContextMenuAction>(action), title, enabled, submenu); + item = WebContextMenuItemData(action, title, enabled, submenu); break; default: ASSERT_NOT_REACHED(); diff --git a/Source/WebKit2/Shared/WebEvent.cpp b/Source/WebKit2/Shared/WebEvent.cpp index 8edc3fd35..70bffa2c1 100644 --- a/Source/WebKit2/Shared/WebEvent.cpp +++ b/Source/WebKit2/Shared/WebEvent.cpp @@ -48,12 +48,20 @@ WebEvent::WebEvent(Type type, Modifiers modifiers, double timestamp) void WebEvent::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(m_type, m_modifiers, m_timestamp)); + encoder->encode(m_type); + encoder->encode(m_modifiers); + encoder->encode(m_timestamp); } -bool WebEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebEvent& t) +bool WebEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebEvent& result) { - return decoder->decode(CoreIPC::Out(t.m_type, t.m_modifiers, t.m_timestamp)); + if (!decoder->decode(result.m_type)) + return false; + if (!decoder->decode(result.m_modifiers)) + return false; + if (!decoder->decode(result.m_timestamp)) + return false; + return true; } } // namespace WebKit diff --git a/Source/WebKit2/Shared/WebGeolocationPosition.cpp b/Source/WebKit2/Shared/WebGeolocationPosition.cpp index c9e36fa37..77d524cf4 100644 --- a/Source/WebKit2/Shared/WebGeolocationPosition.cpp +++ b/Source/WebKit2/Shared/WebGeolocationPosition.cpp @@ -53,15 +53,12 @@ WebGeolocationPosition::~WebGeolocationPosition() void WebGeolocationPosition::Data::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(timestamp, latitude, longitude, accuracy, canProvideAltitude, altitude, canProvideAltitudeAccuracy, altitudeAccuracy, canProvideHeading, heading)); - encoder->encode(CoreIPC::In(canProvideSpeed, speed)); + CoreIPC::SimpleArgumentCoder<WebGeolocationPosition::Data>::encode(encoder, *this); } bool WebGeolocationPosition::Data::decode(CoreIPC::ArgumentDecoder* decoder, Data& data) { - if (!decoder->decode(CoreIPC::Out(data.timestamp, data.latitude, data.longitude, data.accuracy, data.canProvideAltitude, data.altitude, data.canProvideAltitudeAccuracy, data.altitudeAccuracy, data.canProvideHeading, data.heading))) - return false; - return decoder->decode(CoreIPC::Out(data.canProvideSpeed, data.speed)); + return CoreIPC::SimpleArgumentCoder<WebGeolocationPosition::Data>::decode(decoder, data); } } // namespace WebKit diff --git a/Source/WebKit2/Shared/WebMouseEvent.cpp b/Source/WebKit2/Shared/WebMouseEvent.cpp index 7aa7dff23..32e6ac1f3 100644 --- a/Source/WebKit2/Shared/WebMouseEvent.cpp +++ b/Source/WebKit2/Shared/WebMouseEvent.cpp @@ -82,25 +82,44 @@ void WebMouseEvent::encode(CoreIPC::ArgumentEncoder* encoder) const { WebEvent::encode(encoder); + encoder->encode(m_button); + encoder->encode(m_position); + encoder->encode(m_globalPosition); + encoder->encode(m_deltaX); + encoder->encode(m_deltaY); + encoder->encode(m_deltaZ); + encoder->encode(m_clickCount); + #if PLATFORM(WIN) - // Include m_didActivateWebView on Windows. - encoder->encode(CoreIPC::In(m_button, m_position, m_globalPosition, m_deltaX, m_deltaY, m_deltaZ, m_clickCount, m_didActivateWebView)); -#else - encoder->encode(CoreIPC::In(m_button, m_position, m_globalPosition, m_deltaX, m_deltaY, m_deltaZ, m_clickCount)); + encoder->encode(m_didActivateWebView); #endif } -bool WebMouseEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebMouseEvent& t) +bool WebMouseEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebMouseEvent& result) { - if (!WebEvent::decode(decoder, t)) + if (!WebEvent::decode(decoder, result)) return false; + if (!decoder->decode(result.m_button)) + return false; + if (!decoder->decode(result.m_position)) + return false; + if (!decoder->decode(result.m_globalPosition)) + return false; + if (!decoder->decode(result.m_deltaX)) + return false; + if (!decoder->decode(result.m_deltaY)) + return false; + if (!decoder->decode(result.m_deltaZ)) + return false; + if (!decoder->decode(result.m_clickCount)) + return false; #if PLATFORM(WIN) - // Include m_didActivateWebView on Windows. - return decoder->decode(CoreIPC::Out(t.m_button, t.m_position, t.m_globalPosition, t.m_deltaX, t.m_deltaY, t.m_deltaZ, t.m_clickCount, t.m_didActivateWebView)); -#else - return decoder->decode(CoreIPC::Out(t.m_button, t.m_position, t.m_globalPosition, t.m_deltaX, t.m_deltaY, t.m_deltaZ, t.m_clickCount)); + if (!decoder->decode(result.m_didActivateWebView)) + return false; #endif + + return true; } bool WebMouseEvent::isMouseEventType(Type type) diff --git a/Source/WebKit2/Shared/WebNetworkInfo.cpp b/Source/WebKit2/Shared/WebNetworkInfo.cpp index cc31bdccb..a2852341a 100644 --- a/Source/WebKit2/Shared/WebNetworkInfo.cpp +++ b/Source/WebKit2/Shared/WebNetworkInfo.cpp @@ -45,12 +45,18 @@ WebNetworkInfo::~WebNetworkInfo() void WebNetworkInfo::Data::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(bandwidth, metered)); + encoder->encode(bandwidth); + encoder->encode(metered); } -bool WebNetworkInfo::Data::decode(CoreIPC::ArgumentDecoder* decoder, Data& data) +bool WebNetworkInfo::Data::decode(CoreIPC::ArgumentDecoder* decoder, Data& result) { - return decoder->decode(CoreIPC::Out(data.bandwidth, data.metered)); + if (!decoder->decode(result.bandwidth)) + return false; + if (!decoder->decode(result.metered)) + return false; + + return true; } } // namespace WebKit diff --git a/Source/WebKit2/Shared/WebPlatformTouchPoint.cpp b/Source/WebKit2/Shared/WebPlatformTouchPoint.cpp index d86fc7aef..39026e0f5 100644 --- a/Source/WebKit2/Shared/WebPlatformTouchPoint.cpp +++ b/Source/WebKit2/Shared/WebPlatformTouchPoint.cpp @@ -59,12 +59,33 @@ WebPlatformTouchPoint::WebPlatformTouchPoint(unsigned id, TouchPointState state, void WebPlatformTouchPoint::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(m_id, m_state, m_screenPosition, m_position, m_radius, m_rotationAngle, m_force)); + encoder->encode(m_id); + encoder->encode(m_state); + encoder->encode(m_screenPosition); + encoder->encode(m_position); + encoder->encode(m_radius); + encoder->encode(m_rotationAngle); + encoder->encode(m_force); } -bool WebPlatformTouchPoint::decode(CoreIPC::ArgumentDecoder* decoder, WebPlatformTouchPoint& t) +bool WebPlatformTouchPoint::decode(CoreIPC::ArgumentDecoder* decoder, WebPlatformTouchPoint& result) { - return decoder->decode(CoreIPC::Out(t.m_id, t.m_state, t.m_screenPosition, t.m_position, t.m_radius, t.m_rotationAngle, t.m_force)); + if (!decoder->decode(result.m_id)) + return false; + if (!decoder->decode(result.m_state)) + return false; + if (!decoder->decode(result.m_screenPosition)) + return false; + if (!decoder->decode(result.m_position)) + return false; + if (!decoder->decode(result.m_radius)) + return false; + if (!decoder->decode(result.m_rotationAngle)) + return false; + if (!decoder->decode(result.m_force)) + return false; + + return true; } } // namespace WebKit diff --git a/Source/WebKit2/Shared/WebPopupItem.cpp b/Source/WebKit2/Shared/WebPopupItem.cpp index c215f3568..07a29e416 100644 --- a/Source/WebKit2/Shared/WebPopupItem.cpp +++ b/Source/WebKit2/Shared/WebPopupItem.cpp @@ -68,29 +68,56 @@ WebPopupItem::WebPopupItem(Type type, const String& text, TextDirection textDire void WebPopupItem::encode(CoreIPC::ArgumentEncoder* encoder) const { - encoder->encode(CoreIPC::In(static_cast<uint32_t>(m_type), m_text, static_cast<uint64_t>(m_textDirection), m_hasTextDirectionOverride, m_toolTip, m_accessibilityText, m_isEnabled, m_isLabel)); - encoder->encode(CoreIPC::In(m_isSelected)); + encoder->encodeEnum(m_type); + encoder->encode(m_text); + encoder->encodeEnum(m_textDirection); + encoder->encode(m_hasTextDirectionOverride); + encoder->encode(m_toolTip); + encoder->encode(m_accessibilityText); + encoder->encode(m_isEnabled); + encoder->encode(m_isLabel); + encoder->encode(m_isSelected); } bool WebPopupItem::decode(CoreIPC::ArgumentDecoder* decoder, WebPopupItem& item) { - uint32_t type; + Type type; + if (!decoder->decodeEnum(type)) + return false; + String text; - uint64_t textDirection; + if (!decoder->decode(text)) + return false; + + TextDirection textDirection; + if (!decoder->decodeEnum(textDirection)) + return false; + bool hasTextDirectionOverride; + if (!decoder->decode(hasTextDirectionOverride)) + return false; + String toolTip; + if (!decoder->decode(toolTip)) + return false; + String accessibilityText; + if (!decoder->decode(accessibilityText)) + return false; + bool isEnabled; - bool isLabel; - bool isSelected; + if (!decoder->decode(isEnabled)) + return false; - if (!decoder->decode(CoreIPC::Out(type, text, textDirection, hasTextDirectionOverride, toolTip, accessibilityText, isEnabled, isLabel))) + bool isLabel; + if (!decoder->decode(isLabel)) return false; - if (!decoder->decode(CoreIPC::Out(isSelected))) + bool isSelected; + if (!decoder->decode(isSelected)) return false; - item = WebPopupItem(static_cast<Type>(type), text, static_cast<TextDirection>(textDirection), hasTextDirectionOverride, toolTip, accessibilityText, isEnabled, isLabel, isSelected); + item = WebPopupItem(type, text, textDirection, hasTextDirectionOverride, toolTip, accessibilityText, isEnabled, isLabel, isSelected); return true; } diff --git a/Source/WebKit2/Shared/WebTouchEvent.cpp b/Source/WebKit2/Shared/WebTouchEvent.cpp index 05d7cd254..7213c78db 100644 --- a/Source/WebKit2/Shared/WebTouchEvent.cpp +++ b/Source/WebKit2/Shared/WebTouchEvent.cpp @@ -44,15 +44,18 @@ void WebTouchEvent::encode(CoreIPC::ArgumentEncoder* encoder) const { WebEvent::encode(encoder); - encoder->encode(CoreIPC::In(m_touchPoints)); + encoder->encode(m_touchPoints); } -bool WebTouchEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebTouchEvent& t) +bool WebTouchEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebTouchEvent& result) { - if (!WebEvent::decode(decoder, t)) + if (!WebEvent::decode(decoder, result)) return false; - return decoder->decode(CoreIPC::Out(t.m_touchPoints)); + if (!decoder->decode(result.m_touchPoints)) + return false; + + return true; } bool WebTouchEvent::isTouchEventType(Type type) |
