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

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

Issue 1430413003: [Media Router] Connection state change listening redesign part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years, 1 month 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 54e1a4c14975d0589cf37ae56169a4c07ce7ead5..51bc34de4006593692deda58365fb00f922c4f6f 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;

Powered by Google App Engine
This is Rietveld 408576698