Changeset 130270 in webkit
- Timestamp:
- Oct 3, 2012 2:52:19 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r130269 r130270 1 2012-10-03 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: RTCPeerConnection should send down its handler via the FrameLoaderClient directly after creation. 4 https://bugs.webkit.org/show_bug.cgi?id=98149 5 6 Reviewed by Adam Barth. 7 8 The chromium implementation needs to know which Frame created a PeerConnection so 9 that the right housekeeping can take place correctly. 10 11 Not testable in DRT, but have verified the change manually and with our pyautotests. 12 13 * Modules/mediastream/RTCPeerConnection.cpp: 14 (WebCore::RTCPeerConnection::RTCPeerConnection): 15 * loader/FrameLoaderClient.h: 16 (WebCore): 17 (FrameLoaderClient): 18 (WebCore::FrameLoaderClient::dispatchWillStartUsingPeerConnectionHandler): 19 * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp: 20 (WebCore::RTCPeerConnectionHandlerChromium::toWebRTCPeerConnectionHandler): 21 (WebCore): 22 (WebCore::RTCPeerConnectionHandlerChromium::RTCPeerConnectionHandlerChromium): 23 (WebCore::RTCPeerConnectionHandlerChromium::initialize): 24 * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h: 25 (RTCPeerConnectionHandlerChromium): 26 1 27 2012-10-03 Eugene Klyuchnikov <eustas.bug@gmail.com> 2 28 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r129908 r130270 36 36 37 37 #include "ArrayValue.h" 38 #include "Document.h" 38 39 #include "Event.h" 39 40 #include "ExceptionCode.h" 41 #include "Frame.h" 42 #include "FrameLoaderClient.h" 40 43 #include "MediaConstraintsImpl.h" 41 44 #include "MediaStreamEvent.h" … … 131 134 , m_remoteStreams(MediaStreamList::create()) 132 135 { 136 ASSERT(m_scriptExecutionContext->isDocument()); 137 Document* document = static_cast<Document*>(m_scriptExecutionContext); 138 139 if (!document->frame()) { 140 ec = NOT_SUPPORTED_ERR; 141 return; 142 } 143 133 144 m_peerHandler = RTCPeerConnectionHandler::create(this); 134 if (!m_peerHandler || !m_peerHandler->initialize(configuration, constraints))145 if (!m_peerHandler) { 135 146 ec = NOT_SUPPORTED_ERR; 147 return; 148 } 149 150 document->frame()->loader()->client()->dispatchWillStartUsingPeerConnectionHandler(m_peerHandler.get()); 151 152 if (!m_peerHandler->initialize(configuration, constraints)) { 153 ec = NOT_SUPPORTED_ERR; 154 return; 155 } 136 156 } 137 157 -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r129964 r130270 97 97 class ResourceRequest; 98 98 class ResourceResponse; 99 #if ENABLE(MEDIA_STREAM) 100 class RTCPeerConnectionHandler; 101 #endif 99 102 class SecurityOrigin; 100 103 class SharedBuffer; … … 342 345 virtual void dispatchDidReconnectDOMWindowExtensionToGlobalObject(DOMWindowExtension*) { } 343 346 virtual void dispatchWillDestroyGlobalObjectForDOMWindowExtension(DOMWindowExtension*) { } 347 348 #if ENABLE(MEDIA_STREAM) 349 virtual void dispatchWillStartUsingPeerConnectionHandler(RTCPeerConnectionHandler*) { } 350 #endif 344 351 }; 345 352 -
trunk/Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp
r129908 r130270 56 56 namespace WebCore { 57 57 58 WebKit::WebRTCPeerConnectionHandler* RTCPeerConnectionHandlerChromium::toWebRTCPeerConnectionHandler(RTCPeerConnectionHandler* handler) 59 { 60 return static_cast<RTCPeerConnectionHandlerChromium*>(handler)->m_webHandler.get(); 61 } 62 58 63 PassOwnPtr<RTCPeerConnectionHandler> RTCPeerConnectionHandler::create(RTCPeerConnectionHandlerClient* client) 59 64 { … … 65 70 { 66 71 ASSERT(m_client); 72 m_webHandler = adoptPtr(WebKit::Platform::current()->createRTCPeerConnectionHandler(this)); 67 73 } 68 74 … … 73 79 bool RTCPeerConnectionHandlerChromium::initialize(PassRefPtr<RTCConfiguration> configuration, PassRefPtr<MediaConstraints> constraints) 74 80 { 75 m_webHandler = adoptPtr(WebKit::Platform::current()->createRTCPeerConnectionHandler(this)); 76 return m_webHandler ? m_webHandler->initialize(configuration, constraints) : false; 81 if (!m_webHandler) 82 return false; 83 84 return m_webHandler->initialize(configuration, constraints); 77 85 } 78 86 -
trunk/Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h
r129908 r130270 50 50 class RTCPeerConnectionHandlerChromium : public RTCPeerConnectionHandler, public WebKit::WebRTCPeerConnectionHandlerClient { 51 51 public: 52 RTCPeerConnectionHandlerChromium(RTCPeerConnectionHandlerClient*);52 explicit RTCPeerConnectionHandlerChromium(RTCPeerConnectionHandlerClient*); 53 53 virtual ~RTCPeerConnectionHandlerChromium(); 54 54 … … 76 76 virtual void didRemoveRemoteStream(const WebKit::WebMediaStreamDescriptor&) OVERRIDE; 77 77 78 static WebKit::WebRTCPeerConnectionHandler* toWebRTCPeerConnectionHandler(RTCPeerConnectionHandler*); 79 78 80 private: 79 81 OwnPtr<WebKit::WebRTCPeerConnectionHandler> m_webHandler; -
trunk/Source/WebKit/chromium/ChangeLog
r130268 r130270 1 2012-10-03 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: RTCPeerConnection should send down its handler via the FrameLoaderClient directly after creation. 4 https://bugs.webkit.org/show_bug.cgi?id=98149 5 6 Reviewed by Adam Barth. 7 8 Adding willStartUsingPeerConnectionHandler to the WebFrameClient. 9 10 * public/WebFrameClient.h: 11 (WebKit): 12 (WebFrameClient): 13 (WebKit::WebFrameClient::willStartUsingPeerConnectionHandler): 14 * src/FrameLoaderClientImpl.cpp: 15 (WebKit): 16 (WebKit::FrameLoaderClientImpl::dispatchWillStartUsingPeerConnectionHandler): 17 * src/FrameLoaderClientImpl.h: 18 (FrameLoaderClientImpl): 19 1 20 2012-10-03 Peter Kotwicz <pkotwicz@google.com> 2 21 -
trunk/Source/WebKit/chromium/public/WebFrameClient.h
r129846 r130270 63 63 class WebNode; 64 64 class WebPlugin; 65 class WebRTCPeerConnectionHandler; 65 66 class WebSharedWorker; 66 67 class WebSharedWorkerClient; … … 399 400 virtual void willOpenSocketStream(WebSocketStreamHandle*) { } 400 401 402 // MediaStream ----------------------------------------------------- 403 404 // A new WebRTCPeerConnectionHandler is created. 405 virtual void willStartUsingPeerConnectionHandler(WebFrame*, WebRTCPeerConnectionHandler*) { } 406 401 407 // Messages ------------------------------------------------------ 402 408 -
trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
r129947 r130270 58 58 #include "ResourceHandleInternal.h" 59 59 #include "ResourceLoader.h" 60 #if ENABLE(MEDIA_STREAM) 61 #include "RTCPeerConnectionHandlerChromium.h" 62 #endif 60 63 #include "Settings.h" 61 64 #include "SocketStreamHandleInternal.h" … … 1639 1642 } 1640 1643 1644 #if ENABLE(MEDIA_STREAM) 1645 void FrameLoaderClientImpl::dispatchWillStartUsingPeerConnectionHandler(RTCPeerConnectionHandler* handler) 1646 { 1647 m_webFrame->client()->willStartUsingPeerConnectionHandler(webFrame(), RTCPeerConnectionHandlerChromium::toWebRTCPeerConnectionHandler(handler)); 1648 } 1649 #endif 1650 1651 1641 1652 } // namespace WebKit -
trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
r129545 r130270 221 221 virtual void dispatchWillOpenSocketStream(WebCore::SocketStreamHandle*) OVERRIDE; 222 222 223 #if ENABLE(MEDIA_STREAM) 224 virtual void dispatchWillStartUsingPeerConnectionHandler(WebCore::RTCPeerConnectionHandler*) OVERRIDE; 225 #endif 226 223 227 private: 224 228 void makeDocumentView();
Note: See TracChangeset
for help on using the changeset viewer.