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

Side by Side Diff: content/public/browser/presentation_service_delegate.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 unified diff | Download patch
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/presentation_session_message.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
7 7
8 #include <vector>
9
8 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/scoped_vector.h"
9 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
10 #include "content/public/browser/presentation_session.h" 14 #include "content/public/browser/presentation_session.h"
15 #include "content/public/browser/presentation_session_message.h"
11 16
12 namespace content { 17 namespace content {
13 18
14 class PresentationScreenAvailabilityListener; 19 class PresentationScreenAvailabilityListener;
15 20
16 // An interface implemented by embedders to handle presentation API calls 21 // An interface implemented by embedders to handle presentation API calls
17 // forwarded from PresentationServiceImpl. 22 // forwarded from PresentationServiceImpl.
18 class CONTENT_EXPORT PresentationServiceDelegate { 23 class CONTENT_EXPORT PresentationServiceDelegate {
19 public: 24 public:
20 // Observer interface to listen for changes to PresentationServiceDelegate. 25 // Observer interface to listen for changes to PresentationServiceDelegate.
(...skipping 10 matching lines...) Expand all
31 const PresentationSessionInfo& session) = 0; 36 const PresentationSessionInfo& session) = 0;
32 37
33 protected: 38 protected:
34 virtual ~Observer() {} 39 virtual ~Observer() {}
35 }; 40 };
36 41
37 using PresentationSessionSuccessCallback = 42 using PresentationSessionSuccessCallback =
38 base::Callback<void(const PresentationSessionInfo&)>; 43 base::Callback<void(const PresentationSessionInfo&)>;
39 using PresentationSessionErrorCallback = 44 using PresentationSessionErrorCallback =
40 base::Callback<void(const PresentationError&)>; 45 base::Callback<void(const PresentationError&)>;
46 using PresentationSessionMessageCallback = base::Callback<void(
47 scoped_ptr<ScopedVector<PresentationSessionMessage>>)>;
41 48
42 virtual ~PresentationServiceDelegate() {} 49 virtual ~PresentationServiceDelegate() {}
43 50
44 // Registers an observer associated with frame with |render_process_id| 51 // Registers an observer associated with frame with |render_process_id|
45 // and |render_frame_id| with this class to listen for updates. 52 // and |render_frame_id| with this class to listen for updates.
46 // This class does not own the observer. 53 // This class does not own the observer.
47 // It is an error to add an observer if there is already an observer for that 54 // It is an error to add an observer if there is already an observer for that
48 // frame. 55 // frame.
49 virtual void AddObserver(int render_process_id, 56 virtual void AddObserver(int render_process_id,
50 int render_frame_id, 57 int render_frame_id,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // |success_cb|: Invoked with session info, if presentation session joined 129 // |success_cb|: Invoked with session info, if presentation session joined
123 // successfully. 130 // successfully.
124 // |error_cb|: Invoked with error reason, if joining failed. 131 // |error_cb|: Invoked with error reason, if joining failed.
125 virtual void JoinSession( 132 virtual void JoinSession(
126 int render_process_id, 133 int render_process_id,
127 int render_frame_id, 134 int render_frame_id,
128 const std::string& presentation_url, 135 const std::string& presentation_url,
129 const std::string& presentation_id, 136 const std::string& presentation_id,
130 const PresentationSessionSuccessCallback& success_cb, 137 const PresentationSessionSuccessCallback& success_cb,
131 const PresentationSessionErrorCallback& error_cb) = 0; 138 const PresentationSessionErrorCallback& error_cb) = 0;
139
140 // Gets the next batch of messages from all presentation sessions in the frame
141 // |render_process_id|, |render_frame_id|: ID for originating frame.
142 // |message_cb|: Invoked with a non-empty list of messages.
143 virtual void ListenForSessionMessages(
144 int render_process_id,
145 int render_frame_id,
146 const PresentationSessionMessageCallback& message_cb) = 0;
132 }; 147 };
133 148
134 } // namespace content 149 } // namespace content
135 150
136 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ 151 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/presentation_session_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698