Exemplo n.º 1
0
bool ContextMenuContextData::decode(IPC::ArgumentDecoder& decoder, ContextMenuContextData& result)
{
    if (!decoder.decode(result.m_menuLocation))
        return false;

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

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

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

#if ENABLE(SERVICE_CONTROLS)
    ShareableBitmap::Handle handle;
    if (!decoder.decode(handle))
        return false;

    if (!handle.isNull())
        result.m_controlledImage = ShareableBitmap::create(handle, SharedMemory::Protection::ReadOnly);
#endif

    return true;
}
Exemplo n.º 2
0
bool WebPreferencesStore::decode(IPC::ArgumentDecoder& decoder, WebPreferencesStore& result)
{
    if (!decoder.decode(result.m_values))
        return false;
    if (!decoder.decode(result.m_overridenDefaults))
        return false;
    return true;
}
Exemplo n.º 3
0
bool BackForwardListState::decode(IPC::ArgumentDecoder& decoder, BackForwardListState& result)
{
    if (!decoder.decode(result.items))
        return false;
    if (!decoder.decode(result.currentIndex))
        return false;

    return true;
}
Exemplo n.º 4
0
bool HTTPBody::decode(IPC::ArgumentDecoder& decoder, HTTPBody& result)
{
    if (!decoder.decode(result.contentType))
        return false;
    if (!decoder.decode(result.elements))
        return false;

    return true;
}
Exemplo n.º 5
0
bool WebsiteData::decode(IPC::ArgumentDecoder& decoder, WebsiteData& result)
{
    if (!decoder.decode(result.entries))
        return false;
    if (!decoder.decode(result.hostNamesWithCookies))
        return false;

    return true;
}
Exemplo n.º 6
0
bool PageState::decode(IPC::ArgumentDecoder& decoder, PageState& result)
{
    if (!decoder.decode(result.title))
        return false;
    if (!decoder.decode(result.mainFrameState))
        return false;

    return true;
}
Exemplo n.º 7
0
bool ShareableBitmap::Handle::decode(IPC::ArgumentDecoder& decoder, Handle& handle)
{
    if (!decoder.decode(handle.m_handle))
        return false;
    if (!decoder.decode(handle.m_size))
        return false;
    if (!decoder.decode(handle.m_flags))
        return false;
    return true;
}
Exemplo n.º 8
0
bool BackForwardListItemState::decode(IPC::ArgumentDecoder& decoder, BackForwardListItemState& result)
{
    if (!decoder.decode(result.identifier))
        return false;

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

    return true;
}
bool WebScriptMessageHandlerHandle::decode(IPC::ArgumentDecoder& decoder, WebScriptMessageHandlerHandle& handle)
{
    if (!decoder.decode(handle.identifier))
        return false;

    if (!decoder.decode(handle.name))
        return false;

    return true;
}
Exemplo n.º 10
0
bool WebUserStyleSheetData::decode(IPC::ArgumentDecoder& decoder, WebUserStyleSheetData& data)
{
    if (!decoder.decode(data.identifier))
        return false;
    if (!decoder.decode(data.worldIdentifier))
        return false;
    if (!decoder.decode(data.userStyleSheet))
        return false;
    return true;
}
bool ShareableResource::Handle::decode(IPC::ArgumentDecoder& decoder, Handle& handle)
{
    if (!decoder.decode(handle.m_handle))
        return false;
    if (!decoder.decode(handle.m_offset))
        return false;
    if (!decoder.decode(handle.m_size))
        return false;
    return true;
}
bool WebCompiledContentExtensionData::decode(IPC::ArgumentDecoder& decoder, WebCompiledContentExtensionData& compiledContentExtensionData)
{
    SharedMemory::Handle handle;
    if (!decoder.decode(handle))
        return false;
    compiledContentExtensionData.data = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly);

    if (!decoder.decode(compiledContentExtensionData.actionsOffset))
        return false;
    if (!decoder.decode(compiledContentExtensionData.actionsSize))
        return false;
    if (!decoder.decode(compiledContentExtensionData.filtersWithoutDomainsBytecodeOffset))
        return false;
    if (!decoder.decode(compiledContentExtensionData.filtersWithoutDomainsBytecodeSize))
        return false;
    if (!decoder.decode(compiledContentExtensionData.filtersWithDomainsBytecodeOffset))
        return false;
    if (!decoder.decode(compiledContentExtensionData.filtersWithDomainsBytecodeSize))
        return false;
    if (!decoder.decode(compiledContentExtensionData.domainFiltersBytecodeOffset))
        return false;
    if (!decoder.decode(compiledContentExtensionData.domainFiltersBytecodeSize))
        return false;

    return true;
}
Exemplo n.º 13
0
bool RemoteScrollingCoordinatorTransaction::decode(IPC::ArgumentDecoder& decoder)
{
    int numNodes;
    if (!decoder.decode(numNodes))
        return false;

    bool hasNewRootNode;
    if (!decoder.decode(hasNewRootNode))
        return false;
    
    m_scrollingStateTree = ScrollingStateTree::create();
    
    for (int i = 0; i < numNodes; ++i) {
        ScrollingNodeType nodeType;
        if (!decoder.decodeEnum(nodeType))
            return false;

        ScrollingNodeID nodeID;
        if (!decoder.decode(nodeID))
            return false;

        ScrollingNodeID parentNodeID;
        if (!decoder.decode(parentNodeID))
            return false;

        m_scrollingStateTree->attachNode(nodeType, nodeID, parentNodeID);
        ScrollingStateNode* newNode = m_scrollingStateTree->stateNodeForID(nodeID);
        ASSERT(newNode);
        ASSERT(!parentNodeID || newNode->parent());
        
        switch (nodeType) {
        case FrameScrollingNode:
        case OverflowScrollingNode:
            if (!decoder.decode(*toScrollingStateScrollingNode(newNode)))
                return false;
            break;
        case FixedNode:
            if (!decoder.decode(*toScrollingStateFixedNode(newNode)))
                return false;
            break;
        case StickyNode:
            if (!decoder.decode(*toScrollingStateStickyNode(newNode)))
                return false;
            break;
        }
    }

    m_scrollingStateTree->setHasNewRootStateNode(hasNewRootNode);

    // Removed nodes
    Vector<ScrollingNodeID> removedNodes;
    if (!decoder.decode(removedNodes))
        return false;
    
    if (removedNodes.size())
        m_scrollingStateTree->setRemovedNodes(removedNodes);

    return true;
}
Exemplo n.º 14
0
bool SecurityOriginData::decode(IPC::ArgumentDecoder& decoder, SecurityOriginData& securityOriginData)
{
    if (!decoder.decode(securityOriginData.protocol))
        return false;
    if (!decoder.decode(securityOriginData.host))
        return false;
    if (!decoder.decode(securityOriginData.port))
        return false;

    return true;
}
Exemplo n.º 15
0
bool PageState::decode(IPC::ArgumentDecoder& decoder, PageState& result)
{
    if (!decoder.decode(result.title))
        return false;
    if (!decoder.decode(result.mainFrameState))
        return false;
    if (!decoder.decodeEnum(result.shouldOpenExternalURLsPolicy) || !isValidEnum(result.shouldOpenExternalURLsPolicy))
        return false;

    return true;
}
Exemplo n.º 16
0
bool WebsiteData::Entry::decode(IPC::ArgumentDecoder& decoder, WebsiteData::Entry& result)
{
    SecurityOriginData securityOriginData;
    if (!decoder.decode(securityOriginData))
        return false;

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

    result.origin = securityOriginData.securityOrigin();
    return true;
}
Exemplo n.º 17
0
bool Plugin::Parameters::decode(IPC::ArgumentDecoder& 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;
}
Exemplo n.º 18
0
bool WebPageGroupData::decode(IPC::ArgumentDecoder& decoder, WebPageGroupData& data)
{
    if (!decoder.decode(data.identifier))
        return false;
    if (!decoder.decode(data.pageGroupID))
        return false;
    if (!decoder.decode(data.visibleToInjectedBundle))
        return false;
    if (!decoder.decode(data.visibleToHistoryClient))
        return false;
    if (!decoder.decode(data.userContentControllerIdentifier))
        return false;
    return true;
}
Exemplo n.º 19
0
bool WebGestureEvent::decode(IPC::ArgumentDecoder& decoder, WebGestureEvent& result)
{
    if (!WebEvent::decode(decoder, result))
        return false;

    if (!decoder.decode(result.m_position))
        return false;
    if (!decoder.decode(result.m_gestureScale))
        return false;
    if (!decoder.decode(result.m_gestureRotation))
        return false;

    return true;
}
Exemplo n.º 20
0
bool PlatformPopupMenuData::decode(IPC::ArgumentDecoder& decoder, PlatformPopupMenuData& data)
{
#if PLATFORM(COCOA)
    if (!decoder.decode(data.fontInfo))
        return false;
    if (!decoder.decode(data.shouldPopOver))
        return false;
#else
    UNUSED_PARAM(decoder);
    UNUSED_PARAM(data);
#endif

    return true;
}
Exemplo n.º 21
0
bool SharedMemory::Handle::decode(IPC::ArgumentDecoder& 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;
}
bool WebCoordinatedSurface::Handle::decode(IPC::ArgumentDecoder& decoder, Handle& handle)
{
    if (!decoder.decode(handle.m_size))
        return false;
    if (!decoder.decode(handle.m_flags))
        return false;
#if USE(GRAPHICS_SURFACE)
    if (!decoder.decode(handle.m_graphicsSurfaceToken))
        return false;
    if (handle.m_graphicsSurfaceToken.isValid())
        return true;
#endif
    if (!decoder.decode(handle.m_bitmapHandle))
        return false;

    return true;
}
Exemplo n.º 23
0
bool URLResponse::decode(IPC::ArgumentDecoder& decoder, RefPtr<Object>& result)
{
    ResourceResponse response;
    if (!decoder.decode(response))
        return false;
    
    result = create(response);
    return true;
}
Exemplo n.º 24
0
bool Data::decode(IPC::ArgumentDecoder& decoder, RefPtr<API::Object>& result)
{
    IPC::DataReference dataReference;
    if (!decoder.decode(dataReference))
        return false;
    
    result = create(dataReference.data(), dataReference.size());
    return true;
}
Exemplo n.º 25
0
bool PageGroupHandle::decode(IPC::ArgumentDecoder& decoder, RefPtr<Object>& result)
{
    WebKit::WebPageGroupData webPageGroupData;
    if (!decoder.decode(webPageGroupData))
        return false;

    result = create(WTFMove(webPageGroupData));
    return true;
}
Exemplo n.º 26
0
bool OptionItem::decode(IPC::ArgumentDecoder& 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;
}
Exemplo n.º 27
0
bool WebPreferencesStore::Value::decode(IPC::ArgumentDecoder& 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;
}
Exemplo n.º 28
0
bool WebTouchEvent::decode(IPC::ArgumentDecoder& decoder, WebTouchEvent& result)
{
    if (!WebEvent::decode(decoder, result))
        return false;

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

    return true;
}
Exemplo n.º 29
0
bool SharedMemory::Handle::decode(IPC::ArgumentDecoder& decoder, Handle& handle)
{
    ASSERT_ARG(handle, handle.isNull());

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

    handle.adoptAttachment(WTFMove(attachment));
    return true;
}
bool QuickLookDocumentData::decode(IPC::ArgumentDecoder& decoder, QuickLookDocumentData& documentData)
{
    uint64_t size;
    if (!decoder.decode(size))
        return false;

    if (!size)
        return true;

    uint8_t* const buffer = static_cast<uint8_t*>(CFAllocatorAllocate(kCFAllocatorDefault, size, 0));
    ASSERT(buffer);

    if (!decoder.decodeFixedLengthData(buffer, size, 1)) {
        CFAllocatorDeallocate(kCFAllocatorDefault, buffer);
        return false;
    }

    documentData.clear();
    documentData.m_data.append(adoptCF(CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, buffer, size, kCFAllocatorDefault)));
    return true;
}