We should do ICE candidate filtering at the Document level
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2017 15:32:38 +0000 (15:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2017 15:32:38 +0000 (15:32 +0000)
commitf7583b405f08bc154bf0f1abe32360c0ac9b9c7a
treeb5a0e1073cce3ddebd0e6fc806d1f32b485fa763
parent23835c36f7fefab63c3f971913e8f43ed9b2461a
We should do ICE candidate filtering at the Document level
https://bugs.webkit.org/show_bug.cgi?id=173861
<rdar://problem/33122058>

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-11
Reviewed by Eric Carlson.

Source/WebCore:

Tests: http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html
       http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
       http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html
       webrtc/filtering-ice-candidate-after-reload.html

Making UserMediaRequest disable the ICE candidate filtering for the page RTCController.
All RTCPeerConnection of the page that are created on a document that are same-origin as the top document
are now registered to the RTCController.
This allows disabling filtering to only these RTCPeerConnection.

The page keeps the default ICE candidate filtering policy.
This policy allows disabling ICE candidate filtering for all RTCPeerConnection.

When the top document is changing, the RTCController filtering policy is reset
and its list of RTCPeerConnection is emptied.

Internals no longer disables ICE candidate filtering by default.
This allows finer grained testing.
ICE candidate filtering is disabled for tests including testharnessreport.js
to enable web-platform-tests to run without modifications.

* Modules/mediastream/RTCController.cpp:
(WebCore::RTCController::reset):
* Modules/mediastream/RTCController.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
* page/Page.cpp:
(WebCore::Page::disableICECandidateFiltering):
* page/Page.h:
(WebCore::Page::shouldEnableICECandidateFilteringByDefault):
(WebCore::Page::disableICECandidateFiltering): Deleted.
(WebCore::Page::enableICECandidateFiltering): Deleted.
(WebCore::Page::isICECandidateFilteringEnabled): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::setICECandidateFiltering):
(WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
(WebCore::Internals::isICECandidateFilteringEnabled): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Removing ICE candidate filtering handling at UIProcess level.
ICE candidate filtering is now disabled at UserMediaRequest level.
WebPage forwards the ICE candidate filtering option to the page so as to set
the default option correctly for every document of the page.

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::disableICECandidateFiltering):
(WebKit::WebPage::enableICECandidateFiltering):

LayoutTests:

* http/tests/webrtc/filtering-ice-candidate-cross-origin-frame-expected.txt: Added.
* http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html: Added.
* http/tests/webrtc/filtering-ice-candidate-same-origin-frame-expected.txt: Added.
* http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html: Added.
* http/tests/webrtc/filtering-ice-candidate-same-origin-frame2-expected.txt: Added.
* http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html: Added.
* http/tests/webrtc/resources/check-ice-candidate-filtering.html: Added.
* http/tests/webrtc/resources/do-get-user-media.html: Added.
* platform/mac-wk1/TestExpectations: Disable http/tests/webrtc tests.
* resources/testharnessreport.js: Disabled ICE candidate filtering by default.
* webrtc/filtering-ice-candidate-after-reload-expected.txt: Added.
* webrtc/filtering-ice-candidate-after-reload.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/webrtc/filtering-ice-candidate-cross-origin-frame-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html [new file with mode: 0644]
LayoutTests/http/tests/webrtc/filtering-ice-candidate-same-origin-frame-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html [new file with mode: 0644]
LayoutTests/http/tests/webrtc/filtering-ice-candidate-same-origin-frame2-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html [new file with mode: 0644]
LayoutTests/http/tests/webrtc/resources/check-ice-candidate-filtering.html [new file with mode: 0644]
LayoutTests/http/tests/webrtc/resources/do-get-user-media.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/resources/testharnessreport.js
LayoutTests/webrtc/filtering-ice-candidate-after-reload-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/filtering-ice-candidate-after-reload.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCController.cpp
Source/WebCore/Modules/mediastream/RTCController.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/testing/Internals.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/UserMediaProcessManager.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp