Changeset 211140 in webkit
- Timestamp:
- Jan 25, 2017, 4:22:54 AM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/network/soup/SoupNetworkSession.cpp (modified) (3 diffs)
-
WebCore/platform/network/soup/SoupNetworkSession.h (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211139 r211140 1 2017-01-25 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-25 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
r211027 r211140 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 306 auto* requestClass = static_cast<SoupRequestClass*>(g_type_class_peek(gCustomProtocolRequestType)); 307 if (!requestClass || !requestClass->schemes) 308 return; 309 310 soup_session_add_feature_by_type(m_soupSession.get(), gCustomProtocolRequestType); 311 } 312 292 313 void SoupNetworkSession::setShouldIgnoreTLSErrors(bool ignoreTLSErrors) 293 314 { -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h
r211014 r211140 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
r211138 r211140 1 2017-01-25 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, they should be registered in all existing sessions, and also on 9 newly created ones. 10 11 * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: 12 (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for 13 custom protocols. 14 (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know 15 the class was already created in registerProtocolClass(). Setup custom protocols in all existing sessions. 16 1 17 2017-01-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 18 -
trunk/Source/WebKit2/NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
r211014 r211140 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); 80 81 } 81 82 … … 90 91 g_ptr_array_add(m_registeredSchemes.get(), nullptr); 91 92 92 auto* genericRequestClass = static_cast<SoupRequestClass*>(g_type_class_ref(WEBKIT_TYPE_SOUP_REQUEST_GENERIC)); 93 auto* genericRequestClass = static_cast<SoupRequestClass*>(g_type_class_peek(WEBKIT_TYPE_SOUP_REQUEST_GENERIC)); 94 ASSERT(genericRequestClass); 93 95 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); 96 NetworkStorageSession::forEach([](const WebCore::NetworkStorageSession& session) { 97 if (auto* soupSession = session.soupNetworkSession()) 98 soupSession->setupCustomProtocols(); 99 }); 95 100 } 96 101
Note:
See TracChangeset
for help on using the changeset viewer.