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

Unified Diff: extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h

Issue 811263002: Queue postMessage messages destined for a MimeHandlerView guest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@postMessage1
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h
diff --git a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h
index 8b9fe269d6c66cb2ecbc583ca627f4c1bf61b9e2..2fca1fbdec9d66366493973594dba9e122814df4 100644
--- a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h
+++ b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h
@@ -5,6 +5,7 @@
#ifndef EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_CONTAINER_H_
#define EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_CONTAINER_H_
+#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
#include "extensions/renderer/guest_view/guest_view_container.h"
#include "extensions/renderer/scoped_persistent.h"
@@ -64,6 +65,7 @@ class MimeHandlerViewContainer : public GuestViewContainer,
void OnCreateMimeHandlerViewGuestACK(int element_instance_id);
void OnGuestAttached(int element_instance_id,
int guest_proxy_routing_id);
+ void OnMimeHandlerViewGuestOnLoadCompleted(int element_instance_id);
void CreateMimeHandlerViewGuest();
@@ -89,6 +91,15 @@ class MimeHandlerViewContainer : public GuestViewContainer,
// The scriptable object that backs the plugin.
ScopedPersistent<v8::Object> scriptable_object_;
+ // Pending postMessage messages that need to be sent to the guest. These are
+ // queued while the guest is loading and once it is fully loaded they are
+ // delivered so that messages aren't lost.
+ std::vector<linked_ptr<ScopedPersistent<v8::Value>>> pending_messages_;
+
+ // True if the guest page has fully loaded and its JavaScript onload function
+ // has been called.
+ bool guest_loaded_;
+
base::WeakPtrFactory<MimeHandlerViewContainer> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewContainer);

Powered by Google App Engine
This is Rietveld 408576698