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

Side by Side Diff: content/renderer/presentation/presentation_dispatcher.h

Issue 2471263003: [Presentation API] (4th)(1-UA blink side) Add WebPresentationConnection and WebPresentationConnecti… (Closed)
Patch Set: PresentationConnectionProxy::Send() will be invoked from PresentationDispatcher Created 4 years 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
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_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void setController(blink::WebPresentationController* controller) override; 68 void setController(blink::WebPresentationController* controller) override;
69 void setReceiver(blink::WebPresentationReceiver*) override; 69 void setReceiver(blink::WebPresentationReceiver*) override;
70 70
71 void startSession( 71 void startSession(
72 const blink::WebVector<blink::WebURL>& presentationUrls, 72 const blink::WebVector<blink::WebURL>& presentationUrls,
73 blink::WebPresentationConnectionClientCallbacks* callback) override; 73 blink::WebPresentationConnectionClientCallbacks* callback) override;
74 void joinSession( 74 void joinSession(
75 const blink::WebVector<blink::WebURL>& presentationUrls, 75 const blink::WebVector<blink::WebURL>& presentationUrls,
76 const blink::WebString& presentationId, 76 const blink::WebString& presentationId,
77 blink::WebPresentationConnectionClientCallbacks* callback) override; 77 blink::WebPresentationConnectionClientCallbacks* callback) override;
78 void sendString(const blink::WebURL& presentationUrl, 78 void sendString(
79 const blink::WebString& presentationId, 79 const blink::WebURL& presentationUrl,
80 const blink::WebString& message) override; 80 const blink::WebString& presentationId,
81 void sendArrayBuffer(const blink::WebURL& presentationUrl, 81 const blink::WebString& message,
82 const blink::WebString& presentationId, 82 const blink::WebPresentationConnectionProxy* connection_proxy) override;
83 const uint8_t* data, 83 void sendArrayBuffer(
84 size_t length) override; 84 const blink::WebURL& presentationUrl,
85 void sendBlobData(const blink::WebURL& presentationUrl, 85 const blink::WebString& presentationId,
86 const blink::WebString& presentationId, 86 const uint8_t* data,
87 const uint8_t* data, 87 size_t length,
88 size_t length) override; 88 const blink::WebPresentationConnectionProxy* connection_proxy) override;
89 void sendBlobData(
90 const blink::WebURL& presentationUrl,
91 const blink::WebString& presentationId,
92 const uint8_t* data,
93 size_t length,
94 const blink::WebPresentationConnectionProxy* connection_proxy) override;
89 void closeSession(const blink::WebURL& presentationUrl, 95 void closeSession(const blink::WebURL& presentationUrl,
90 const blink::WebString& presentationId) override; 96 const blink::WebString& presentationId) override;
91 void terminateSession(const blink::WebURL& presentationUrl, 97 void terminateSession(const blink::WebURL& presentationUrl,
92 const blink::WebString& presentationId) override; 98 const blink::WebString& presentationId) override;
93 void getAvailability( 99 void getAvailability(
94 const blink::WebURL& availabilityUrl, 100 const blink::WebURL& availabilityUrl,
95 blink::WebPresentationAvailabilityCallbacks* callbacks) override; 101 blink::WebPresentationAvailabilityCallbacks* callbacks) override;
96 void startListening(blink::WebPresentationAvailabilityObserver*) override; 102 void startListening(blink::WebPresentationAvailabilityObserver*) override;
97 void stopListening(blink::WebPresentationAvailabilityObserver*) override; 103 void stopListening(blink::WebPresentationAvailabilityObserver*) override;
98 void setDefaultPresentationUrls( 104 void setDefaultPresentationUrls(
(...skipping 24 matching lines...) Expand all
123 void OnSessionCreated( 129 void OnSessionCreated(
124 blink::WebPresentationConnectionClientCallbacks* callback, 130 blink::WebPresentationConnectionClientCallbacks* callback,
125 blink::mojom::PresentationSessionInfoPtr session_info, 131 blink::mojom::PresentationSessionInfoPtr session_info,
126 blink::mojom::PresentationErrorPtr error); 132 blink::mojom::PresentationErrorPtr error);
127 void OnReceiverConnectionAvailable( 133 void OnReceiverConnectionAvailable(
128 blink::mojom::PresentationSessionInfoPtr) override; 134 blink::mojom::PresentationSessionInfoPtr) override;
129 135
130 // Call to PresentationService to send the message in |request|. 136 // Call to PresentationService to send the message in |request|.
131 // |session_info| and |message| of |reuqest| will be consumed. 137 // |session_info| and |message| of |reuqest| will be consumed.
132 // |HandleSendMessageRequests| will be invoked after the send is attempted. 138 // |HandleSendMessageRequests| will be invoked after the send is attempted.
133 void DoSendMessage(SendMessageRequest* request); 139 void DoSendMessage(
134 void HandleSendMessageRequests(bool success); 140 SendMessageRequest* request,
141 const blink::WebPresentationConnectionProxy* connection_proxy);
142 void HandleSendMessageRequests(
143 const blink::WebPresentationConnectionProxy* connection_proxy,
144 bool success);
135 145
136 void ConnectToPresentationServiceIfNeeded(); 146 void ConnectToPresentationServiceIfNeeded();
137 147
138 void UpdateListeningState(); 148 void UpdateListeningState();
139 149
140 // Used as a weak reference. Can be null since lifetime is bound to the frame. 150 // Used as a weak reference. Can be null since lifetime is bound to the frame.
141 blink::WebPresentationController* controller_; 151 blink::WebPresentationController* controller_;
142 blink::WebPresentationReceiver* receiver_; 152 blink::WebPresentationReceiver* receiver_;
143 blink::mojom::PresentationServicePtr presentation_service_; 153 blink::mojom::PresentationServicePtr presentation_service_;
144 mojo::Binding<blink::mojom::PresentationServiceClient> binding_; 154 mojo::Binding<blink::mojom::PresentationServiceClient> binding_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Updates the listening state of availability for |status| and notifies the 188 // Updates the listening state of availability for |status| and notifies the
179 // client. 189 // client.
180 void UpdateListeningState(AvailabilityStatus* status); 190 void UpdateListeningState(AvailabilityStatus* status);
181 191
182 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); 192 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher);
183 }; 193 };
184 194
185 } // namespace content 195 } // namespace content
186 196
187 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ 197 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698