bool WebPreferencesStore::decode(IPC::Decoder& decoder, WebPreferencesStore& result)
{
    if (!decoder.decode(result.m_values))
        return false;
    if (!decoder.decode(result.m_overridenDefaults))
        return false;
    return true;
}
Пример #2
0
void PluginProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
{
    ASSERT(decoder.destinationID());

    PluginProxy* pluginProxy = m_plugins.get(decoder.destinationID());
    if (!pluginProxy)
        return;

    pluginProxy->didReceivePluginProxyMessage(connection, decoder);
}
void WebToDatabaseProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
{
#if ENABLE(INDEXED_DATABASE)
    if (decoder.messageReceiverName() == Messages::WebIDBConnectionToServer::messageReceiverName()) {
        auto idbConnection = m_webIDBConnectionsByIdentifier.get(decoder.destinationID());
        if (idbConnection)
            idbConnection->didReceiveMessage(connection, decoder);
        return;
    }
#endif
    
    ASSERT_NOT_REACHED();
}
Пример #4
0
bool GamepadData::decode(IPC::Decoder& decoder, GamepadData& data)
{
    if (!decoder.decode(data.index))
        return false;

    if (!decoder.decode(data.axisValues))
        return false;

    if (!decoder.decode(data.buttonValues))
        return false;

    return true;
}
Пример #5
0
bool Plugin::Parameters::decode(IPC::Decoder& decoder, Parameters& parameters)
{
    String urlString;
    if (!decoder.decode(urlString))
        return false;
    // FIXME: We can't assume that the url passed in here is valid.
    parameters.url = URL(ParsedURLString, urlString);

    if (!decoder.decode(parameters.names))
        return false;
    if (!decoder.decode(parameters.values))
        return false;
    if (!decoder.decode(parameters.mimeType))
        return false;
    if (!decoder.decode(parameters.isFullFramePlugin))
        return false;
    if (!decoder.decode(parameters.shouldUseManualLoader))
        return false;
#if PLATFORM(COCOA)
    if (!decoder.decodeEnum(parameters.layerHostingMode))
        return false;
#endif
    if (parameters.names.size() != parameters.values.size()) {
        decoder.markInvalid();
        return false;
    }

    return true;
}
Пример #6
0
bool WebPlatformTouchPoint::decode(IPC::Decoder& decoder, WebPlatformTouchPoint& result)
{
    if (!decoder.decode(result.m_identifier))
        return false;
    if (!decoder.decode(result.m_location))
        return false;
    if (!decoder.decode(result.m_phase))
        return false;
#if ENABLE(IOS_TOUCH_EVENTS)
    if (!decoder.decode(result.m_force))
        return false;
#endif
    return true;
}
void NetworkConnectionToWebProcess::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
{
    if (decoder.messageReceiverName() == Messages::NetworkConnectionToWebProcess::messageReceiverName()) {
        didReceiveNetworkConnectionToWebProcessMessage(connection, decoder);
        return;
    }

    if (decoder.messageReceiverName() == Messages::NetworkResourceLoader::messageReceiverName()) {
        HashMap<ResourceLoadIdentifier, RefPtr<NetworkResourceLoader>>::iterator loaderIterator = m_networkResourceLoaders.find(decoder.destinationID());
        if (loaderIterator != m_networkResourceLoaders.end())
            loaderIterator->value->didReceiveNetworkResourceLoaderMessage(connection, decoder);
        return;
    }
    
    ASSERT_NOT_REACHED();
}
void NetworkConnectionToWebProcess::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& reply)
{
    if (decoder.messageReceiverName() == Messages::NetworkConnectionToWebProcess::messageReceiverName()) {
        didReceiveSyncNetworkConnectionToWebProcessMessage(connection, decoder, reply);
        return;
    }
    ASSERT_NOT_REACHED();
}
Пример #9
0
bool SharedMemory::Handle::decode(IPC::Decoder& decoder, Handle& handle)
{
    ASSERT(!handle.m_port);
    ASSERT(!handle.m_size);

    uint64_t size;
    if (!decoder.decode(size))
        return false;

    IPC::MachPort machPort;
    if (!decoder.decode(machPort))
        return false;
    
    handle.m_size = size;
    handle.m_port = machPort.port();
    return true;
}
Пример #10
0
bool URLResponse::decode(IPC::Decoder& decoder, RefPtr<Object>& result)
{
    ResourceResponse response;
    if (!decoder.decode(response))
        return false;

    result = create(response);
    return true;
}
Пример #11
0
bool OptionItem::decode(IPC::Decoder& decoder, OptionItem& result)
{
    if (!decoder.decode(result.text))
        return false;

    if (!decoder.decode(result.isGroup))
        return false;

    if (!decoder.decode(result.isSelected))
        return false;

    if (!decoder.decode(result.disabled))
        return false;

    if (!decoder.decode(result.parentGroupID))
        return false;
    
    return true;
}
bool WebPreferencesStore::Value::decode(IPC::Decoder& decoder, Value& result)
{
    Value::Type type;
    if (!decoder.decodeEnum(type))
        return false;
    
    switch (type) {
    case Type::None:
        break;
    case Type::String: {
        String value;
        if (!decoder.decode(value))
            return false;
        result = Value(value);
        break;
    }
    case Type::Bool: {
        bool value;
        if (!decoder.decode(value))
            return false;
        result = Value(value);
        break;
    }
    case Type::UInt32: {
        uint32_t value;
        if (!decoder.decode(value))
            return false;
        result = Value(value);
        break;
    }
    case Type::Double: {
        double value;
        if (!decoder.decode(value))
            return false;
        result = Value(value);
        break;
    }
    default:
        return false;
    }

    return true;
}
Пример #13
0
void PluginProcessConnection::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& replyEncoder)
{
    if (decoder.messageReceiverName() == Messages::NPObjectMessageReceiver::messageReceiverName()) {
        m_npRemoteObjectMap->didReceiveSyncMessage(connection, decoder, replyEncoder);
        return;
    }

    uint64_t destinationID = decoder.destinationID();

    if (!destinationID) {
        didReceiveSyncPluginProcessConnectionMessage(connection, decoder, replyEncoder);
        return;
    }

    PluginProxy* pluginProxy = m_plugins.get(destinationID);
    if (!pluginProxy)
        return;

    pluginProxy->didReceiveSyncPluginProxyMessage(connection, decoder, replyEncoder);
}
Пример #14
0
bool SharedMemory::Handle::decode(IPC::Decoder& decoder, Handle& handle)
{
    ASSERT_ARG(handle, handle.isNull());

    IPC::Attachment attachment;
    if (!decoder.decode(attachment))
        return false;

    handle.adoptAttachment(WTFMove(attachment));
    return true;
}
void WebProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
{
    TemporaryChange<IPC::Connection*> currentConnectionChange(currentConnection, &connection);

    if (decoder.messageReceiverName() == Messages::WebProcessConnection::messageReceiverName()) {
        didReceiveWebProcessConnectionMessage(connection, decoder);
        return;
    }

    if (!decoder.destinationID()) {
        ASSERT_NOT_REACHED();
        return;
    }

    PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
    if (!pluginControllerProxy)
        return;

    PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
    pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, decoder);
}
void WebPage::didReceiveSyncMessage(IPC::Connection* connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& replyEncoder)
{
    if (decoder.messageName() == Messages::WebPage::CreatePlugin::name()) {
        IPC::handleMessage<Messages::WebPage::CreatePlugin>(decoder, *replyEncoder, this, &WebPage::createPlugin);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::RunJavaScriptAlert::name()) {
        IPC::handleMessage<Messages::WebPage::RunJavaScriptAlert>(decoder, *replyEncoder, this, &WebPage::runJavaScriptAlert);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::GetPlugins::name()) {
        IPC::handleMessage<Messages::WebPage::GetPlugins>(decoder, *replyEncoder, this, &WebPage::getPlugins);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::GetPluginProcessConnection::name()) {
        IPC::handleMessageDelayed<Messages::WebPage::GetPluginProcessConnection>(connection, decoder, replyEncoder, this, &WebPage::getPluginProcessConnection);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::TestMultipleAttributes::name()) {
        IPC::handleMessageDelayed<Messages::WebPage::TestMultipleAttributes>(connection, decoder, replyEncoder, this, &WebPage::testMultipleAttributes);
        return;
    }
#if PLATFORM(MAC)
    if (decoder.messageName() == Messages::WebPage::InterpretKeyEvent::name()) {
        IPC::handleMessage<Messages::WebPage::InterpretKeyEvent>(decoder, *replyEncoder, this, &WebPage::interpretKeyEvent);
        return;
    }
#endif
    UNUSED_PARAM(connection);
    UNUSED_PARAM(decoder);
    UNUSED_PARAM(replyEncoder);
    ASSERT_NOT_REACHED();
}
void WebProcessConnection::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& replyEncoder)
{
    TemporaryChange<IPC::Connection*> currentConnectionChange(currentConnection, &connection);

    uint64_t destinationID = decoder.destinationID();

    if (!destinationID) {
        didReceiveSyncWebProcessConnectionMessage(connection, decoder, replyEncoder);
        return;
    }

    if (decoder.messageReceiverName() == Messages::NPObjectMessageReceiver::messageReceiverName()) {
        m_npRemoteObjectMap->didReceiveSyncMessage(connection, decoder, replyEncoder);
        return;
    }

    PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
    if (!pluginControllerProxy)
        return;

    PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
    pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, decoder, replyEncoder);
}
Пример #18
0
bool WebPopupItem::decode(IPC::Decoder& decoder, WebPopupItem& item)
{
    Type type;
    if (!decoder.decodeEnum(type))
        return false;

    String text;
    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;
    if (!decoder.decode(isEnabled))
        return false;

    bool isLabel;
    if (!decoder.decode(isLabel))
        return false;

    bool isSelected;
    if (!decoder.decode(isSelected))
        return false;

    item = WebPopupItem(type, text, textDirection, hasTextDirectionOverride, toolTip, accessibilityText, isEnabled, isLabel, isSelected);
    return true;
}
Пример #19
0
bool FontInfo::decode(IPC::Decoder& decoder, FontInfo& fontInfo)
{    
#if PLATFORM(COCOA)
    bool hasFontAttributeDictionary;
    if (!decoder.decode(hasFontAttributeDictionary))
        return false;

    if (!hasFontAttributeDictionary)
        return true;

    if (!IPC::decode(decoder, fontInfo.fontAttributeDictionary))
        return false;
#else
    UNUSED_PARAM(decoder);
    UNUSED_PARAM(fontInfo);
#endif
    
    return true;
}
Пример #20
0
bool WebTouchEvent::decode(IPC::Decoder& decoder, WebTouchEvent& result)
{
    if (!WebEvent::decode(decoder, result))
        return false;

    if (!decoder.decode(result.m_touchPoints))
        return false;
    if (!decoder.decode(result.m_position))
        return false;
    if (!decoder.decode(result.m_canPreventNativeGestures))
        return false;
    if (!decoder.decode(result.m_isPotentialTap))
        return false;
    if (!decoder.decode(result.m_isGesture))
        return false;
    if (!decoder.decode(result.m_gestureScale))
        return false;
    if (!decoder.decode(result.m_gestureRotation))
        return false;

    return true;
}
bool WebPageCreationParameters::decode(IPC::Decoder& decoder, WebPageCreationParameters& parameters)
{
    if (!decoder.decode(parameters.viewSize))
        return false;
    if (!decoder.decode(parameters.viewState))
        return false;
    if (!decoder.decode(parameters.store))
        return false;
    if (!decoder.decodeEnum(parameters.drawingAreaType))
        return false;
    if (!decoder.decode(parameters.pageGroupData))
        return false;
    if (!decoder.decode(parameters.drawsBackground))
        return false;
    if (!decoder.decode(parameters.isEditable))
        return false;
    if (!decoder.decode(parameters.underlayColor))
        return false;
    if (!decoder.decode(parameters.useFixedLayout))
        return false;
    if (!decoder.decode(parameters.fixedLayoutSize))
        return false;
    if (!decoder.decodeEnum(parameters.paginationMode))
        return false;
    if (!decoder.decode(parameters.paginationBehavesLikeColumns))
        return false;
    if (!decoder.decode(parameters.pageLength))
        return false;
    if (!decoder.decode(parameters.gapBetweenPages))
        return false;
    if (!decoder.decode(parameters.paginationLineGridEnabled))
        return false;
    if (!decoder.decode(parameters.userAgent))
        return false;
    if (!decoder.decode(parameters.itemStates))
        return false;
    if (!decoder.decode(parameters.sessionID))
        return false;
    if (!decoder.decode(parameters.highestUsedBackForwardItemID))
        return false;
    if (!decoder.decode(parameters.userContentControllerID))
        return false;
    if (!decoder.decode(parameters.visitedLinkTableID))
        return false;
    if (!decoder.decode(parameters.websiteDataStoreID))
        return false;
    if (!decoder.decode(parameters.canRunBeforeUnloadConfirmPanel))
        return false;
    if (!decoder.decode(parameters.canRunModal))
        return false;
    if (!decoder.decode(parameters.deviceScaleFactor))
        return false;
    if (!decoder.decode(parameters.viewScaleFactor))
        return false;
    if (!decoder.decode(parameters.topContentInset))
        return false;
    if (!decoder.decode(parameters.mediaVolume))
        return false;
    if (!decoder.decode(parameters.muted))
        return false;
    if (!decoder.decode(parameters.mayStartMediaWhenInWindow))
        return false;
    if (!decoder.decode(parameters.minimumLayoutSize))
        return false;
    if (!decoder.decode(parameters.autoSizingShouldExpandToViewHeight))
        return false;
    if (!decoder.decodeEnum(parameters.scrollPinningBehavior))
        return false;
    if (!decoder.decode(parameters.scrollbarOverlayStyle))
        return false;
    if (!decoder.decode(parameters.backgroundExtendsBeyondPage))
        return false;
    if (!decoder.decodeEnum(parameters.layerHostingMode))
        return false;
    if (!decoder.decode(parameters.mimeTypesWithCustomContentProviders))
        return false;
    if (!decoder.decode(parameters.controlledByAutomation))
        return false;

#if ENABLE(REMOTE_INSPECTOR)
    if (!decoder.decode(parameters.allowsRemoteInspection))
        return false;
    if (!decoder.decode(parameters.remoteInspectionNameOverride))
        return false;
#endif

#if PLATFORM(MAC)
    if (!decoder.decode(parameters.colorSpace))
        return false;
#endif

#if PLATFORM(IOS)
    if (!decoder.decode(parameters.screenSize))
        return false;
    if (!decoder.decode(parameters.availableScreenSize))
        return false;
    if (!decoder.decode(parameters.textAutosizingWidth))
        return false;
    if (!decoder.decode(parameters.ignoresViewportScaleLimits))
        return false;
#endif

    if (!decoder.decode(parameters.appleMailPaginationQuirkEnabled))
        return false;

    if (!decoder.decode(parameters.shouldScaleViewToFitDocument))
        return false;

    if (!decoder.decodeEnum(parameters.userInterfaceLayoutDirection))
        return false;

    return true;
}
void WebPage::didReceiveMessage(IPC::Connection* connection, IPC::Decoder& decoder)
{
    if (decoder.messageName() == Messages::WebPage::LoadURL::name()) {
        IPC::handleMessage<Messages::WebPage::LoadURL>(decoder, this, &WebPage::loadURL);
        return;
    }
#if ENABLE(TOUCH_EVENTS)
    if (decoder.messageName() == Messages::WebPage::LoadSomething::name()) {
        IPC::handleMessage<Messages::WebPage::LoadSomething>(decoder, this, &WebPage::loadSomething);
        return;
    }
#endif
#if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION || SOME_OTHER_MESSAGE_CONDITION))
    if (decoder.messageName() == Messages::WebPage::TouchEvent::name()) {
        IPC::handleMessage<Messages::WebPage::TouchEvent>(decoder, this, &WebPage::touchEvent);
        return;
    }
#endif
#if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION && SOME_OTHER_MESSAGE_CONDITION))
    if (decoder.messageName() == Messages::WebPage::AddEvent::name()) {
        IPC::handleMessage<Messages::WebPage::AddEvent>(decoder, this, &WebPage::addEvent);
        return;
    }
#endif
#if ENABLE(TOUCH_EVENTS)
    if (decoder.messageName() == Messages::WebPage::LoadSomethingElse::name()) {
        IPC::handleMessage<Messages::WebPage::LoadSomethingElse>(decoder, this, &WebPage::loadSomethingElse);
        return;
    }
#endif
    if (decoder.messageName() == Messages::WebPage::DidReceivePolicyDecision::name()) {
        IPC::handleMessage<Messages::WebPage::DidReceivePolicyDecision>(decoder, this, &WebPage::didReceivePolicyDecision);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::Close::name()) {
        IPC::handleMessage<Messages::WebPage::Close>(decoder, this, &WebPage::close);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::PreferencesDidChange::name()) {
        IPC::handleMessage<Messages::WebPage::PreferencesDidChange>(decoder, this, &WebPage::preferencesDidChange);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::SendDoubleAndFloat::name()) {
        IPC::handleMessage<Messages::WebPage::SendDoubleAndFloat>(decoder, this, &WebPage::sendDoubleAndFloat);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::SendInts::name()) {
        IPC::handleMessage<Messages::WebPage::SendInts>(decoder, this, &WebPage::sendInts);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::TestParameterAttributes::name()) {
        IPC::handleMessage<Messages::WebPage::TestParameterAttributes>(decoder, this, &WebPage::testParameterAttributes);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::TemplateTest::name()) {
        IPC::handleMessage<Messages::WebPage::TemplateTest>(decoder, this, &WebPage::templateTest);
        return;
    }
    if (decoder.messageName() == Messages::WebPage::SetVideoLayerID::name()) {
        IPC::handleMessage<Messages::WebPage::SetVideoLayerID>(decoder, this, &WebPage::setVideoLayerID);
        return;
    }
#if PLATFORM(MAC)
    if (decoder.messageName() == Messages::WebPage::DidCreateWebProcessConnection::name()) {
        IPC::handleMessage<Messages::WebPage::DidCreateWebProcessConnection>(decoder, this, &WebPage::didCreateWebProcessConnection);
        return;
    }
#endif
#if ENABLE(DEPRECATED_FEATURE)
    if (decoder.messageName() == Messages::WebPage::DeprecatedOperation::name()) {
        IPC::handleMessage<Messages::WebPage::DeprecatedOperation>(decoder, this, &WebPage::deprecatedOperation);
        return;
    }
#endif
#if ENABLE(EXPERIMENTAL_FEATURE)
    if (decoder.messageName() == Messages::WebPage::ExperimentalOperation::name()) {
        IPC::handleMessage<Messages::WebPage::ExperimentalOperation>(decoder, this, &WebPage::experimentalOperation);
        return;
    }
#endif
    UNUSED_PARAM(connection);
    UNUSED_PARAM(decoder);
    ASSERT_NOT_REACHED();
}
Пример #23
0
bool AssistedNodeInformation::decode(IPC::Decoder& decoder, AssistedNodeInformation& result)
{
    if (!decoder.decode(result.elementRect))
        return false;

    if (!decoder.decode(result.selectionRect))
        return false;

    if (!decoder.decode(result.minimumScaleFactor))
        return false;

    if (!decoder.decode(result.maximumScaleFactor))
        return false;

    if (!decoder.decode(result.nodeFontSize))
        return false;

    if (!decoder.decode(result.hasNextNode))
        return false;

    if (!decoder.decode(result.hasPreviousNode))
        return false;

    if (!decoder.decode(result.isAutocorrect))
        return false;

    if (!decoder.decode(result.isRTL))
        return false;

    if (!decoder.decodeEnum(result.autocapitalizeType))
        return false;

    if (!decoder.decodeEnum(result.elementType))
        return false;

    if (!decoder.decode(result.formAction))
        return false;

    if (!decoder.decode(result.selectOptions))
        return false;

    if (!decoder.decode(result.selectedIndex))
        return false;

    if (!decoder.decode(result.isMultiSelect))
        return false;

    if (!decoder.decode(result.isReadOnly))
        return false;

    if (!decoder.decode(result.allowsUserScaling))
        return false;
    
    if (!decoder.decode(result.allowsUserScalingIgnoringForceAlwaysScaling))
        return false;

    if (!decoder.decode(result.insideFixedPosition))
        return false;

    if (!decoder.decode(result.value))
        return false;

    if (!decoder.decode(result.valueAsNumber))
        return false;

    if (!decoder.decode(result.title))
        return false;

    if (!decoder.decodeEnum(result.autofillFieldName))
        return false;

    return true;
}
Пример #24
0
bool WebMouseEvent::decode(IPC::Decoder& decoder, WebMouseEvent& result)
{
    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(MAC)
    if (!decoder.decode(result.m_eventNumber))
        return false;
    if (!decoder.decode(result.m_menuTypeForEvent))
        return false;
#endif
    if (!decoder.decode(result.m_force))
        return false;

    if (!decoder.decode(result.m_syntheticClickType))
        return false;

    return true;
}