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

Unified Diff: chrome/browser/media/router/offscreen_presentation_manager.h

Issue 2714783002: [Presentation API] (browser side) Implement reconnect() for 1-UA mode (Closed)
Patch Set: remove duplicate unit tests Created 3 years, 10 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: chrome/browser/media/router/offscreen_presentation_manager.h
diff --git a/chrome/browser/media/router/offscreen_presentation_manager.h b/chrome/browser/media/router/offscreen_presentation_manager.h
index d3a3dabfa8d6f9028898bc54ab51c33376d21012..693892bd267840d0454d96b70d27c4e329a4c526 100644
--- a/chrome/browser/media/router/offscreen_presentation_manager.h
+++ b/chrome/browser/media/router/offscreen_presentation_manager.h
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/threading/thread_checker.h"
+#include "chrome/browser/media/router/media_route.h"
#include "chrome/browser/media/router/render_frame_host_id.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/presentation_service_delegate.h"
@@ -133,6 +134,23 @@ class OffscreenPresentationManager : public KeyedService {
virtual void OnOffscreenPresentationReceiverTerminated(
const std::string& presentation_id);
+ // Register |route| to offscreen presentation object associated with
+ // |presentation_id| and |presentation_url|.
+ // Creates a new presentation if no presentation with |presentation_id|
+ // exists.
+ virtual void RegisterOffscreenPresentationRoute(
+ const std::string& presentation_id,
+ const GURL& presentation_url,
+ const MediaRoute& route);
+
+ // Returns true if this class has an offscreen presentation with
+ // |presentation_id|.
+ virtual bool IsOffscreenPresentation(const std::string& presentation_id);
+
+ // Returns nullptr if |presentation_id| is not associated with an offscreen
+ // presentation.
+ virtual const MediaRoute* GetRoute(const std::string& presentation_id);
+
private:
// Represents an offscreen presentation registered with
// OffscreenPresentationManager. Contains callback to the receiver to inform
@@ -167,6 +185,9 @@ class OffscreenPresentationManager : public KeyedService {
void RegisterReceiver(
const content::ReceiverConnectionAvailableCallback& receiver_callback);
+ // Register |route| to this class.
+ void RegisterRoute(const MediaRoute& route);
+
private:
friend class OffscreenPresentationManagerTest;
friend class OffscreenPresentationManager;
@@ -177,6 +198,7 @@ class OffscreenPresentationManager : public KeyedService {
const std::string presentation_id_;
const GURL presentation_url_;
+ std::unique_ptr<MediaRoute> route_;
imcheng 2017/02/24 01:37:46 What does it mean to have an OffscreenPresentation
zhaobin 2017/02/24 02:35:33 Yes. RegisterReceiver() is invoked by receiver's P
imcheng 2017/02/24 20:52:25 Hmm, this almost feels as if we should have a pres
mark a. foltz 2017/03/01 06:26:32 What if we added a presentationId field to MediaRo
// Callback to invoke whenever a receiver connection is available.
content::ReceiverConnectionAvailableCallback receiver_callback_;

Powered by Google App Engine
This is Rietveld 408576698