Changeset 185819 in webkit
- Timestamp:
- Jun 22, 2015, 12:57:58 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/network/soup/DNSSoup.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185818 r185819 1 2015-06-22 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Unreviewed. Fix GTK+ build after r185818. 4 5 Actually rollout r185320. 6 7 * platform/network/soup/DNSSoup.cpp: 8 (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): 9 (WebCore::DNSResolveQueue::platformResolve): 10 (WebCore::gotProxySettingsCallback): Deleted. 11 (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted. 12 1 13 2015-06-16 Gavin Barraclough <barraclough@apple.com> 2 14 -
trunk/Source/WebCore/platform/network/soup/DNSSoup.cpp
r185818 r185819 34 34 #include <libsoup/soup.h> 35 35 #include <wtf/MainThread.h> 36 #include <wtf/glib/GRefPtr.h>37 #include <wtf/glib/GUniquePtr.h>38 36 #include <wtf/text/CString.h> 39 37 40 38 namespace WebCore { 41 39 42 static void gotProxySettingsCallback(GObject* sourceObject, GAsyncResult* result, void* userData) 40 // There is no current reliable way to know if we're behind a proxy at 41 // this level. We'll have to implement it in 42 // SoupSession/SoupProxyURIResolver/GProxyResolver 43 bool DNSResolveQueue::platformProxyIsEnabledInSystemPreferences() 43 44 { 44 GProxyResolver* resolver = G_PROXY_RESOLVER(sourceObject); 45 GUniquePtr<char> hostname(static_cast<char*>(userData)); 46 GUniqueOutPtr<GError> error; 47 48 GUniquePtr<char*> uris(g_proxy_resolver_lookup_finish(resolver, result, &error.outPtr())); 49 if (error) { 50 WTFLogAlways("Error determining proxy to use for %s: %s", hostname.get(), error->message); 51 return; 52 } 53 54 // We have a list of possible proxies to use for the URI. If the first item in the list is 55 // direct:// (the usual case), then the user prefers not to use a proxy. This is similar to 56 // resolving hostnames: there could be many possibilities returned in order of preference, and 57 // if we're trying to connect we should attempt each one in order, but here we are not trying 58 // to connect, merely to decide whether a proxy "should" be used. 59 if (uris && *uris.get() && !strcmp(*uris.get(), "direct://")) { 60 soup_session_prefetch_dns(SoupNetworkSession::defaultSession().soupSession(), hostname.get(), nullptr, [](SoupAddress*, guint, void*) { 61 DNSResolveQueue::singleton().decrementRequestCount(); 62 }, nullptr); 63 } 45 return false; 64 46 } 65 47 66 void DNSResolveQueue::platformMaybeResolveHost(const String& hostname) 48 static void resolvedCallback(SoupAddress*, guint, void*) 49 { 50 DNSResolveQueue::singleton().decrementRequestCount(); 51 } 52 53 void DNSResolveQueue::platformResolve(const String& hostname) 67 54 { 68 55 ASSERT(isMainThread()); 69 56 70 GRefPtr<GProxyResolver> resolver; 71 g_object_get(SoupNetworkSession::defaultSession().soupSession(), "proxy-resolver", &resolver.outPtr(), nullptr); 72 ASSERT_WITH_SECURITY_IMPLICATION(resolver); 73 74 char* uri = g_strdup(hostname.utf8().data()); // Freed by gotProxySettingsCallback. 75 g_proxy_resolver_lookup_async(resolver.get(), uri, nullptr, gotProxySettingsCallback, uri); 57 soup_session_prefetch_dns(SoupNetworkSession::defaultSession().soupSession(), hostname.utf8().data(), nullptr, resolvedCallback, nullptr); 76 58 } 77 59
Note:
See TracChangeset
for help on using the changeset viewer.