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 6d48b7a955761d0cd807ba272ac4d28b316f6e20..08d6df0e4090eb1c5a27b52d3ecc0471dc455fcf 100644 |
--- a/content/browser/presentation/presentation_service_impl.h |
+++ b/content/browser/presentation/presentation_service_impl.h |
@@ -90,15 +90,13 @@ class CONTENT_EXPORT PresentationServiceImpl |
FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
MaxPendingJoinSessionRequests); |
FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
- ListenForSessionStateChange); |
+ ListenForConnectionStateChange); |
+ |
// Maximum number of pending JoinSession requests at any given time. |
static const int kMaxNumQueuedSessionRequests = 10; |
using PresentationSessionMojoCallback = |
mojo::Callback<void(presentation::PresentationSessionInfoPtr)>; |
- using SessionStateCallback = |
- mojo::Callback<void(presentation::PresentationSessionInfoPtr, |
- presentation::PresentationConnectionState)>; |
using SessionMessagesCallback = |
mojo::Callback<void(mojo::Array<presentation::SessionMessagePtr>)>; |
using SendMessageMojoCallback = mojo::Callback<void(bool)>; |
@@ -169,7 +167,6 @@ class CONTENT_EXPORT PresentationServiceImpl |
void CloseSession( |
const mojo::String& presentation_url, |
const mojo::String& presentation_id) override; |
- void ListenForSessionStateChange() override; |
void ListenForSessionMessages( |
presentation::PresentationSessionInfoPtr session) override; |
@@ -195,7 +192,8 @@ class CONTENT_EXPORT PresentationServiceImpl |
// |request_session_id|. |
// If it exists, invoke it with |session| and |error|, then erase it from |
// |pending_join_session_cbs_|. |
- void RunAndEraseJoinSessionMojoCallback( |
+ // Returns true if the callback was found. |
+ bool RunAndEraseJoinSessionMojoCallback( |
int request_session_id, |
presentation::PresentationSessionInfoPtr session, |
presentation::PresentationErrorPtr error); |
@@ -221,6 +219,11 @@ class CONTENT_EXPORT PresentationServiceImpl |
const PresentationError& error); |
void OnSendMessageCallback(bool sent); |
+ // Calls to |delegate_| to start listening for state changes for |connection|. |
+ // State changes will be returned via |OnConnectionStateChanged|. |
+ void ListenForConnectionStateChange( |
+ const PresentationSessionInfo& connection); |
+ |
// Passed to embedder's implementation of PresentationServiceDelegate for |
// later invocation when session messages arrive. |
void OnSessionMessages( |
@@ -234,9 +237,9 @@ class CONTENT_EXPORT PresentationServiceImpl |
int RegisterJoinSessionCallback(const NewSessionMojoCallback& callback); |
// Invoked by the embedder's PresentationServiceDelegate when a |
- // presentation session's state has changed. |
- void OnSessionStateChanged(const PresentationSessionInfo& session_info, |
- PresentationConnectionState session_state); |
+ // PresentationConnection's state has changed. |
+ void OnConnectionStateChanged(const PresentationSessionInfo& connection, |
+ PresentationConnectionState state); |
// Returns true if this object is associated with |render_frame_host|. |
bool FrameMatches(content::RenderFrameHost* render_frame_host) const; |