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

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

Issue 1314413005: [Presentation API] 1-UA presentation support + presenter APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments #18-21 Created 5 years, 2 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 0b8fbd918c79d4dfb3f569eaa4f4e322417210ff..a41d05dc333da054389faa547bd27d3aa455f94b 100644
--- a/content/browser/presentation/presentation_service_impl.h
+++ b/content/browser/presentation/presentation_service_impl.h
@@ -98,7 +98,7 @@ class CONTENT_EXPORT PresentationServiceImpl
// Maximum number of pending JoinSession requests at any given time.
static const int kMaxNumQueuedSessionRequests = 10;
- using DefaultSessionMojoCallback =
+ using PresentationSessionMojoCallback =
mojo::Callback<void(presentation::PresentationSessionInfoPtr)>;
using SessionStateCallback =
mojo::Callback<void(presentation::PresentationSessionInfoPtr,
@@ -145,27 +145,6 @@ class CONTENT_EXPORT PresentationServiceImpl
PresentationServiceImpl* const service_;
};
- class CONTENT_EXPORT DefaultSessionStartContext {
- public:
- DefaultSessionStartContext();
- ~DefaultSessionStartContext();
-
- // Adds a callback. May invoke the callback immediately if |session| using
- // default presentation URL was already started.
- void AddCallback(const DefaultSessionMojoCallback& callback);
-
- // Sets the session info. Maybe invoke callbacks queued with AddCallback().
- void set_session(const PresentationSessionInfo& session);
-
- private:
- // Flush all queued callbacks by invoking them with null
- // PresentationSessionInfoPtr.
- void Reset();
-
- ScopedVector<DefaultSessionMojoCallback> callbacks_;
- scoped_ptr<PresentationSessionInfo> session_;
- };
-
// Ensures the provided NewSessionMojoCallback is invoked exactly once
// before it goes out of scope.
class NewSessionMojoCallbackWrapper {
@@ -197,8 +176,6 @@ class CONTENT_EXPORT PresentationServiceImpl
void SetClient(presentation::PresentationServiceClientPtr client) override;
void ListenForScreenAvailability(const mojo::String& url) override;
void StopListeningForScreenAvailability(const mojo::String& url) override;
- void ListenForDefaultSessionStart(
- const DefaultSessionMojoCallback& callback) override;
void StartSession(
const mojo::String& presentation_url,
const NewSessionMojoCallback& callback) override;
@@ -216,6 +193,8 @@ class CONTENT_EXPORT PresentationServiceImpl
presentation::PresentationSessionInfoPtr session) override;
void ListenForSessionMessages(
presentation::PresentationSessionInfoPtr session) override;
+ void GetPresentationReceiverSession(
+ const PresentationSessionMojoCallback& callback) override;
// Creates a binding between this object and |request|.
void Bind(mojo::InterfaceRequest<presentation::PresentationService> request);
@@ -261,6 +240,8 @@ class CONTENT_EXPORT PresentationServiceImpl
int request_session_id,
const PresentationError& error);
void OnSendMessageCallback(bool sent);
+ void OnGetPresentationReceiverSession(
+ const content::PresentationSessionInfo* session_info);
// Passed to embedder's implementation of PresentationServiceDelegate for
// later invocation when session messages arrive.
@@ -306,8 +287,6 @@ class CONTENT_EXPORT PresentationServiceImpl
base::hash_map<int, linked_ptr<NewSessionMojoCallbackWrapper>>
pending_join_session_cbs_;
- scoped_ptr<DefaultSessionStartContext> default_session_start_context_;
-
// RAII binding of |this| to an Presentation interface request.
// The binding is removed when binding_ is cleared or goes out of scope.
scoped_ptr<mojo::Binding<presentation::PresentationService>> binding_;
@@ -317,6 +296,8 @@ class CONTENT_EXPORT PresentationServiceImpl
scoped_ptr<SessionMessagesCallback> on_session_messages_callback_;
+ PresentationSessionMojoCallback receiver_session_callback_;
+
// ID of the RenderFrameHost this object is associated with.
int render_process_id_;
int render_frame_id_;

Powered by Google App Engine
This is Rietveld 408576698