12345678910111213141516171819202122232425262728293031323334353637383940 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Shelley Vohr <[email protected]>
- Date: Fri, 9 Apr 2021 19:30:01 +0200
- Subject: fix: expose DecrementCapturerCount in web_contents_impl
- This was made private in https://chromium-review.googlesource.com/c/chromium/src/+/2807829 but
- we invoke it in order to expose contents.decrementCapturerCount([stayHidden, stayAwake])
- to users. We should try to upstream this.
- diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
- index e379c4cf966a96ace1bd692cda31bae032f13acf..b800ca0aa616ae347f93156ccef79032f3ea1608 100644
- --- a/content/browser/web_contents/web_contents_impl.h
- +++ b/content/browser/web_contents/web_contents_impl.h
- @@ -1772,10 +1772,12 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
- // outermost frame trees in this WebContents.
- std::vector<RenderFrameHostImpl*> GetOutermostMainFrames();
-
- + public:
- // Called when the base::ScopedClosureRunner returned by
- // IncrementCapturerCount() is destructed.
- - void DecrementCapturerCount(bool stay_hidden, bool stay_awake);
- + void DecrementCapturerCount(bool stay_hidden, bool stay_awake) override;
-
- + private:
- // Calculates the PageVisibilityState for |visibility|, taking the capturing
- // state into account.
- PageVisibilityState CalculatePageVisibilityState(Visibility visibility) const;
- diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
- index 67fb7c487e68af563859e76d4b0f46e44756128a..49189dadc4dba04f789e8b562a11205055231155 100644
- --- a/content/public/browser/web_contents.h
- +++ b/content/public/browser/web_contents.h
- @@ -631,6 +631,8 @@ class WebContents : public PageNavigator,
- bool stay_hidden,
- bool stay_awake) WARN_UNUSED_RESULT = 0;
-
- + virtual void DecrementCapturerCount(bool stay_hidden, bool stay_awake) = 0;
- +
- // Getter for the capture handle, which allows a captured application to
- // opt-in to exposing information to its capturer(s).
- virtual const blink::mojom::CaptureHandleConfig& GetCaptureHandleConfig() = 0;
|