summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0031.patch
blob: 00f1479dcee0f37f4f707e856e4448b6ce5a52bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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