Changeset 252980 in webkit
- Timestamp:
- Dec 2, 2019 1:40:33 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r252976 r252980 1 2019-12-02 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK][PSON] Crash in NetworkProcessProxy::openNetworkProcessConnection 4 https://bugs.webkit.org/show_bug.cgi?id=204703 5 6 Reviewed by Michael Catanzaro. 7 8 Stop sending a message to all web process to prefetch DNS for a hostname. All web processes then send a messaage 9 to their network process to prefetch the DNS. Instead, send a message directly to the network process. 10 11 * NetworkProcess/NetworkProcess.messages.in: 12 * UIProcess/API/glib/WebKitWebContext.cpp: 13 (webkit_web_context_prefetch_dns): 14 * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: 15 1 16 2019-12-01 Fujii Hironori <Hironori.Fujii@sony.com> 2 17 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r252840 r252980 32 32 UserPreferredLanguagesChanged(Vector<String> languages) 33 33 SetNetworkProxySettings(struct WebCore::SoupNetworkProxySettings settings) 34 PrefetchDNS(String hostname) 34 35 #endif 35 36 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
r251181 r252980 28 28 #include "APIString.h" 29 29 #include "LegacyGlobalSettings.h" 30 #include "NetworkProcessMessages.h" 30 31 #include "TextChecker.h" 31 32 #include "TextCheckerState.h" 32 33 #include "WebAutomationSession.h" 33 34 #include "WebCertificateInfo.h" 35 #include "WebKit2Initialize.h" 34 36 #include "WebKitAutomationSessionPrivate.h" 35 37 #include "WebKitDownloadClient.h" … … 60 62 #include <libintl.h> 61 63 #include <memory> 64 #include <pal/HysteresisActivity.h> 62 65 #include <wtf/FileSystem.h> 63 66 #include <wtf/HashMap.h> 67 #include <wtf/HashSet.h> 64 68 #include <wtf/Language.h> 65 69 #include <wtf/NeverDestroyed.h> … … 192 196 193 197 struct _WebKitWebContextPrivate { 198 _WebKitWebContextPrivate() 199 : dnsPrefetchHystereris([this](PAL::HysteresisState state) { if (state == PAL::HysteresisState::Stopped) dnsPrefetchedHosts.clear(); }) 200 { 201 } 202 194 203 RefPtr<WebProcessPool> processPool; 195 204 bool clientsDetached; … … 223 232 #endif 224 233 std::unique_ptr<WebKitProtocolHandler> webkitProtocolHandler; 234 235 HashSet<String> dnsPrefetchedHosts; 236 PAL::HysteresisActivity dnsPrefetchHystereris; 225 237 }; 226 238 … … 439 451 bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); 440 452 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); 453 454 InitializeWebKit2(); 441 455 442 456 gObjectClass->get_property = webkitWebContextGetProperty; … … 1553 1567 g_return_if_fail(hostname); 1554 1568 1555 API::Dictionary::MapType message;1556 message.set(String::fromUTF8("Hostname"), API::String::create(String::fromUTF8(hostname)));1557 context->priv-> processPool->postMessageToInjectedBundle(String::fromUTF8("PrefetchDNS"), API::Dictionary::create(WTFMove(message)).ptr());1569 if (context->priv->dnsPrefetchedHosts.add(hostname).isNewEntry) 1570 context->priv->processPool->sendToNetworkingProcess(Messages::NetworkProcess::PrefetchDNS(String::fromUTF8(hostname))); 1571 context->priv->dnsPrefetchHystereris.impulse(); 1558 1572 } 1559 1573 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp
r251181 r252980 199 199 } 200 200 201 void didReceiveMessage(InjectedBundle&, const String& messageName, API::Object* messageBody) override202 {203 ASSERT(messageBody->type() == API::Object::Type::Dictionary);204 API::Dictionary& message = *static_cast<API::Dictionary*>(messageBody);205 if (messageName == String::fromUTF8("PrefetchDNS")) {206 API::String* hostname = static_cast<API::String*>(message.get(String::fromUTF8("Hostname")));207 WebProcess::singleton().prefetchDNS(hostname->string());208 } else209 ASSERT_NOT_REACHED();210 }211 212 201 void didReceiveMessageToPage(InjectedBundle&, WebPage& page, const String& messageName, API::Object* messageBody) override 213 202 {
Note: See TracChangeset
for help on using the changeset viewer.