Bug 98149 - MediaStream API: RTCPeerConnection should send down its handler via the FrameLoaderClient directly after creation.
Summary: MediaStream API: RTCPeerConnection should send down its handler via the Frame...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Tommy Widenflycht
URL:
Keywords:
Depends on:
Blocks: 56459
  Show dependency treegraph
 
Reported: 2012-10-02 04:57 PDT by Tommy Widenflycht
Modified: 2012-10-12 02:11 PDT (History)
9 users (show)

See Also:


Attachments
Patch (11.35 KB, patch)
2012-10-02 05:02 PDT, Tommy Widenflycht
abarth: review+
tommyw: commit-queue?
Details | Formatted Diff | Diff
Patch for landing (11.33 KB, patch)
2012-10-03 02:11 PDT, Tommy Widenflycht
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy Widenflycht 2012-10-02 04:57:55 PDT
The chromium implementation needs to know which Frame created a PeerConnection so that the right housekeeping can take place correctly.
Comment 1 Tommy Widenflycht 2012-10-02 05:02:49 PDT
Created attachment 166673 [details]
Patch
Comment 2 Tommy Widenflycht 2012-10-02 05:03:26 PDT
Trying this way instead.
Comment 3 WebKit Review Bot 2012-10-02 05:04:40 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 4 Adam Barth 2012-10-02 09:55:36 PDT
Comment on attachment 166673 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=166673&action=review

> Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:139
> +    if (!document || !(document->frame())) {

document will always be non-0 here.

> Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:61
> +WebKit::WebRTCPeerConnectionHandler* RTCPeerConnectionHandlerChromium::toWebRTCPeerConnectionHandler(RTCPeerConnectionHandler* handler)
> +{
> +    return static_cast<RTCPeerConnectionHandlerChromium*>(handler)->m_webHandler.get();
> +}

I probably would have just added a public accessor for m_webHandler and had FrameLoaderClientImpl do the static_cast, but this is ok too.
Comment 5 Tommy Widenflycht 2012-10-03 02:08:17 PDT
Comment on attachment 166673 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=166673&action=review

>> Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:139
>> +    if (!document || !(document->frame())) {
> 
> document will always be non-0 here.

Removed check for empty document.

>> Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:61
>> +}
> 
> I probably would have just added a public accessor for m_webHandler and had FrameLoaderClientImpl do the static_cast, but this is ok too.

RTCPeerConnectionHandler doesn't know anything about any private implementations, neither should it I think, so I am keeping it like this.
Comment 6 Tommy Widenflycht 2012-10-03 02:11:23 PDT
Created attachment 166830 [details]
Patch for landing
Comment 7 Adam Barth 2012-10-03 02:29:58 PDT
Comment on attachment 166830 [details]
Patch for landing

ok
Comment 8 WebKit Review Bot 2012-10-03 02:52:07 PDT
Comment on attachment 166830 [details]
Patch for landing

Clearing flags on attachment: 166830

Committed r130270: <http://trac.webkit.org/changeset/130270>