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

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: resolve code review comments from Derek 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..8a13ac29e94e4ae282daf73140ec9f5ca43a29af 100644
--- a/content/browser/presentation/presentation_service_impl.h
+++ b/content/browser/presentation/presentation_service_impl.h
@@ -8,6 +8,7 @@
#include <deque>
#include <map>
#include <memory>
+#include <set>
#include <string>
#include <vector>
@@ -48,7 +49,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 +236,14 @@ class CONTENT_EXPORT PresentationServiceImpl
const ScopedVector<PresentationSessionMessage>& messages,
bool pass_ownership);
+ void OnReceiverConnectionAvailable(const content::PresentationSessionInfo&,
imcheng 2016/09/28 07:28:37 nit: add parameter name and add comment for this m
zhaobin 2016/09/29 17:20:45 Done.
+ OffscreenPresentationClient* controller);
+
+ // OffscreenPresentationClient Implementation
+ void SetOffscreenPresentationClient(OffscreenPresentationClient*) override;
imcheng 2016/09/28 07:28:37 nit: add parameter name here and below
imcheng 2016/09/28 07:28:37 AddOffscreenPresentationClient?
zhaobin 2016/09/29 17:20:45 code removed in new patch
zhaobin 2016/09/29 17:20:45 Function has been removed in new patch.
+
imcheng 2016/09/28 07:28:37 rm blank line
zhaobin 2016/09/29 17:20:45 Done.
+ void RemoveOffscreenPresentationClient(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,12 @@ 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.
+ // TODO(zhaobin): support multiple controllers
+ std::set<OffscreenPresentationClient*> offscreen_presentation_observers_;
imcheng 2016/09/28 07:28:37 suggestion: offscreen_presentation_clients_
imcheng 2016/09/28 07:28:37 nit: Place this field before render_process_id_. P
zhaobin 2016/09/29 17:20:45 object removed in new patch
zhaobin 2016/09/29 17:20:45 object removed in new patch
+
// 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