Changeset 211012 in webkit
- Timestamp:
- Jan 20, 2017 11:40:19 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211008 r211012 1 2017-01-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [SOUP] Custom protocols don't work in private browsing mode 4 https://bugs.webkit.org/show_bug.cgi?id=167236 5 6 Reviewed by Sergio Villar Senin. 7 8 Add static method to set the global custom protocols request type and setup method to add the feature to the session. 9 10 * platform/network/soup/SoupNetworkSession.cpp: 11 (WebCore::SoupNetworkSession::SoupNetworkSession): 12 (WebCore::SoupNetworkSession::setCustomProtocolRequestType): 13 (WebCore::SoupNetworkSession::setupCustomProtocols): 14 * platform/network/soup/SoupNetworkSession.h: 15 1 16 2017-01-20 Matt Rajca <mrajca@apple.com> 2 17 -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
r210921 r211012 49 49 static CString gInitialAcceptLanguages; 50 50 static SoupNetworkProxySettings gProxySettings; 51 static GType gCustomProtocolRequestType; 51 52 52 53 #if !LOG_DISABLED … … 140 141 SOUP_SESSION_SSL_STRICT, FALSE, 141 142 nullptr); 143 144 setupCustomProtocols(); 142 145 143 146 if (!gInitialAcceptLanguages.isNull()) … … 290 293 } 291 294 295 void SoupNetworkSession::setCustomProtocolRequestType(GType requestType) 296 { 297 ASSERT(g_type_is_a(requestType, SOUP_TYPE_REQUEST)); 298 gCustomProtocolRequestType = requestType; 299 } 300 301 void SoupNetworkSession::setupCustomProtocols() 302 { 303 if (!g_type_is_a(gCustomProtocolRequestType, SOUP_TYPE_REQUEST)) 304 return; 305 soup_session_add_feature_by_type(m_soupSession.get(), gCustomProtocolRequestType); 306 } 307 292 308 void SoupNetworkSession::setShouldIgnoreTLSErrors(bool ignoreTLSErrors) 293 309 { -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h
r210921 r211012 33 33 #include <wtf/text/WTFString.h> 34 34 35 typedef size_t GType; 35 36 typedef struct _SoupCache SoupCache; 36 37 typedef struct _SoupCookieJar SoupCookieJar; … … 71 72 static void allowSpecificHTTPSCertificateForHost(const CertificateInfo&, const String& host); 72 73 74 static void setCustomProtocolRequestType(GType); 75 void setupCustomProtocols(); 76 73 77 private: 74 78 void setupLogger(); -
trunk/Source/WebKit2/ChangeLog
r211007 r211012 1 2017-01-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [SOUP] Custom protocols don't work in private browsing mode 4 https://bugs.webkit.org/show_bug.cgi?id=167236 5 6 Reviewed by Sergio Villar Senin. 7 8 We only register them in the default session. 9 10 * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: 11 (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for 12 custom protocols, and setup custom protocols in all existing sessions. 13 (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know 14 the class was already created in registerProtocolClass(). 15 1 16 2017-01-20 Brady Eidson <beidson@apple.com> 2 17 -
trunk/Source/WebKit2/NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
r210786 r211012 78 78 { 79 79 static_cast<WebKitSoupRequestGenericClass*>(g_type_class_ref(WEBKIT_TYPE_SOUP_REQUEST_GENERIC))->client = &CustomProtocolRequestClient::singleton(); 80 SoupNetworkSession::setCustomProtocolRequestType(WEBKIT_TYPE_SOUP_REQUEST_GENERIC); 81 NetworkStorageSession::forEach([](const WebCore::NetworkStorageSession& session) { 82 if (auto* soupSession = session.soupNetworkSession()) 83 soupSession->setupCustomProtocols(); 84 }); 80 85 } 81 86 … … 90 95 g_ptr_array_add(m_registeredSchemes.get(), nullptr); 91 96 92 auto* genericRequestClass = static_cast<SoupRequestClass*>(g_type_class_ref(WEBKIT_TYPE_SOUP_REQUEST_GENERIC)); 97 auto* genericRequestClass = static_cast<SoupRequestClass*>(g_type_class_peek(WEBKIT_TYPE_SOUP_REQUEST_GENERIC)); 98 ASSERT(genericRequestClass); 93 99 genericRequestClass->schemes = const_cast<const char**>(reinterpret_cast<char**>(m_registeredSchemes->pdata)); 94 soup_session_add_feature_by_type(NetworkStorageSession::defaultStorageSession().getOrCreateSoupNetworkSession().soupSession(), WEBKIT_TYPE_SOUP_REQUEST_GENERIC);95 100 } 96 101
Note: See TracChangeset
for help on using the changeset viewer.