Changeset 211372 in webkit
- Timestamp:
- Jan 30, 2017 10:13:11 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211371 r211372 1 2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r202615?): [GStreamer] ASSERTION FAILED: isMainThread() in WebCore::BuiltinResourceHandleConstructorMap& WebCore::builtinResourceHandleConstructorMap() 4 https://bugs.webkit.org/show_bug.cgi?id=167003 5 6 Reviewed by Michael Catanzaro. 7 8 Add a way to create a ResourceHandle for a given SoupNetworkSession and use it in the GStreamer streaming client 9 to ensure both the session and the handle are created and destroyed in the secondary thread. This way we also 10 avoid using the default session for downloading HLS fragments. 11 12 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: 13 (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Create a SoupNetworkSession and pass it to ResourceHandle::create(). 14 * platform/network/ResourceHandle.h: Add create and constructor to receive a SoupNetworkSession. 15 * platform/network/ResourceHandleInternal.h: Add SoupNetworkSession member. 16 * platform/network/soup/ResourceHandleSoup.cpp: 17 (WebCore::ResourceHandleInternal::soupSession): Return the SoupNetworkSession if not nullptr. 18 (WebCore::ResourceHandle::create): Create a ResourceHandle without trying to use any builtin constructor and 19 using the given SoupNetworkSession. 20 (WebCore::ResourceHandle::ResourceHandle): Set the SoupNetworkSession if early request validations didn't fail. 21 1 22 2017-01-30 Youenn Fablet <youennf@gmail.com> 2 23 -
trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
r210584 r211372 47 47 #include <wtf/text/CString.h> 48 48 49 #if USE(SOUP) 50 #include "SoupNetworkSession.h" 51 #endif 52 49 53 using namespace WebCore; 50 54 … … 112 116 Condition m_terminateRunLoopCondition; 113 117 RefPtr<ResourceHandle> m_resource; 118 #if USE(SOUP) 119 std::unique_ptr<SoupNetworkSession> m_session; 120 #endif 114 121 }; 115 122 … … 1072 1079 LockHolder locker(m_initializeRunLoopConditionMutex); 1073 1080 m_runLoop = &RunLoop::current(); 1081 #if USE(SOUP) 1082 m_session = std::make_unique<SoupNetworkSession>(); 1083 m_resource = ResourceHandle::create(*m_session, request, this, true, false); 1084 #else 1085 // FIXME: This create will hit an assert in debug builds. See https://bugs.webkit.org/show_bug.cgi?id=167003. 1074 1086 m_resource = ResourceHandle::create(nullptr /*context*/, request, this, true, false); 1087 #endif 1075 1088 m_initializeRunLoopCondition.notifyOne(); 1076 1089 } … … 1086 1099 m_resource->cancel(); 1087 1100 m_resource = nullptr; 1101 #if USE(SOUP) 1102 m_session = nullptr; 1103 #endif 1088 1104 m_terminateRunLoopCondition.notifyOne(); 1089 1105 } -
trunk/Source/WebCore/platform/network/ResourceHandle.h
r210480 r211372 87 87 class ResourceRequest; 88 88 class ResourceResponse; 89 class SoupNetworkSession; 89 90 class SharedBuffer; 90 91 class Timer; … … 94 95 WEBCORE_EXPORT static RefPtr<ResourceHandle> create(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff); 95 96 WEBCORE_EXPORT static void loadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data); 97 98 #if USE(SOUP) 99 static RefPtr<ResourceHandle> create(SoupNetworkSession&, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff); 100 #endif 96 101 97 102 WEBCORE_EXPORT virtual ~ResourceHandle(); … … 242 247 }; 243 248 249 #if USE(SOUP) 250 ResourceHandle(SoupNetworkSession&, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff); 251 #endif 252 244 253 void platformSetDefersLoading(bool); 245 254 -
trunk/Source/WebCore/platform/network/ResourceHandleInternal.h
r210681 r211372 51 51 #if USE(SOUP) 52 52 #include "GUniquePtrSoup.h" 53 #include "SoupNetworkSession.h" 53 54 #include <libsoup/soup.h> 54 55 #include <wtf/RunLoop.h> … … 150 151 #endif 151 152 #if USE(SOUP) 153 SoupNetworkSession* m_session { nullptr }; 152 154 GRefPtr<SoupMessage> m_soupMessage; 153 155 ResourceResponse m_response; -
trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
r210786 r211372 92 92 SoupSession* ResourceHandleInternal::soupSession() 93 93 { 94 return sessionFromContext(m_context.get()); 94 return m_session ? m_session->soupSession() : sessionFromContext(m_context.get()); 95 } 96 97 RefPtr<ResourceHandle> ResourceHandle::create(SoupNetworkSession& session, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff) 98 { 99 auto newHandle = adoptRef(*new ResourceHandle(session, request, client, defersLoading, shouldContentSniff)); 100 101 if (newHandle->d->m_scheduledFailureType != NoFailure) 102 return WTFMove(newHandle); 103 104 if (newHandle->start()) 105 return WTFMove(newHandle); 106 107 return nullptr; 108 } 109 110 ResourceHandle::ResourceHandle(SoupNetworkSession& session, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff) 111 : d(std::make_unique<ResourceHandleInternal>(this, nullptr, request, client, defersLoading, shouldContentSniff && shouldContentSniffURL(request.url()))) 112 { 113 if (!request.url().isValid()) { 114 scheduleFailure(InvalidURLFailure); 115 return; 116 } 117 118 if (!portAllowed(request.url())) { 119 scheduleFailure(BlockedFailure); 120 return; 121 } 122 123 d->m_session = &session; 95 124 } 96 125
Note: See TracChangeset
for help on using the changeset viewer.