fix_expose_decrementcapturercount_in_web_contents_impl.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: deepak1556 <[email protected]>
  3. Date: Fri, 3 Sep 2021 18:28:51 -0700
  4. Subject: fix: expose DecrementCapturerCount in web_contents_impl
  5. This was made private in https://chromium-review.googlesource.com/c/chromium/src/+/2807829 but
  6. we invoke it in order to expose contents.decrementCapturerCount([stayHidden, stayAwake])
  7. to users. We should try to upstream this.
  8. diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
  9. index 55224f960151b0cae23b2a49d755eace630e9e3a..86ab5a5e5e3e881fdaf3528640f097493123da74 100644
  10. --- a/content/browser/web_contents/web_contents_impl.h
  11. +++ b/content/browser/web_contents/web_contents_impl.h
  12. @@ -1827,7 +1827,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
  13. // IncrementCapturerCount() is destructed.
  14. void DecrementCapturerCount(bool stay_hidden,
  15. bool stay_awake,
  16. - bool is_activity = true);
  17. + bool is_activity = true) override;
  18. // Calculates the PageVisibilityState for |visibility|, taking the capturing
  19. // state into account.
  20. diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
  21. index d159f44dc855fee799f7b97b59a2a4e64631e7b4..b583fb7ff191d5dfce4b8fee5f06e074b3a6ea4f 100644
  22. --- a/content/public/browser/web_contents.h
  23. +++ b/content/public/browser/web_contents.h
  24. @@ -673,6 +673,10 @@ class WebContents : public PageNavigator,
  25. bool stay_awake,
  26. bool is_activity = true) = 0;
  27. + virtual void DecrementCapturerCount(bool stay_hidden,
  28. + bool stay_awake,
  29. + bool is_activity = true) = 0;
  30. +
  31. // Getter for the capture handle, which allows a captured application to
  32. // opt-in to exposing information to its capturer(s).
  33. virtual const blink::mojom::CaptureHandleConfig& GetCaptureHandleConfig() = 0;