Esempio n. 1
0
void UpdateChunk::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_rect);
    encoder.encode(CoreIPC::Attachment(m_data, size(), MACH_MSG_VIRTUAL_COPY, true));
    
    m_data = 0;
}
Esempio n. 2
0
void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments, CoreIPC::ArgumentEncoder& reply)
{
    switch (messageID.get<WebPageProxyMessage::Kind>()) {
        case WebPageProxyMessage::CreateNewPage: {
            WebPageProxy* newPage = createNewPage();
            if (newPage) {
                // FIXME: Pass the real size.
                reply.encode(CoreIPC::In(newPage->pageID(), IntSize(100, 100), 
                                         newPage->pageNamespace()->context()->preferences()->store(),
                                         *(newPage->m_drawingArea.get())));
            } else {
                // FIXME: We should encode a drawing area type here instead.
                reply.encode(CoreIPC::In(static_cast<uint64_t>(0), IntSize(), WebPreferencesStore(), 0));
            }
            break;
        }
        case WebPageProxyMessage::RunJavaScriptAlert: {
            uint64_t frameID;
            String alertText;
            if (!arguments.decode(CoreIPC::Out(frameID, alertText)))
                return;
            runJavaScriptAlert(webFrame(frameID), alertText);
            break;
        }
        default:
            ASSERT_NOT_REACHED();
            break;
    }
}
Esempio n. 3
0
void NPIdentifierData::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_isString);
    if (m_isString)
        encoder.encode(m_string);
    else
        encoder.encode(m_number);
}
Esempio n. 4
0
void WebContextMenuItemData::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encodeEnum(m_type);
    encoder.encodeEnum(m_action);
    encoder.encode(m_title);
    encoder.encode(m_checked);
    encoder.encode(m_enabled);
    encoder.encode(m_submenu);
}
void NetworkResourceLoadParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_request);

    encoder.encode(static_cast<bool>(m_request.httpBody()));
    if (m_request.httpBody()) {
        EncoderAdapter httpBodyEncoderAdapter;
        m_request.httpBody()->encode(httpBodyEncoderAdapter);
        encoder.encode(httpBodyEncoderAdapter.dataReference());
    }

    encoder.encodeEnum(m_priority);
    encoder.encodeEnum(m_contentSniffingPolicy);
    encoder.encodeEnum(m_allowStoredCredentials);
    encoder.encode(m_inPrivateBrowsingMode);
}
void NetworkResourceLoadParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_identifier);
    encoder.encode(m_webPageID);
    encoder.encode(m_webFrameID);
    encoder.encode(m_request);

    encoder.encode(static_cast<bool>(m_request.httpBody()));
    if (m_request.httpBody()) {
        EncoderAdapter httpBodyEncoderAdapter;
        m_request.httpBody()->encode(httpBodyEncoderAdapter);
        encoder.encode(httpBodyEncoderAdapter.dataReference());

        const Vector<FormDataElement>& elements = m_request.httpBody()->elements();
        size_t fileCount = 0;
        for (size_t i = 0, count = elements.size(); i < count; ++i) {
            if (elements[i].m_type == FormDataElement::encodedFile)
                ++fileCount;
        }

        SandboxExtension::HandleArray requestBodySandboxExtensions;
        requestBodySandboxExtensions.allocate(fileCount);
        size_t extensionIndex = 0;
        for (size_t i = 0, count = elements.size(); i < count; ++i) {
            const FormDataElement& element = elements[i];
            if (element.m_type == FormDataElement::encodedFile) {
                const String& path = element.m_shouldGenerateFile ? element.m_generatedFilename : element.m_filename;
                SandboxExtension::createHandle(path, SandboxExtension::ReadOnly, requestBodySandboxExtensions[extensionIndex++]);
            }
        }
        encoder.encode(requestBodySandboxExtensions);
    }

    if (m_request.url().isLocalFile()) {
        SandboxExtension::Handle requestSandboxExtension;
        SandboxExtension::createHandle(m_request.url().fileSystemPath(), SandboxExtension::ReadOnly, requestSandboxExtension);
        encoder.encode(requestSandboxExtension);
    }

    encoder.encodeEnum(m_priority);
    encoder.encodeEnum(m_contentSniffingPolicy);
    encoder.encodeEnum(m_allowStoredCredentials);
    encoder.encode(m_inPrivateBrowsingMode);
}
Esempio n. 7
0
void PluginProcessProxy::didCreateWebProcessConnection(const CoreIPC::MachPort& machPort)
{
    ASSERT(!m_pendingConnectionReplies.isEmpty());

    // Grab the first pending connection reply.
    RefPtr<WebProcessProxy> replyWebProcessProxy = m_pendingConnectionReplies.first().first.release();
    CoreIPC::ArgumentEncoder* reply = m_pendingConnectionReplies.first().second;
    m_pendingConnectionReplies.removeFirst();

    // FIXME: This is Mac specific.
    reply->encode(CoreIPC::MachPort(machPort.port(), MACH_MSG_TYPE_MOVE_SEND));
    replyWebProcessProxy->connection()->sendSyncReply(reply);
}
Esempio n. 8
0
void PluginProcessCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(pluginPath);
    encoder.encode(supportsAsynchronousPluginInitialization);
    encoder.encode(minimumLifetime);
    encoder.encode(terminationTimeout);

#if PLATFORM(MAC)
    encoder.encode(parentProcessName);
    encoder.encode(acceleratedCompositingPort);
    encoder.encode(sandboxProfileDirectoryPath);
#endif
}
Esempio n. 9
0
void PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch()
{
    // The plug-in process must have crashed or exited, send any pending sync replies we might have.
    while (!m_pendingConnectionReplies.isEmpty()) {
        RefPtr<WebProcessProxy> replyWebProcessProxy = m_pendingConnectionReplies.first().first.release();
        CoreIPC::ArgumentEncoder* reply = m_pendingConnectionReplies.first().second;
        m_pendingConnectionReplies.removeFirst();

        // FIXME: This is Mac specific.
        reply->encode(CoreIPC::MachPort(0, MACH_MSG_TYPE_MOVE_SEND));
        replyWebProcessProxy->connection()->sendSyncReply(reply);
    }

    // Tell the plug-in process manager to forget about this plug-in process proxy.
    m_pluginProcessManager->removePluginProcessProxy(this);
    delete this;
}
Esempio n. 10
0
void SecurityOriginData::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(protocol);
    encoder.encode(host);
    encoder.encode(port);
}
Esempio n. 11
0
void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(viewSize);
    encoder.encode(isActive);
    encoder.encode(isFocused);
    encoder.encode(isVisible);
    encoder.encode(isInWindow);

    encoder.encode(store);
    encoder.encodeEnum(drawingAreaType);
    encoder.encode(pageGroupData);
    encoder.encode(drawsBackground);
    encoder.encode(drawsTransparentBackground);
    encoder.encode(areMemoryCacheClientCallsEnabled);
    encoder.encode(useFixedLayout);
    encoder.encode(fixedLayoutSize);
    encoder.encodeEnum(paginationMode);
    encoder.encode(paginationBehavesLikeColumns);
    encoder.encode(pageLength);
    encoder.encode(gapBetweenPages);
    encoder.encode(userAgent);
    encoder.encode(sessionState);
    encoder.encode(highestUsedBackForwardItemID);
    encoder.encode(canRunBeforeUnloadConfirmPanel);
    encoder.encode(canRunModal);
    encoder.encode(deviceScaleFactor);
    encoder.encode(mediaVolume);

#if PLATFORM(MAC)
    encoder.encode(isSmartInsertDeleteEnabled);
    encoder.encodeEnum(layerHostingMode);
    encoder.encode(colorSpace);
#endif

#if PLATFORM(WIN)
    encoder.encode(reinterpret_cast<uint64_t>(nativeWindow));
#endif
}
Esempio n. 12
0
void WebWheelEvent::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    WebEvent::encode(encoder);

    encoder.encode(m_position);
    encoder.encode(m_globalPosition);
    encoder.encode(m_delta);
    encoder.encode(m_wheelTicks);
    encoder.encode(m_granularity);
    encoder.encode(m_directionInvertedFromDevice);
#if PLATFORM(MAC)
    encoder.encode(m_phase);
    encoder.encode(m_momentumPhase);
    encoder.encode(m_hasPreciseScrollingDeltas);
    encoder.encode(m_scrollCount);
    encoder.encode(m_unacceleratedScrollingDelta);
#endif
}
Esempio n. 13
0
void LayerTreeContext::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(coordinatedLayerID);
}
Esempio n. 14
0
void ShareableBitmap::Handle::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_handle);
    encoder.encode(m_size);
    encoder.encode(m_flags);
}