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

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

Issue 1037483003: [PresentationAPI] Implementing send() from WebPresentationClient to the PresentationService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No (c) in new files Copyright message. 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
Index: content/renderer/presentation/presentation_dispatcher.h
diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h
index c88786357c747663c30d61b430e55fa311084f94..ffd7e58bcfca1decbc629f3e3238262d30f28608 100644
--- a/content/renderer/presentation/presentation_dispatcher.h
+++ b/content/renderer/presentation/presentation_dispatcher.h
@@ -6,6 +6,7 @@
#define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
#include "base/compiler_specific.h"
+#include "base/memory/linked_ptr.h"
#include "content/common/content_export.h"
#include "content/common/presentation/presentation_service.mojom.h"
#include "content/public/renderer/render_frame_observer.h"
@@ -39,12 +40,24 @@ class CONTENT_EXPORT PresentationDispatcher
const blink::WebString& presentationUrl,
const blink::WebString& presentationId,
blink::WebPresentationSessionClientCallbacks* callback);
+ virtual void sendString(
+ const blink::WebString& presentationUrl,
+ const blink::WebString& presentationId,
+ const blink::WebString& message);
+ virtual void sendArrayBuffer(
+ const blink::WebString& presentationUrl,
+ const blink::WebString& presentationId,
+ const uint8* data,
+ size_t length);
virtual void closeSession(
const blink::WebString& presentationUrl,
const blink::WebString& presentationId);
- // RenderFrameObserver
+ // RenderFrameObserver implementation.
void DidChangeDefaultPresentation() override;
+ void DidCommitProvisionalLoad(
+ bool is_new_navigation,
+ bool is_same_page_navigation) override;
void OnScreenAvailabilityChanged(
const std::string& presentation_url,
@@ -67,9 +80,18 @@ class CONTENT_EXPORT PresentationDispatcher
const std::string& presentation_url,
bool watched);
+ void DoSendMessage(const presentation::SessionMessage& session_message);
+ void HandleSendMessageRequests(bool success);
+
// Used as a weak reference. Can be null since lifetime is bound to the frame.
blink::WebPresentationController* controller_;
presentation::PresentationServicePtr presentation_service_;
+
+ // Message requests are queued here and only one message at a time is sent
+ // over mojo channel.
+ using MessageRequestQueue =
+ std::queue<linked_ptr<presentation::SessionMessage>>;
+ MessageRequestQueue message_request_queue_;
};
} // namespace content
« no previous file with comments | « content/public/common/presentation_constants.cc ('k') | content/renderer/presentation/presentation_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698