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

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

Issue 1037483003: [PresentationAPI] Implementing send() from WebPresentationClient to the PresentationService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extended SendStringMessage() to delegate, Added unit test & other fixes. Created 5 years, 8 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 5b4972d62db9046766f396224397e1662c7c8308..acc21df2b155236c40cccc3923f46bc476652e42 100644
--- a/content/browser/presentation/presentation_service_impl.h
+++ b/content/browser/presentation/presentation_service_impl.h
@@ -64,6 +64,7 @@ class CONTENT_EXPORT PresentationServiceImpl
using SessionStateCallback =
mojo::Callback<void(presentation::PresentationSessionInfoPtr,
presentation::PresentationSessionState)>;
+ using SendMessageMojoCallback = mojo::Callback<void()>;
// A helper data class used by PresentationServiceImpl to do bookkeeping
// of currently registered screen availability listeners.
@@ -166,6 +167,11 @@ class CONTENT_EXPORT PresentationServiceImpl
const mojo::String& presentation_url,
const mojo::String& presentation_id,
const NewSessionMojoCallback& callback) override;
+ void SendStringMessage(
+ const mojo::String& presentation_url,
+ const mojo::String& presentation_id,
+ const mojo::String& message,
+ const SendMessageMojoCallback& callback) override;
void CloseSession(
const mojo::String& presentation_url,
const mojo::String& presentation_id) override;
@@ -207,7 +213,7 @@ class CONTENT_EXPORT PresentationServiceImpl
// and informs the PresentationServiceDelegate of such.
void Reset();
- // These two functions are bound as base::Callbacks and passed to
+ // These functions are bound as base::Callbacks and passed to
// embedder's implementation of PresentationServiceDelegate for later
// invocation.
void OnStartOrJoinSessionSucceeded(
@@ -218,6 +224,7 @@ class CONTENT_EXPORT PresentationServiceImpl
bool is_start_session,
int request_session_id,
const PresentationError& error);
+ void OnSendMessageCallback();
// Requests delegate to start a session.
void DoStartSession(
@@ -269,6 +276,9 @@ class CONTENT_EXPORT PresentationServiceImpl
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<PresentationServiceImpl> weak_factory_;
+ // There could be be one send message request at a time.
+ scoped_ptr<SendMessageMojoCallback> send_message_cb_ptr_;
+
DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl);
};

Powered by Google App Engine
This is Rietveld 408576698