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

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

Issue 1406013003: [Presentation API / Media Router] Clean up default pres URL logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Original patch 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
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | content/browser/presentation/presentation_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 220c256a5dc7ff31bd51271ffa98fad6ae679c34..54e1a4c14975d0589cf37ae56169a4c07ce7ead5 100644
--- a/content/browser/presentation/presentation_service_impl.h
+++ b/content/browser/presentation/presentation_service_impl.h
@@ -94,7 +94,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,
@@ -125,27 +125,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 {
@@ -177,8 +156,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;
@@ -208,8 +185,11 @@ class CONTENT_EXPORT PresentationServiceImpl
// PresentationServiceDelegate::Observer
void OnDelegateDestroyed() override;
- void OnDefaultPresentationStarted(const PresentationSessionInfo& session)
- override;
+
+ // Passed to embedder's implementation of PresentationServiceDelegate for
+ // later invocation when default presentation has started.
+ void OnDefaultPresentationStarted(
+ const PresentationSessionInfo& session_info);
// Finds the callback from |pending_join_session_cbs_| using
// |request_session_id|.
@@ -284,8 +264,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_;
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | content/browser/presentation/presentation_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698