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

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

Issue 1118103002: Implements ListenForSessionMessages in PresentationServiceImpl; uses Swap to avoid copying large da… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | 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 fd85fe8f3444207f03aca3fe1093b846633894df..388543a7d465ce637b4abf6bb8d91eed965ed5d4 100644
--- a/content/browser/presentation/presentation_service_impl.h
+++ b/content/browser/presentation/presentation_service_impl.h
@@ -28,6 +28,7 @@ namespace content {
struct FrameNavigateParams;
struct LoadCommittedDetails;
+struct PresentationSessionMessage;
class RenderFrameHost;
// Implementation of Mojo PresentationService.
@@ -175,6 +176,8 @@ class CONTENT_EXPORT PresentationServiceImpl
ListenForDefaultSessionStartAfterSet);
FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
DefaultSessionStartReset);
+ FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
+ ReceiveSessionMessagesAfterReset);
// |render_frame_host|: The RFH this instance is associated with.
// |web_contents|: The WebContents to observe.
@@ -267,6 +270,13 @@ class CONTENT_EXPORT PresentationServiceImpl
const std::string& presentation_id,
const NewSessionMojoCallback& callback);
+ // Passed to embedder's implementation of PresentationServiceDelegate for
+ // later invocation when session messages arrive.
+ // For optimization purposes, this method will empty the messages
+ // passed to it.
+ void OnSessionMessages(
+ scoped_ptr<ScopedVector<PresentationSessionMessage>> messages);
+
// Removes the head of the queue (which represents the request that has just
// been processed).
// Checks if there are any queued StartSession requests and if so, executes
@@ -318,6 +328,8 @@ class CONTENT_EXPORT PresentationServiceImpl
// The binding is removed when binding_ is cleared or goes out of scope.
scoped_ptr<mojo::Binding<presentation::PresentationService>> binding_;
+ scoped_ptr<SessionMessagesCallback> on_session_messages_callback_;
+
// ID of the RenderFrameHost this object is associated with.
int render_process_id_;
int render_frame_id_;
« no previous file with comments | « no previous file | content/browser/presentation/presentation_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698