void WebProcessPool::setAutomationSession(RefPtr<WebAutomationSession>&& automationSession) { m_automationSession = WTFMove(automationSession); #if ENABLE(REMOTE_INSPECTOR) if (m_automationSession) { m_automationSession->init(); m_automationSession->setProcessPool(this); sendToAllProcesses(Messages::WebProcess::EnsureAutomationSessionProxy(m_automationSession->sessionIdentifier())); } else sendToAllProcesses(Messages::WebProcess::DestroyAutomationSessionProxy()); #endif }
void WebContext::setCacheModel(CacheModel cacheModel) { m_cacheModel = cacheModel; sendToAllProcesses(Messages::WebProcess::SetCacheModel(static_cast<uint32_t>(m_cacheModel))); // FIXME: Inform the Network Process if in use. }
void WebProcessPool::clearPluginClientPolicies() { #if ENABLE(NETSCAPE_PLUGIN_API) m_pluginLoadClientPolicies.clear(); #endif sendToAllProcesses(Messages::WebProcess::ClearPluginClientPolicies()); }
void WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool privateBrowsingEnabled) { m_iconDatabase->setPrivateBrowsingEnabled(privateBrowsingEnabled); if (networkProcess()) { if (privateBrowsingEnabled) networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0); else networkProcess()->send(Messages::NetworkProcess::DestroyPrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0); } if (privateBrowsingEnabled) sendToAllProcesses(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID())); else sendToAllProcesses(Messages::WebProcess::DestroyPrivateBrowsingSession(SessionID::legacyPrivateSessionID())); }
void WebProcessPool::languageChanged() { sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(userPreferredLanguages())); #if USE(SOUP) if (m_networkProcess) m_networkProcess->send(Messages::NetworkProcess::UserPreferredLanguagesChanged(userPreferredLanguages()), 0); #endif }
void WebContext::languageChanged() { sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(userPreferredLanguages())); #if USE(SOUP) && ENABLE(NETWORK_PROCESS) if (m_usesNetworkProcess && m_networkProcess) m_networkProcess->send(Messages::NetworkProcess::UserPreferredLanguagesChanged(userPreferredLanguages()), 0); #endif }
void WebProcessPool::setCacheModel(CacheModel cacheModel) { m_configuration->setCacheModel(cacheModel); sendToAllProcesses(Messages::WebProcess::SetCacheModel(cacheModel)); if (m_networkProcess) m_networkProcess->send(Messages::NetworkProcess::SetCacheModel(cacheModel), 0); }
void WebContext::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool privateBrowsingEnabled) { m_iconDatabase->setPrivateBrowsingEnabled(privateBrowsingEnabled); #if ENABLE(NETWORK_PROCESS) if (usesNetworkProcess() && networkProcess()) { if (privateBrowsingEnabled) networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0); else networkProcess()->send(Messages::NetworkProcess::DestroyPrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0); } #endif // ENABLED(NETWORK_PROCESS) if (privateBrowsingEnabled) sendToAllProcesses(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID())); else sendToAllProcesses(Messages::WebProcess::DestroyPrivateBrowsingSession(SessionID::legacyPrivateSessionID())); }
void WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit() { // We're estimating an upper bound for a set of background timer fires for a page to be 200ms // (including all timer fires, all paging-in, and any resulting GC). To ensure this does not // result in more than 1% CPU load allow for one timer fire per 100x this duration. static int maximumTimerThrottlePerPageInMS = 200 * 100; int limitInMilliseconds = maximumTimerThrottlePerPageInMS * m_hiddenPageThrottlingAutoIncreasesCounter.value(); sendToAllProcesses(Messages::WebProcess::SetHiddenPageTimerThrottlingIncreaseLimit(limitInMilliseconds)); }
void WebContext::setIgnoreTLSErrors(bool ignoreTLSErrors) { m_ignoreTLSErrors = ignoreTLSErrors; #if ENABLE(NETWORK_PROCESS) if (usesNetworkProcess() && networkProcess()) { networkProcess()->send(Messages::NetworkProcess::SetIgnoreTLSErrors(m_ignoreTLSErrors), 0); return; } #endif sendToAllProcesses(Messages::WebProcess::SetIgnoreTLSErrors(m_ignoreTLSErrors)); }
void WebContext::stopMemorySampler() { // For WebProcess m_memorySamplerEnabled = false; // For UIProcess #if ENABLE(MEMORY_SAMPLER) WebMemorySampler::shared()->stop(); #endif sendToAllProcesses(Messages::WebProcess::StopMemorySampler()); }
void WebProcessPool::setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String& host, const String& bundleIdentifier, const String& versionString) { #if ENABLE(NETSCAPE_PLUGIN_API) HashMap<String, HashMap<String, uint8_t>> policiesByIdentifier; if (m_pluginLoadClientPolicies.contains(host)) policiesByIdentifier = m_pluginLoadClientPolicies.get(host); HashMap<String, uint8_t> versionsToPolicies; if (policiesByIdentifier.contains(bundleIdentifier)) versionsToPolicies = policiesByIdentifier.get(bundleIdentifier); versionsToPolicies.set(versionString, policy); policiesByIdentifier.set(bundleIdentifier, versionsToPolicies); m_pluginLoadClientPolicies.set(host, policiesByIdentifier); #endif sendToAllProcesses(Messages::WebProcess::SetPluginLoadClientPolicy(policy, host, bundleIdentifier, versionString)); }
void WebContext::startMemorySampler(const double interval) { // For new WebProcesses we will also want to start the Memory Sampler m_memorySamplerEnabled = true; m_memorySamplerInterval = interval; // For UIProcess #if ENABLE(MEMORY_SAMPLER) WebMemorySampler::shared()->start(interval); #endif // For WebProcess SandboxExtension::Handle sampleLogSandboxHandle; double now = WTF::currentTime(); String sampleLogFilePath = String::format("WebProcess%llu", static_cast<unsigned long long>(now)); sampleLogFilePath = SandboxExtension::createHandleForTemporaryFile(sampleLogFilePath, SandboxExtension::ReadWrite, sampleLogSandboxHandle); sendToAllProcesses(Messages::WebProcess::StartMemorySampler(sampleLogSandboxHandle, sampleLogFilePath, interval)); }
void WebContext::registerURLSchemeAsNoAccess(const String& urlScheme) { m_schemesToRegisterAsNoAccess.add(urlScheme); sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsNoAccess(urlScheme)); }
void WebContext::setDomainRelaxationForbiddenForURLScheme(const String& urlScheme) { m_schemesToSetDomainRelaxationForbiddenFor.add(urlScheme); sendToAllProcesses(Messages::WebProcess::SetDomainRelaxationForbiddenForURLScheme(urlScheme)); }
void WebContext::registerURLSchemeAsEmptyDocument(const String& urlScheme) { m_schemesToRegisterAsEmptyDocument.add(urlScheme); sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsEmptyDocument(urlScheme)); }
void WebContext::setShouldUseFontSmoothing(bool useFontSmoothing) { m_shouldUseFontSmoothing = useFontSmoothing; sendToAllProcesses(Messages::WebProcess::SetShouldUseFontSmoothing(useFontSmoothing)); }
void WebContext::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText) { m_alwaysUsesComplexTextCodePath = alwaysUseComplexText; sendToAllProcesses(Messages::WebProcess::SetAlwaysUsesComplexTextCodePath(alwaysUseComplexText)); }
void WebProcessPool::registerURLSchemeAsCORSEnabled(const String& urlScheme) { m_schemesToRegisterAsCORSEnabled.add(urlScheme); sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCORSEnabled(urlScheme)); }
void WebContext::setEnhancedAccessibility(bool flag) { sendToAllProcesses(Messages::WebProcess::SetEnhancedAccessibility(flag)); }
void WebContext::registerURLSchemeAsDisplayIsolated(const String& urlScheme) { m_schemesToRegisterAsDisplayIsolated.add(urlScheme); sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsDisplayIsolated(urlScheme)); }
void WebContext::setMemoryCacheDisabled(bool disabled) { m_memoryCacheDisabled = disabled; sendToAllProcesses(Messages::WebProcess::SetMemoryCacheDisabled(disabled)); }
void WebContext::setJavaScriptGarbageCollectorTimerEnabled(bool flag) { sendToAllProcesses(Messages::WebProcess::SetJavaScriptGarbageCollectorTimerEnabled(flag)); }
void WebContext::garbageCollectJavaScriptObjects() { sendToAllProcesses(Messages::WebProcess::GarbageCollectJavaScriptObjects()); }
void WebContext::registerURLSchemeAsCachePartitioned(const String& urlScheme) { m_schemesToRegisterAsCachePartitioned.add(urlScheme); sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCachePartitioned(urlScheme)); }
void WebContext::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled) { sendToAllProcesses(Messages::WebProcess::FullKeyboardAccessModeChanged(fullKeyboardAccessEnabled)); }
void WebContext::setDefaultRequestTimeoutInterval(double timeoutInterval) { sendToAllProcesses(Messages::WebProcess::SetDefaultRequestTimeoutInterval(timeoutInterval)); }
void WebContext::textCheckerStateChanged() { sendToAllProcesses(Messages::WebProcess::SetTextCheckerState(TextChecker::state())); }
void WebContext::setIgnoreTLSErrors(bool ignoreTLSErrors) { m_ignoreTLSErrors = ignoreTLSErrors; sendToAllProcesses(Messages::WebProcess::SetIgnoreTLSErrors(m_ignoreTLSErrors)); }
void WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy(const String& urlScheme) { m_schemesToRegisterAsBypassingContentSecurityPolicy.add(urlScheme); sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsBypassingContentSecurityPolicy(urlScheme)); }