Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1474)

Unified Diff: content/browser/presentation/presentation_service_impl.h

Issue 2343013002: [Presentation API] (MR side) 1-UA: notify receiver page when receiver connection becomes available (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/presentation/presentation_service_impl.h
diff --git a/content/browser/presentation/presentation_service_impl.h b/content/browser/presentation/presentation_service_impl.h
index dea2c88c37d89940f495810411836156aac20d6c..292bbff20361be3b15ca8077229c5f42c593fc8c 100644
--- a/content/browser/presentation/presentation_service_impl.h
+++ b/content/browser/presentation/presentation_service_impl.h
@@ -48,7 +48,8 @@ class RenderFrameHost;
class CONTENT_EXPORT PresentationServiceImpl
: public NON_EXPORTED_BASE(blink::mojom::PresentationService),
public WebContentsObserver,
- public PresentationServiceDelegate::Observer {
+ public PresentationServiceDelegate::Observer,
+ public OffscreenPresentationClient {
public:
using NewSessionCallback =
base::Callback<void(blink::mojom::PresentationSessionInfoPtr,
@@ -234,6 +235,15 @@ class CONTENT_EXPORT PresentationServiceImpl
const ScopedVector<PresentationSessionMessage>& messages,
bool pass_ownership);
+ // OffscreenPresentationClient Implementation
+ void OnReceiverConnectionAvailable(
+ const content::PresentationSessionInfo&) override;
+
+ void AddOffscreenPresentationObserver(OffscreenPresentationClient*) override;
+
+ void RemoveOffscreenPresentationObserver(
+ OffscreenPresentationClient*) override;
+
// Associates a JoinSession |callback| with a unique request ID and
// stores it in a map.
// Returns a positive value on success.
@@ -284,6 +294,11 @@ class CONTENT_EXPORT PresentationServiceImpl
int render_process_id_;
int render_frame_id_;
+ // Offscreen presentation observer list for current frame.
+ // For controller PSImpl, it contains corresponding receiver PSImpl,
+ // and vise versa.
+ std::set<OffscreenPresentationClient*> offscreen_presentation_observers_;
+
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<PresentationServiceImpl> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698