fix_expose_decrementcapturercount_in_web_contents_impl.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Shelley Vohr <[email protected]>
  3. Date: Fri, 9 Apr 2021 19:30:01 +0200
  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 b32e156d3ed18f4753eca9d75a39f3ce990bc93f..0354de2c8e8482475a006a1ec3c2df5db8102d3d 100644
  10. --- a/content/browser/web_contents/web_contents_impl.h
  11. +++ b/content/browser/web_contents/web_contents_impl.h
  12. @@ -394,6 +394,9 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
  13. const gfx::Size& capture_size,
  14. bool stay_hidden,
  15. bool stay_awake) override WARN_UNUSED_RESULT;
  16. + // Called when the base::ScopedClosureRunner returned by
  17. + // IncrementCapturerCount() is destructed.
  18. + void DecrementCapturerCount(bool stay_hidden, bool stay_awake) override;
  19. bool IsBeingCaptured() override;
  20. bool IsBeingVisiblyCaptured() override;
  21. bool IsAudioMuted() override;
  22. @@ -1707,10 +1710,6 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
  23. // shown in the address bar), as opposed to one in for example a Prerender.
  24. bool IsPrimaryFrameTree(const FrameTree& frame_tree) const;
  25. - // Called when the base::ScopedClosureRunner returned by
  26. - // IncrementCapturerCount() is destructed.
  27. - void DecrementCapturerCount(bool stay_hidden, bool stay_awake);
  28. -
  29. // Data for core operation ---------------------------------------------------
  30. // Delegate for notifying our owner about stuff. Not owned by us.
  31. diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
  32. index 9d089057f886c7b6b10ded3c2b37f5580f3b67f7..517d5e18e064f23aebd3eed0e6c0a5e41a32c863 100644
  33. --- a/content/public/browser/web_contents.h
  34. +++ b/content/public/browser/web_contents.h
  35. @@ -570,6 +570,7 @@ class WebContents : public PageNavigator,
  36. const gfx::Size& capture_size,
  37. bool stay_hidden,
  38. bool stay_awake) WARN_UNUSED_RESULT = 0;
  39. + virtual void DecrementCapturerCount(bool stay_hidden, bool stay_awake) = 0;
  40. // Returns true if audio/screenshot/video is being captured by the embedder,
  41. // as indicated by calls to IncrementCapturerCount().