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

Unified Diff: content/renderer/presentation/presentation_dispatcher.h

Issue 2737413003: [Presentation API] Remove references to presentation sessions. (Closed)
Patch Set: Update PresentationServiceDelegateImpl unittest Created 3 years, 9 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/renderer/presentation/presentation_dispatcher.h
diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h
index 9c758209c01e726b397d67f629c1cb320ba00c1d..96fa3f8f6557f8f024f9bc03cc7ab9d045f518c1 100644
--- a/content/renderer/presentation/presentation_dispatcher.h
+++ b/content/renderer/presentation/presentation_dispatcher.h
@@ -20,7 +20,7 @@
#include "base/macros.h"
#include "content/common/content_export.h"
#include "content/public/common/presentation_connection_message.h"
-#include "content/public/common/presentation_session.h"
+#include "content/public/common/presentation_info.h"
#include "content/public/renderer/render_frame_observer.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationClient.h"
@@ -57,17 +57,21 @@ class CONTENT_EXPORT PresentationDispatcher
friend class PresentationConnectionProxy;
friend class TestPresentationDispatcher;
friend class PresentationDispatcherTest;
- FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartSession);
- FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartSessionError);
- FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestJoinSession);
- FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestJoinSessionError);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartPresentation);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
+ TestStartPresentationError);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
+ TestReconnectPresentation);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
+ TestReconnectPresentationError);
FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestSendString);
FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestSendArrayBuffer);
FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestSendBlobData);
FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
TestOnReceiverConnectionAvailable);
- FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestCloseSession);
- FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestTerminateSession);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestCloseConnection);
+ FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
+ TestTerminatePresentation);
FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
TestListenForScreenAvailability);
FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest,
@@ -75,13 +79,13 @@ class CONTENT_EXPORT PresentationDispatcher
struct SendMessageRequest {
SendMessageRequest(
- const PresentationSessionInfo& session_info,
+ const PresentationInfo& presentation_info,
PresentationConnectionMessage connection_message,
const blink::WebPresentationConnectionProxy* connection_proxy);
~SendMessageRequest();
- PresentationSessionInfo session_info;
+ PresentationInfo presentation_info;
PresentationConnectionMessage message;
// Proxy of Blink connection object |connection| calling connection.send().
// It does not take ownership of proxy object. Proxy object is owned by
@@ -105,13 +109,17 @@ class CONTENT_EXPORT PresentationDispatcher
// WebPresentationClient implementation.
void setController(blink::WebPresentationController* controller) override;
void setReceiver(blink::WebPresentationReceiver*) override;
- void startSession(const blink::WebVector<blink::WebURL>& presentationUrls,
- std::unique_ptr<blink::WebPresentationConnectionCallbacks>
- callback) override;
- void joinSession(const blink::WebVector<blink::WebURL>& presentationUrls,
- const blink::WebString& presentationId,
- std::unique_ptr<blink::WebPresentationConnectionCallbacks>
- callback) override;
+ void startPresentation(
+ const blink::WebVector<blink::WebURL>& presentationUrls,
+ std::unique_ptr<blink::WebPresentationConnectionCallbacks> callback)
+ override;
+ void reconnectPresentation(
+ const blink::WebVector<blink::WebURL>& presentationUrls,
+ const blink::WebString& presentationId,
+ std::unique_ptr<blink::WebPresentationConnectionCallbacks> callback)
+ override;
+ void terminatePresentation(const blink::WebURL& presentationUrl,
+ const blink::WebString& presentationId) override;
void sendString(
const blink::WebURL& presentationUrl,
const blink::WebString& presentationId,
@@ -129,12 +137,10 @@ class CONTENT_EXPORT PresentationDispatcher
const uint8_t* data,
size_t length,
const blink::WebPresentationConnectionProxy* connection_proxy) override;
- void closeSession(
+ void closeConnection(
const blink::WebURL& presentationUrl,
const blink::WebString& presentationId,
const blink::WebPresentationConnectionProxy* connection_proxy) override;
- void terminateConnection(const blink::WebURL& presentationUrl,
- const blink::WebString& presentationId) override;
void getAvailability(
const blink::WebVector<blink::WebURL>& availabilityUrls,
std::unique_ptr<blink::WebPresentationAvailabilityCallbacks> callbacks)
@@ -154,29 +160,29 @@ class CONTENT_EXPORT PresentationDispatcher
// blink::mojom::PresentationServiceClient
void OnScreenAvailabilityNotSupported(const GURL& url) override;
void OnScreenAvailabilityUpdated(const GURL& url, bool available) override;
- void OnConnectionStateChanged(const PresentationSessionInfo& session_info,
+ void OnConnectionStateChanged(const PresentationInfo& presentation_info,
PresentationConnectionState state) override;
- void OnConnectionClosed(const PresentationSessionInfo& session_info,
+ void OnConnectionClosed(const PresentationInfo& presentation_info,
PresentationConnectionCloseReason reason,
const std::string& message) override;
void OnConnectionMessagesReceived(
- const PresentationSessionInfo& session_info,
+ const PresentationInfo& presentation_info,
std::vector<PresentationConnectionMessage> messages) override;
- void OnDefaultSessionStarted(
- const PresentationSessionInfo& session_info) override;
+ void OnDefaultPresentationStarted(
+ const PresentationInfo& presentation_info) override;
- void OnSessionCreated(
+ void OnConnectionCreated(
std::unique_ptr<blink::WebPresentationConnectionCallbacks> callback,
- const base::Optional<PresentationSessionInfo>& session_info,
+ const base::Optional<PresentationInfo>& presentation_info,
const base::Optional<PresentationError>& error);
void OnReceiverConnectionAvailable(
- const PresentationSessionInfo& session_info,
+ const PresentationInfo& presentation_info,
blink::mojom::PresentationConnectionPtr /*connection*/,
blink::mojom::PresentationConnectionRequest /*connection_request*/)
override;
// Call to PresentationService to send the message in |request|.
- // |session_info| and |message| of |reuqest| will be consumed.
+ // |presentation_info| and |message| of |reuqest| will be consumed.
// |HandleSendMessageRequests| will be invoked after the send is attempted.
void DoSendMessage(SendMessageRequest* request);
void HandleSendMessageRequests(bool success);
@@ -185,11 +191,11 @@ class CONTENT_EXPORT PresentationDispatcher
// |connection|. Sends mojo interface ptr of |controller_connection_proxy|
// and mojo interface request of |controller_connection_proxy|'s
// |target_connection_| to PresentationService.
- // |session_info|: |connection|'s id and url;
+ // |presentation_info|: |connection|'s id and url;
// |connection|: |controller_connection_proxy|'s |source_connection_|. Raw
// pointer to Blink connection owning proxy object. It does not take object
// ownership.
- void SetControllerConnection(const PresentationSessionInfo& session_info,
+ void SetControllerConnection(const PresentationInfo& presentation_info,
blink::WebPresentationConnection* connection);
virtual void ConnectToPresentationServiceIfNeeded();

Powered by Google App Engine
This is Rietveld 408576698