summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0031.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0031.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0031.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0031.patch b/third_party/libwebrtc/moz-patch-stack/0031.patch
new file mode 100644
index 0000000000..00f1479dce
--- /dev/null
+++ b/third_party/libwebrtc/moz-patch-stack/0031.patch
@@ -0,0 +1,66 @@
+From: Randell Jesup <rjesup@wgate.com>
+Date: Sat, 11 Jul 2020 12:31:00 +0000
+Subject: Bug 1112392 - Move webrtc Tab Sharing to work in e10s/fission
+ r=dminor
+
+Also we drop support for an independent-of-scroll/viewport capture, which
+the old Tab Sharing supported, for security reasons (and we don't need it).
+
+Differential Revision: https://phabricator.services.mozilla.com/D80974
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d57a030e6e3ae9ff56f14e8cc732b0e1d3869858
+---
+ modules/desktop_capture/desktop_capturer.cc | 11 +++++++++++
+ modules/desktop_capture/desktop_capturer.h | 8 ++++++++
+ 2 files changed, 19 insertions(+)
+
+diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc
+index 5211f1acec..4baa93cab9 100644
+--- a/modules/desktop_capture/desktop_capturer.cc
++++ b/modules/desktop_capture/desktop_capturer.cc
+@@ -101,6 +101,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
+ return capturer;
+ }
+
++// static
++std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateTabCapturer(
++ const DesktopCaptureOptions& options) {
++ std::unique_ptr<DesktopCapturer> capturer = CreateRawTabCapturer(options);
++ if (capturer && options.detect_updated_region()) {
++ capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
++ }
++
++ return capturer;
++}
++
+ #if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
+ bool DesktopCapturer::IsRunningUnderWayland() {
+ const char* xdg_session_type = getenv("XDG_SESSION_TYPE");
+diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h
+index 6909a57891..cf75004af5 100644
+--- a/modules/desktop_capture/desktop_capturer.h
++++ b/modules/desktop_capture/desktop_capturer.h
+@@ -178,6 +178,10 @@ class RTC_EXPORT DesktopCapturer {
+ static std::unique_ptr<DesktopCapturer> CreateScreenCapturer(
+ const DesktopCaptureOptions& options);
+
++ // Creates a DesktopCapturer instance which targets to capture tab.
++ static std::unique_ptr<DesktopCapturer> CreateTabCapturer(
++ const DesktopCaptureOptions& options);
++
+ #if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
+ static bool IsRunningUnderWayland();
+
+@@ -203,6 +207,10 @@ class RTC_EXPORT DesktopCapturer {
+ // capture screens.
+ static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer(
+ const DesktopCaptureOptions& options);
++
++ // Creates a DesktopCapturer instance which targets to capture tabs
++ static std::unique_ptr<DesktopCapturer> CreateRawTabCapturer(
++ const DesktopCaptureOptions& options);
+ };
+
+ } // namespace webrtc
+--
+2.34.1
+