<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[211161] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/211161">211161</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2017-01-25 13:00:11 -0800 (Wed, 25 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
https://bugs.webkit.org/show_bug.cgi?id=167294

Source/WebCore:

Patch by Youenn Fablet &lt;youennf@gmail.com&gt; on 2017-01-25
Reviewed by Alex Christensen.

Introducing LibWebRTCMacros.h which should be included before any libwebrtc header.

Introducing LibWebRTCProvider as the abstraction allowing to suport WK1 and WK2 libwebrtc-based WebRTC endpoints.
It  will create a libwebrtc peerconnection object differently in WK1 and WK2 as networking will be done differently.

LibWebRTCUtils contains routines used by WK1 and WK2 RTC providers to create the libwebrtc peerconnection object
and implement the necessary functionalities for it.

Updating PageConfiguration accordingly.

* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::libWebRTCProvider):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* platform/mediastream/libwebrtc/LibWebRTCMacros.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCProvider.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
(WebCore::staticFactoryAndThreads):
(WebCore::ThreadMessageData::ThreadMessageData):
(WebCore::PeerConnectionFactoryAndThreads::OnMessage):
(WebCore::callOnWebRTCNetworkThread):
(WebCore::initializePeerConnectionFactoryAndThreads):
(WebCore::initializeLibWebRTCInternalsWithSocketServer):
(WebCore::peerConnectionFactory):
(WebCore::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit/mac:

Patch by Youenn Fablet &lt;youennf@gmail.com&gt; on 2017-01-24
Reviewed by Alex Christensen.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit/win:

Patch by Youenn Fablet &lt;youennf@gmail.com&gt; on 2017-01-24
Reviewed by Alex Christensen.

* WebView.cpp:
(WebView::initWithFrame):

Source/WebKit2:

Patch by Youenn Fablet &lt;youennf@gmail.com&gt; on 2017-01-25
Reviewed by Alex Christensen.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformWincmake">trunk/Source/WebCore/PlatformWin.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationcpp">trunk/Source/WebCore/page/PageConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationh">trunk/Source/WebCore/page/PageConfiguration.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImagecpp">trunk/Source/WebCore/svg/graphics/SVGImage.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/platform/mediastream/libwebrtc/</li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCMacrosh">trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCMacros.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCProviderh">trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCUtilscpp">trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCUtilsh">trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/CMakeLists.txt        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opentype&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/transforms&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/mediastream&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/platform/mediastream/libwebrtc&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/mock&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/mock/mediasource&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/network&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/ChangeLog        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2017-01-25  Youenn Fablet  &lt;youennf@gmail.com&gt;
+
+        [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
+        https://bugs.webkit.org/show_bug.cgi?id=167294
+
+        Reviewed by Alex Christensen.
+
+        Introducing LibWebRTCMacros.h which should be included before any libwebrtc header.
+
+        Introducing LibWebRTCProvider as the abstraction allowing to suport WK1 and WK2 libwebrtc-based WebRTC endpoints.
+        It  will create a libwebrtc peerconnection object differently in WK1 and WK2 as networking will be done differently.
+
+        LibWebRTCUtils contains routines used by WK1 and WK2 RTC providers to create the libwebrtc peerconnection object
+        and implement the necessary functionalities for it.
+
+        Updating PageConfiguration accordingly.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        * page/Page.h:
+        (WebCore::Page::libWebRTCProvider):
+        * page/PageConfiguration.cpp:
+        (WebCore::PageConfiguration::PageConfiguration):
+        * page/PageConfiguration.h:
+        * platform/mediastream/libwebrtc/LibWebRTCMacros.h: Added.
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.h: Added.
+        * platform/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
+        (WebCore::staticFactoryAndThreads):
+        (WebCore::ThreadMessageData::ThreadMessageData):
+        (WebCore::PeerConnectionFactoryAndThreads::OnMessage):
+        (WebCore::callOnWebRTCNetworkThread):
+        (WebCore::initializePeerConnectionFactoryAndThreads):
+        (WebCore::initializeLibWebRTCInternalsWithSocketServer):
+        (WebCore::peerConnectionFactory):
+        (WebCore::createPeerConnection):
+        * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
</ins><span class="cx"> 2017-01-25  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for named pasteboards, pasteboard strategies and platform pasteboards
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformWin.cmake (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformWin.cmake        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/PlatformWin.cmake        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -243,6 +243,8 @@
</span><span class="cx">     platform/graphics/transforms
</span><span class="cx">     platform/graphics/win
</span><span class="cx"> 
</span><ins>+    platform/mediastream/libwebrtc
+
</ins><span class="cx">     platform/text/transcoder
</span><span class="cx"> 
</span><span class="cx">     rendering/line
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -1534,6 +1534,10 @@
</span><span class="cx">                 4150F9F112B6E0E70008C860 /* SliderThumbElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */; };
</span><span class="cx">                 4150F9F212B6E0E70008C860 /* SliderThumbElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */; };
</span><span class="cx">                 415670471DBE1533009AC3BB /* PeerConnectionStates.h in Headers */ = {isa = PBXBuildFile; fileRef = 415670461DBE1524009AC3BB /* PeerConnectionStates.h */; };
</span><ins>+                415747471E3869A400E914D8 /* LibWebRTCMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 415747431E38699E00E914D8 /* LibWebRTCMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                415747481E3869A700E914D8 /* LibWebRTCProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 415747441E38699E00E914D8 /* LibWebRTCProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                415747491E3869AA00E914D8 /* LibWebRTCUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 415747451E38699E00E914D8 /* LibWebRTCUtils.cpp */; };
+                4157474A1E3869AD00E914D8 /* LibWebRTCUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 415747461E38699E00E914D8 /* LibWebRTCUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 4157AF8012F1FB0400A8C6F5 /* MediaControlsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 4157AF7E12F1FB0400A8C6F5 /* MediaControlsApple.h */; };
</span><span class="cx">                 4157AF8112F1FB0400A8C6F5 /* MediaControlsApple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4157AF7F12F1FB0400A8C6F5 /* MediaControlsApple.cpp */; };
</span><span class="cx">                 41614A781DA6423B004AD06F /* HTTPHeaderValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41614A761DA64236004AD06F /* HTTPHeaderValues.cpp */; };
</span><span class="lines">@@ -8704,6 +8708,10 @@
</span><span class="cx">                 4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SliderThumbElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SliderThumbElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 415670461DBE1524009AC3BB /* PeerConnectionStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerConnectionStates.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                415747431E38699E00E914D8 /* LibWebRTCMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCMacros.h; path = libwebrtc/LibWebRTCMacros.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                415747441E38699E00E914D8 /* LibWebRTCProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCProvider.h; path = libwebrtc/LibWebRTCProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                415747451E38699E00E914D8 /* LibWebRTCUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibWebRTCUtils.cpp; path = libwebrtc/LibWebRTCUtils.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                415747461E38699E00E914D8 /* LibWebRTCUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCUtils.h; path = libwebrtc/LibWebRTCUtils.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 4157AF7E12F1FB0400A8C6F5 /* MediaControlsApple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControlsApple.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4157AF7F12F1FB0400A8C6F5 /* MediaControlsApple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlsApple.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41614A761DA64236004AD06F /* HTTPHeaderValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderValues.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15210,6 +15218,7 @@
</span><span class="cx">                 07221B9217CF0AD400848E51 /* mediastream */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                415747421E38698000E914D8 /* libwebrtc */,
</ins><span class="cx">                                 0729B14D17CFCCA0004F1D60 /* mac */,
</span><span class="cx">                                 07D6A4F61BF2307D00174146 /* AudioTrackPrivateMediaStream.h */,
</span><span class="cx">                                 07B7116A1D899E63009F0FFB /* CaptureDevice.h */,
</span><span class="lines">@@ -16622,6 +16631,17 @@
</span><span class="cx">                         path = shadow;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                415747421E38698000E914D8 /* libwebrtc */ = {
+                        isa = PBXGroup;
+                        children = (
+                                415747431E38699E00E914D8 /* LibWebRTCMacros.h */,
+                                415747441E38699E00E914D8 /* LibWebRTCProvider.h */,
+                                415747451E38699E00E914D8 /* LibWebRTCUtils.cpp */,
+                                415747461E38699E00E914D8 /* LibWebRTCUtils.h */,
+                        );
+                        name = libwebrtc;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 417DA4CD13734204007C57FB /* testing */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -25719,6 +25739,7 @@
</span><span class="cx">                                 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */,
</span><span class="cx">                                 A8136D380973A8E700D74463 /* FormDataList.h in Headers */,
</span><span class="cx">                                 7EE6846712D26E3800E79415 /* FormDataStreamCFNet.h in Headers */,
</span><ins>+                                4157474A1E3869AD00E914D8 /* LibWebRTCUtils.h in Headers */,
</ins><span class="cx">                                 514C764E0CE9234E007EF3CD /* FormDataStreamMac.h in Headers */,
</span><span class="cx">                                 9B50B1DE17CD4C0F0087F63C /* FormNamedItem.h in Headers */,
</span><span class="cx">                                 656D373A0ADBA5DE00A4554D /* FormState.h in Headers */,
</span><span class="lines">@@ -25800,6 +25821,7 @@
</span><span class="cx">                                 4969B0F313D0B33F00DF3521 /* HitTestingTransformState.h in Headers */,
</span><span class="cx">                                 2D8287F716E4A0380086BD00 /* HitTestLocation.h in Headers */,
</span><span class="cx">                                 930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */,
</span><ins>+                                415747471E3869A400E914D8 /* LibWebRTCMacros.h in Headers */,
</ins><span class="cx">                                 9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */,
</span><span class="cx">                                 BC3BC29C0E91AB0F00835588 /* HostWindow.h in Headers */,
</span><span class="cx">                                 FD31609912B026F700C1A359 /* HRTFDatabase.h in Headers */,
</span><span class="lines">@@ -27460,6 +27482,7 @@
</span><span class="cx">                                 4998AEC613F9D0EA0090B1AA /* RequestAnimationFrameCallback.h in Headers */,
</span><span class="cx">                                 F55B3DD01251F12D003EF269 /* ResetInputType.h in Headers */,
</span><span class="cx">                                 7EE6846A12D26E3800E79415 /* ResourceError.h in Headers */,
</span><ins>+                                415747481E3869A700E914D8 /* LibWebRTCProvider.h in Headers */,
</ins><span class="cx">                                 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
</span><span class="cx">                                 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
</span><span class="cx">                                 26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
</span><span class="lines">@@ -31300,6 +31323,7 @@
</span><span class="cx">                                 512DD8E30D91E2B4000F89EE /* SharedBufferCF.cpp in Sources */,
</span><span class="cx">                                 97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */,
</span><span class="cx">                                 1A4A95520B4EDCFF002D8C3C /* SharedBufferCocoa.mm in Sources */,
</span><ins>+                                415747491E3869AA00E914D8 /* LibWebRTCUtils.cpp in Sources */,
</ins><span class="cx">                                 163E88F7118A39D200ED9231 /* SimpleFontDataCoreText.cpp in Sources */,
</span><span class="cx">                                 E48944A2180B57D800F165D8 /* SimpleLineLayout.cpp in Sources */,
</span><span class="cx">                                 585D6E031A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;InspectorClient.h&quot;
</span><span class="cx"> #include &quot;InspectorOverlayPage.h&quot;
</span><ins>+#include &quot;LibWebRTCProvider.h&quot;
</ins><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;Node.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="lines">@@ -859,7 +860,11 @@
</span><span class="cx">     if (m_overlayPage)
</span><span class="cx">         return m_overlayPage.get();
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration(createEmptyEditorClient(), SocketProvider::create());
</del><ins>+    PageConfiguration pageConfiguration(
+        createEmptyEditorClient(),
+        SocketProvider::create(),
+        makeUniqueRef&lt;LibWebRTCProvider&gt;()
+    );
</ins><span class="cx">     fillWithEmptyClients(pageConfiguration);
</span><span class="cx">     m_overlayPage = std::make_unique&lt;Page&gt;(WTFMove(pageConfiguration));
</span><span class="cx">     m_overlayPage-&gt;setDeviceScaleFactor(m_page.deviceScaleFactor());
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/page/Page.cpp        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> #include &quot;HistoryItem.h&quot;
</span><span class="cx"> #include &quot;InspectorController.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><ins>+#include &quot;LibWebRTCProvider.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;MediaCanStartListener.h&quot;
</span><span class="lines">@@ -201,6 +202,7 @@
</span><span class="cx">     , m_validationMessageClient(WTFMove(pageConfiguration.validationMessageClient))
</span><span class="cx">     , m_diagnosticLoggingClient(WTFMove(pageConfiguration.diagnosticLoggingClient))
</span><span class="cx">     , m_webGLStateTracker(WTFMove(pageConfiguration.webGLStateTracker))
</span><ins>+    , m_libWebRTCProvider(WTFMove(pageConfiguration.libWebRTCProvider))
</ins><span class="cx">     , m_openedByDOM(false)
</span><span class="cx">     , m_tabKeyCyclesThroughElements(true)
</span><span class="cx">     , m_defersLoading(false)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/page/Page.h        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> class UserInputBridge;
</span><span class="cx"> class InspectorClient;
</span><span class="cx"> class InspectorController;
</span><ins>+class LibWebRTCProvider;
</ins><span class="cx"> class MainFrame;
</span><span class="cx"> class MediaCanStartListener;
</span><span class="cx"> class MediaPlaybackTarget;
</span><span class="lines">@@ -109,9 +110,7 @@
</span><span class="cx"> class PluginData;
</span><span class="cx"> class PluginInfoProvider;
</span><span class="cx"> class PluginViewBase;
</span><del>-#if ENABLE(POINTER_LOCK)
</del><span class="cx"> class PointerLockController;
</span><del>-#endif
</del><span class="cx"> class ProgressTracker;
</span><span class="cx"> class ProgressTrackerClient;
</span><span class="cx"> class Range;
</span><span class="lines">@@ -223,6 +222,7 @@
</span><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><span class="cx">     PointerLockController&amp; pointerLockController() const { return *m_pointerLockController; }
</span><span class="cx"> #endif
</span><ins>+    LibWebRTCProvider&amp; libWebRTCProvider() { return m_libWebRTCProvider.get(); }
</ins><span class="cx"> 
</span><span class="cx">     ValidationMessageClient* validationMessageClient() const { return m_validationMessageClient.get(); }
</span><span class="cx">     void updateValidationBubbleStateIfNeeded();
</span><span class="lines">@@ -631,6 +631,8 @@
</span><span class="cx">     std::unique_ptr&lt;DiagnosticLoggingClient&gt; m_diagnosticLoggingClient;
</span><span class="cx">     std::unique_ptr&lt;WebGLStateTracker&gt; m_webGLStateTracker;
</span><span class="cx"> 
</span><ins>+    UniqueRef&lt;LibWebRTCProvider&gt; m_libWebRTCProvider;
+
</ins><span class="cx">     int m_nestedRunLoopCount { 0 };
</span><span class="cx">     std::function&lt;void()&gt; m_unnestCallback;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.cpp        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
</span><span class="cx">  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><del>- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</del><ins>+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</ins><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;DatabaseProvider.h&quot;
</span><span class="cx"> #include &quot;DiagnosticLoggingClient.h&quot;
</span><span class="cx"> #include &quot;EditorClient.h&quot;
</span><ins>+#include &quot;LibWebRTCProvider.h&quot;
</ins><span class="cx"> #include &quot;PluginInfoProvider.h&quot;
</span><span class="cx"> #include &quot;SocketProvider.h&quot;
</span><span class="cx"> #include &quot;StorageNamespaceProvider.h&quot;
</span><span class="lines">@@ -41,9 +42,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PageConfiguration::PageConfiguration(UniqueRef&lt;EditorClient&gt;&amp;&amp; editorClient, Ref&lt;SocketProvider&gt;&amp;&amp; socketProvider)
</del><ins>+PageConfiguration::PageConfiguration(UniqueRef&lt;EditorClient&gt;&amp;&amp; editorClient, Ref&lt;SocketProvider&gt;&amp;&amp; socketProvider, UniqueRef&lt;LibWebRTCProvider&gt;&amp;&amp; libWebRTCProvider)
</ins><span class="cx">     : editorClient(WTFMove(editorClient))
</span><span class="cx">     , socketProvider(WTFMove(socketProvider))
</span><ins>+    , libWebRTCProvider(WTFMove(libWebRTCProvider))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.h (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.h        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/page/PageConfiguration.h        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
</span><span class="cx">  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><del>- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</del><ins>+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</ins><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> class ApplicationCacheStorage;
</span><span class="cx"> class BackForwardClient;
</span><span class="cx"> class ChromeClient;
</span><ins>+class ContextMenuClient;
</ins><span class="cx"> class DatabaseProvider;
</span><span class="cx"> class DiagnosticLoggingClient;
</span><span class="cx"> class DragClient;
</span><span class="lines">@@ -41,6 +42,7 @@
</span><span class="cx"> class EditorClient;
</span><span class="cx"> class FrameLoaderClient;
</span><span class="cx"> class InspectorClient;
</span><ins>+class LibWebRTCProvider;
</ins><span class="cx"> class PaymentCoordinatorClient;
</span><span class="cx"> class PlugInClient;
</span><span class="cx"> class PluginInfoProvider;
</span><span class="lines">@@ -52,14 +54,10 @@
</span><span class="cx"> class VisitedLinkStore;
</span><span class="cx"> class WebGLStateTracker;
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTEXT_MENUS)
-class ContextMenuClient;
-#endif
-
</del><span class="cx"> class PageConfiguration {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    WEBCORE_EXPORT PageConfiguration(UniqueRef&lt;EditorClient&gt;&amp;&amp;, Ref&lt;SocketProvider&gt;&amp;&amp;);
</del><ins>+    WEBCORE_EXPORT PageConfiguration(UniqueRef&lt;EditorClient&gt;&amp;&amp;, Ref&lt;SocketProvider&gt;&amp;&amp;, UniqueRef&lt;LibWebRTCProvider&gt;&amp;&amp;);
</ins><span class="cx">     WEBCORE_EXPORT ~PageConfiguration();
</span><span class="cx"> 
</span><span class="cx">     AlternativeTextClient* alternativeTextClient { nullptr };
</span><span class="lines">@@ -75,6 +73,8 @@
</span><span class="cx">     PaymentCoordinatorClient* paymentCoordinatorClient { nullptr };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    UniqueRef&lt;LibWebRTCProvider&gt; libWebRTCProvider;
+
</ins><span class="cx">     PlugInClient* plugInClient { nullptr };
</span><span class="cx">     ProgressTrackerClient* progressTrackerClient { nullptr };
</span><span class="cx">     RefPtr&lt;BackForwardClient&gt; backForwardClient;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCMacrosh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCMacros.h (0 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCMacros.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCMacros.h        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(LIBWEBRTC)
+
+#if PLATFORM(IOS)
+#define WEBRTC_IOS
+#endif
+
+#if PLATFORM(MAC)
+#define WEBRTC_MAC
+#endif
+
+#define WEBRTC_POSIX 1
+#define _COMMON_INCLUDED_
+
+#endif // USE(LIBWEBRTC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCProviderh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h (0 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(LIBWEBRTC)
+#include &quot;LibWebRTCMacros.h&quot;
+#include &lt;webrtc/api/peerconnectioninterface.h&gt;
+#endif
+
+namespace WebCore {
+
+class WEBCORE_EXPORT LibWebRTCProvider {
+public:
+#if USE(LIBWEBRTC)
+    virtual rtc::scoped_refptr&lt;webrtc::PeerConnectionInterface&gt; createPeerConnection(webrtc::PeerConnectionObserver&amp;) { return createPeerConnection(observer); };
+#endif
+    virtual ~LibWebRTCProvider() = default;
+
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCUtilscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp (0 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -0,0 +1,147 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;LibWebRTCUtils.h&quot;
+
+#if USE(LIBWEBRTC)
+
+#include &lt;webrtc/api/peerconnectionfactory.h&gt;
+#include &lt;webrtc/base/physicalsocketserver.h&gt;
+#include &lt;webrtc/p2p/client/basicportallocator.h&gt;
+#include &lt;webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.h&gt;
+#include &lt;wtf/Function.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+
+namespace WebCore {
+
+struct PeerConnectionFactoryAndThreads : public rtc::MessageHandler {
+    std::unique_ptr&lt;rtc::Thread&gt; networkThread;
+    std::unique_ptr&lt;rtc::Thread&gt; signalingThread;
+    rtc::scoped_refptr&lt;webrtc::PeerConnectionFactoryInterface&gt; factory;
+    bool networkThreadWithSocketServer { false };
+private:
+    void OnMessage(rtc::Message*);
+};
+
+static inline PeerConnectionFactoryAndThreads&amp; staticFactoryAndThreads()
+{
+    static NeverDestroyed&lt;PeerConnectionFactoryAndThreads&gt; factoryAndThreads;
+    return factoryAndThreads.get();
+}
+
+struct ThreadMessageData : public rtc::MessageData {
+    ThreadMessageData(Function&lt;void()&gt;&amp;&amp; callback)
+        : callback(WTFMove(callback))
+    { }
+    Function&lt;void()&gt; callback;
+};
+
+void PeerConnectionFactoryAndThreads::OnMessage(rtc::Message* message)
+{
+    ASSERT(message-&gt;message_id == 1);
+    static_cast&lt;ThreadMessageData*&gt;(message-&gt;pdata)-&gt;callback();
+}
+
+void callOnWebRTCNetworkThread(Function&lt;void()&gt;&amp;&amp; callback)
+{
+    PeerConnectionFactoryAndThreads&amp; threads = staticFactoryAndThreads();
+    threads.networkThread-&gt;Post(RTC_FROM_HERE, &amp;threads, 1, new ThreadMessageData(WTFMove(callback)));
+}
+
+static void initializePeerConnectionFactoryAndThreads()
+{
+    auto&amp; factoryAndThreads = staticFactoryAndThreads();
+
+    ASSERT(!factoryAndThreads.factory);
+
+    auto thread = rtc::Thread::Create();
+    factoryAndThreads.networkThread = factoryAndThreads.networkThreadWithSocketServer ? rtc::Thread::CreateWithSocketServer() : rtc::Thread::Create();
+    bool result = factoryAndThreads.networkThread-&gt;Start();
+    ASSERT_UNUSED(result, result);
+
+    factoryAndThreads.signalingThread = rtc::Thread::Create();
+    result = factoryAndThreads.signalingThread-&gt;Start();
+    ASSERT(result);
+
+    factoryAndThreads.factory = webrtc::CreatePeerConnectionFactory(factoryAndThreads.networkThread.get(), factoryAndThreads.networkThread.get(), factoryAndThreads.signalingThread.get(), nullptr, new webrtc::VideoToolboxVideoEncoderFactory() , new webrtc::VideoToolboxVideoDecoderFactory());
+
+    ASSERT(factoryAndThreads.factory);
+}
+
+void initializeLibWebRTCInternalsWithSocketServer()
+{
+    staticFactoryAndThreads().networkThreadWithSocketServer = true;
+}
+
+webrtc::PeerConnectionFactoryInterface&amp; peerConnectionFactory()
+{
+    if (!staticFactoryAndThreads().factory)
+        initializePeerConnectionFactoryAndThreads();
+    return *staticFactoryAndThreads().factory;
+}
+
+static rtc::scoped_refptr&lt;webrtc::PeerConnectionInterface&gt; createPeerConnection(webrtc::PeerConnectionObserver&amp; observer, std::unique_ptr&lt;cricket::BasicPortAllocator&gt;&amp;&amp; portAllocator)
+{
+    ASSERT(staticFactoryAndThreads().factory);
+
+    webrtc::PeerConnectionInterface::RTCConfiguration config;
+    // FIXME: Add a default configuration.
+    return staticFactoryAndThreads().factory-&gt;CreatePeerConnection(config, WTFMove(portAllocator), nullptr, &amp;observer);
+}
+
+rtc::scoped_refptr&lt;webrtc::PeerConnectionInterface&gt; createPeerConnection(webrtc::PeerConnectionObserver&amp; observer)
+{
+    ASSERT(staticFactoryAndThreads().networkThreadWithSocketServer);
+
+    auto&amp; factoryAndThreads = staticFactoryAndThreads();
+    if (!factoryAndThreads.factory)
+        initializePeerConnectionFactoryAndThreads();
+
+    return createPeerConnection(observer, nullptr);
+}
+
+rtc::scoped_refptr&lt;webrtc::PeerConnectionInterface&gt; createPeerConnection(webrtc::PeerConnectionObserver&amp; observer, rtc::NetworkManager&amp; networkManager, rtc::PacketSocketFactory&amp; packetSocketFactory)
+{
+    ASSERT(!staticFactoryAndThreads().networkThreadWithSocketServer);
+
+    auto&amp; factoryAndThreads = staticFactoryAndThreads();
+    if (!factoryAndThreads.factory)
+        initializePeerConnectionFactoryAndThreads();
+
+    std::unique_ptr&lt;cricket::BasicPortAllocator&gt; portAllocator;
+    staticFactoryAndThreads().signalingThread-&gt;Invoke&lt;void&gt;(RTC_FROM_HERE, [&amp;]() {
+        portAllocator.reset(new cricket::BasicPortAllocator(&amp;networkManager, &amp;packetSocketFactory));
+    });
+
+    return createPeerConnection(observer, WTFMove(portAllocator));
+}
+
+} // namespace WebCore
+
+#endif // USE(LIBWEBRTC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCUtilsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.h (0 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.h        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(LIBWEBRTC)
+
+#include &quot;LibWebRTCMacros.h&quot;
+#include &lt;webrtc/base/scoped_ref_ptr.h&gt;
+#include &lt;wtf/Forward.h&gt;
+
+namespace rtc {
+class NetworkManager;
+class PacketSocketFactory;
+}
+
+namespace webrtc {
+class PeerConnectionFactoryInterface;
+class PeerConnectionInterface;
+class PeerConnectionObserver;
+}
+
+namespace WebCore {
+
+WEBCORE_EXPORT void initializeLibWebRTCInternalsWithSocketServer();
+
+webrtc::PeerConnectionFactoryInterface&amp; peerConnectionFactory();
+WEBCORE_EXPORT rtc::scoped_refptr&lt;webrtc::PeerConnectionInterface&gt; createPeerConnection(webrtc::PeerConnectionObserver&amp;, rtc::NetworkManager&amp;, rtc::PacketSocketFactory&amp;);
+WEBCORE_EXPORT rtc::scoped_refptr&lt;webrtc::PeerConnectionInterface&gt; createPeerConnection(webrtc::PeerConnectionObserver&amp;);
+
+WEBCORE_EXPORT void callOnWebRTCNetworkThread(Function&lt;void()&gt;&amp;&amp;);
+
+} // namespace WebCore
+
+#endif // USE(LIBWEBRTC)
</ins></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;ImageObserver.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;JSDOMWindowBase.h&quot;
</span><ins>+#include &quot;LibWebRTCProvider.h&quot;
</ins><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PageConfiguration.h&quot;
</span><span class="lines">@@ -414,7 +415,11 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     if (allDataReceived) {
</span><del>-        PageConfiguration pageConfiguration(createEmptyEditorClient(), SocketProvider::create());
</del><ins>+        PageConfiguration pageConfiguration(
+            createEmptyEditorClient(),
+            SocketProvider::create(),
+            makeUniqueRef&lt;LibWebRTCProvider&gt;()
+        );
</ins><span class="cx">         fillWithEmptyClients(pageConfiguration);
</span><span class="cx">         m_chromeClient = std::make_unique&lt;SVGImageChromeClient&gt;(this);
</span><span class="cx">         pageConfiguration.chromeClient = m_chromeClient.get();
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-01-24  Youenn Fablet  &lt;youennf@gmail.com&gt;
+
+        [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
+        https://bugs.webkit.org/show_bug.cgi?id=167294
+
+        Reviewed by Alex Christensen.
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+
</ins><span class="cx"> 2017-01-25  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for named pasteboards, pasteboard strategies and platform pasteboards
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -157,6 +157,7 @@
</span><span class="cx"> #import &lt;WebCore/JSElement.h&gt;
</span><span class="cx"> #import &lt;WebCore/JSNodeList.h&gt;
</span><span class="cx"> #import &lt;WebCore/JSNotification.h&gt;
</span><ins>+#import &lt;WebCore/LibWebRTCProvider.h&gt;
</ins><span class="cx"> #import &lt;WebCore/LocalizedStrings.h&gt;
</span><span class="cx"> #import &lt;WebCore/LogInitialization.h&gt;
</span><span class="cx"> #import &lt;WebCore/MIMETypeRegistry.h&gt;
</span><span class="lines">@@ -1342,7 +1343,11 @@
</span><span class="cx">     _private-&gt;group = WebViewGroup::getOrCreate(groupName, _private-&gt;preferences._localStorageDatabasePath);
</span><span class="cx">     _private-&gt;group-&gt;addWebView(self);
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration(makeUniqueRef&lt;WebEditorClient&gt;(self), SocketProvider::create());
</del><ins>+    PageConfiguration pageConfiguration(
+        makeUniqueRef&lt;WebEditorClient&gt;(self),
+        SocketProvider::create(),
+        makeUniqueRef&lt;WebCore::LibWebRTCProvider&gt;()
+    );
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     pageConfiguration.chromeClient = new WebChromeClient(self);
</span><span class="cx">     pageConfiguration.contextMenuClient = new WebContextMenuClient(self);
</span><span class="lines">@@ -1597,7 +1602,11 @@
</span><span class="cx">     _private-&gt;group = WebViewGroup::getOrCreate(groupName, _private-&gt;preferences._localStorageDatabasePath);
</span><span class="cx">     _private-&gt;group-&gt;addWebView(self);
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration(makeUniqueRef&lt;WebEditorClient&gt;(self), SocketProvider::create());
</del><ins>+    PageConfiguration pageConfiguration(
+        makeUniqueRef&lt;WebEditorClient&gt;(self),
+        SocketProvider::create(),
+        makeUniqueRef&lt;WebCore::LibWebRTCProvider&gt;()
+    );
</ins><span class="cx">     pageConfiguration.chromeClient = new WebChromeClientIOS(self);
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     pageConfiguration.dragClient = new WebDragClient(self);
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebKit/win/ChangeLog        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-01-24  Youenn Fablet  &lt;youennf@gmail.com&gt;
+
+        [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
+        https://bugs.webkit.org/show_bug.cgi?id=167294
+
+        Reviewed by Alex Christensen.
+
+        * WebView.cpp:
+        (WebView::initWithFrame):
+
</ins><span class="cx"> 2017-01-23  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr&lt;WebCore::Element&gt;::operator* const + 70
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebKit/win/WebView.cpp        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/KeyboardEvent.h&gt;
</span><ins>+#include &lt;WebCore/LibWebRTCProvider.h&gt;
</ins><span class="cx"> #include &lt;WebCore/LogInitialization.h&gt;
</span><span class="cx"> #include &lt;WebCore/Logging.h&gt;
</span><span class="cx"> #include &lt;WebCore/MIMETypeRegistry.h&gt;
</span><span class="lines">@@ -3099,7 +3100,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_inspectorClient = new WebInspectorClient(this);
</span><span class="cx"> 
</span><del>-    PageConfiguration configuration(makeUniqueRef&lt;WebEditorClient&gt;(this), SocketProvider::create());
</del><ins>+    PageConfiguration configuration(
+        makeUniqueRef&lt;WebEditorClient&gt;(this),
+        SocketProvider::create(),
+        makeUniqueRef&lt;LibWebRTCProvider&gt;()
+    );
</ins><span class="cx">     configuration.backForwardClient = BackForwardList::create();
</span><span class="cx">     configuration.chromeClient = new WebChromeClient(this);
</span><span class="cx">     configuration.contextMenuClient = new WebContextMenuClient(this);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebKit2/ChangeLog        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-01-25  Youenn Fablet  &lt;youennf@gmail.com&gt;
+
+        [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
+        https://bugs.webkit.org/show_bug.cgi?id=167294
+
+        Reviewed by Alex Christensen.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_userInterfaceLayoutDirection):
+
</ins><span class="cx"> 2017-01-25  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Move WKPDFView's password view to WKWebView
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (211160 => 211161)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-01-25 20:48:41 UTC (rev 211160)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-01-25 21:00:11 UTC (rev 211161)
</span><span class="lines">@@ -147,6 +147,7 @@
</span><span class="cx"> #include &lt;WebCore/InspectorController.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSDOMWindow.h&gt;
</span><span class="cx"> #include &lt;WebCore/KeyboardEvent.h&gt;
</span><ins>+#include &lt;WebCore/LibWebRTCProvider.h&gt;
</ins><span class="cx"> #include &lt;WebCore/MIMETypeRegistry.h&gt;
</span><span class="cx"> #include &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #include &lt;WebCore/MouseEvent.h&gt;
</span><span class="lines">@@ -373,7 +374,11 @@
</span><span class="cx">     Settings::setShouldManageAudioSessionCategory(true);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration(makeUniqueRef&lt;WebEditorClient&gt;(this), WebSocketProvider::create());
</del><ins>+    PageConfiguration pageConfiguration(
+        makeUniqueRef&lt;WebEditorClient&gt;(this),
+        WebSocketProvider::create(),
+        makeUniqueRef&lt;WebCore::LibWebRTCProvider&gt;()
+    );
</ins><span class="cx">     pageConfiguration.chromeClient = new WebChromeClient(*this);
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     pageConfiguration.contextMenuClient = new WebContextMenuClient(this);
</span></span></pre>
</div>
</div>

</body>
</html>