Пример #1
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;
    }
}
Пример #2
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;
}
Пример #3
0
void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder << viewSize;
    encoder << isActive;
    encoder << isFocused;
    encoder << isVisible;
    encoder << isInWindow;

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

#if PLATFORM(MAC)
    encoder.encodeEnum(layerHostingMode);
    encoder << colorSpace;
#endif
}
Пример #4
0
void NPIdentifierData::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_isString);
    if (m_isString)
        encoder.encode(m_string);
    else
        encoder.encode(m_number);
}
Пример #5
0
void WebContextMenuItemData::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encodeEnum(m_type);
    encoder.encodeEnum(m_action);
    encoder << m_title;
    encoder << m_checked;
    encoder << m_enabled;
    encoder << m_submenu;
}
Пример #6
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);
}
Пример #7
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;
}
void NetworkResourceLoadParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder << m_identifier;
    encoder << m_webPageID;
    encoder << m_webFrameID;
    encoder << m_request;

    encoder << static_cast<bool>(m_request.httpBody());
    if (m_request.httpBody()) {
        EncoderAdapter httpBodyEncoderAdapter;
        m_request.httpBody()->encode(httpBodyEncoderAdapter);
        encoder << 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 << requestBodySandboxExtensions;
    }

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

    encoder.encodeEnum(m_priority);
    encoder.encodeEnum(m_contentSniffingPolicy);
    encoder.encodeEnum(m_allowStoredCredentials);
    encoder << m_inPrivateBrowsingMode;
    encoder << m_shouldClearReferrerOnHTTPSToHTTPRedirect;
}
void SecItemRequestData::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encodeEnum(m_type);

    CoreIPC::encode(encoder, m_queryDictionary.get());

    encoder << static_cast<bool>(m_attributesToMatch);
    if (m_attributesToMatch)
        CoreIPC::encode(encoder, m_attributesToMatch.get());
}
Пример #10
0
void Plugin::Parameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder << url.string();
    encoder << names;
    encoder << values;
    encoder << mimeType;
    encoder << isFullFramePlugin;
    encoder << shouldUseManualLoader;
#if PLATFORM(MAC)
    encoder.encodeEnum(layerHostingMode);
#endif
}
Пример #11
0
void PrintInfo::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder << pageSetupScaleFactor;
    encoder << availablePaperWidth;
    encoder << availablePaperHeight;

#if PLATFORM(GTK)
    CoreIPC::encode(encoder, printSettings.get());
    CoreIPC::encode(encoder, pageSetup.get());
    encoder.encodeEnum(printMode);
#endif
}
Пример #12
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
}
Пример #13
0
void NetworkResourceLoadParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_identifier);
    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 NetworkProcessCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder << privateBrowsingEnabled;
    encoder.encodeEnum(cacheModel);
    encoder << diskCacheDirectory;
    encoder << diskCacheDirectoryExtensionHandle;
    encoder << shouldUseTestingNetworkSession;
#if PLATFORM(MAC)
    encoder << parentProcessName;
    encoder << uiProcessBundleIdentifier;
    encoder << nsURLCacheMemoryCapacity;
    encoder << nsURLCacheDiskCapacity;
#if ENABLE(CUSTOM_PROTOCOLS)
    encoder << urlSchemesRegisteredForCustomProtocols;
#endif
    encoder << httpProxy;
    encoder << httpsProxy;
#endif
}
Пример #15
0
void LayerTreeContext::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(coordinatedLayerID);
}
Пример #16
0
void SecurityOriginData::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(protocol);
    encoder.encode(host);
    encoder.encode(port);
}
Пример #17
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
}
Пример #18
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
}
Пример #19
0
void ShareableBitmap::Handle::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder.encode(m_handle);
    encoder.encode(m_size);
    encoder.encode(m_flags);
}
void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
    encoder << injectedBundlePath;
    encoder << injectedBundlePathExtensionHandle;
    encoder << applicationCacheDirectory;
    encoder << applicationCacheDirectoryExtensionHandle;
    encoder << databaseDirectory;
    encoder << databaseDirectoryExtensionHandle;
    encoder << localStorageDirectory;
    encoder << localStorageDirectoryExtensionHandle;
    encoder << diskCacheDirectory;
    encoder << diskCacheDirectoryExtensionHandle;
    encoder << cookieStorageDirectory;
    encoder << cookieStorageDirectoryExtensionHandle;
    encoder << shouldUseTestingNetworkSession;
    encoder << urlSchemesRegistererdAsEmptyDocument;
    encoder << urlSchemesRegisteredAsSecure;
    encoder << urlSchemesForWhichDomainRelaxationIsForbidden;
    encoder << urlSchemesRegisteredAsLocal;
    encoder << urlSchemesRegisteredAsNoAccess;
    encoder << urlSchemesRegisteredAsDisplayIsolated;
    encoder << urlSchemesRegisteredAsCORSEnabled;
#if ENABLE(CUSTOM_PROTOCOLS)
    encoder << urlSchemesRegisteredForCustomProtocols;
#endif
#if USE(SOUP)
    encoder << urlSchemesRegistered;
    encoder << cookiePersistentStoragePath;
    encoder << cookiePersistentStorageType;
    encoder.encodeEnum(cookieAcceptPolicy);
    encoder << ignoreTLSErrors;
#endif
    encoder.encodeEnum(cacheModel);
    encoder << shouldTrackVisitedLinks;
    encoder << shouldAlwaysUseComplexTextCodePath;
    encoder << shouldUseFontSmoothing;
    encoder << iconDatabaseEnabled;
    encoder << terminationTimeout;
    encoder << languages;
    encoder << textCheckerState;
    encoder << fullKeyboardAccessEnabled;
    encoder << defaultRequestTimeoutInterval;
#if PLATFORM(MAC) || USE(CFNETWORK)
    encoder << uiProcessBundleIdentifier;
#endif
#if PLATFORM(MAC)
    encoder << presenterApplicationPid;
    encoder << accessibilityEnhancedUserInterfaceEnabled;
    encoder << nsURLCacheMemoryCapacity;
    encoder << nsURLCacheDiskCapacity;
    encoder << acceleratedCompositingPort;
    encoder << uiProcessBundleResourcePath;
    encoder << uiProcessBundleResourcePathExtensionHandle;
    encoder << shouldForceScreenFontSubstitution;
    encoder << shouldEnableKerningAndLigaturesByDefault;
#endif

#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    encoder << notificationPermissions;
#endif

#if ENABLE(NETWORK_PROCESS)
    encoder << usesNetworkProcess;
#endif

    encoder << plugInAutoStartOriginHashes;
    encoder << plugInAutoStartOrigins;
}