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

Unified Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: rebased onto gpu_surface_tracker Created 3 years, 8 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/browser/frame_host/render_frame_host_impl.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index c155890899f092079a805428334ff323ac41d32a..2d36c0fe72300a69b391225c34058d47afdddb7b 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -19,6 +19,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
#include "base/strings/string16.h"
#include "base/supports_user_data.h"
#include "base/time/time.h"
@@ -135,6 +136,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
static RenderFrameHostImpl* FromID(int process_id, int routing_id);
static RenderFrameHostImpl* FromAXTreeID(
ui::AXTreeIDRegistry::AXTreeID ax_tree_id);
+#if defined(OS_ANDROID)
+ static RenderFrameHostImpl* FromOverlayRoutingToken(
+ const base::UnguessableToken& token);
+#endif
~RenderFrameHostImpl() override;
@@ -633,6 +638,14 @@ class CONTENT_EXPORT RenderFrameHostImpl
#if defined(OS_ANDROID)
base::android::ScopedJavaLocalRef<jobject> GetJavaRenderFrameHost();
service_manager::InterfaceProvider* GetJavaInterfaces() override;
+
+ // Returns an unguessable token for this RFHI. This provides a temporary way
+ // to identify a RenderFrameHost that's compatible with IPC. Else, one needs
+ // to send pid + RoutingID, but one cannot send pid. One can get it from the
+ // channel, but this makes it much harder to get wrong.
+ // Once media switches to mojo, we should be able to remove this in favor of
+ // sending a mojo overlay factory.
+ const base::UnguessableToken& GetOverlayRoutingToken();
#endif
protected:
@@ -791,6 +804,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
void OnNavigationHandledByEmbedder();
void ForwardGetInterfaceToRenderFrame(const std::string& interface_name,
mojo::ScopedMessagePipeHandle pipe);
+
+ // Called when the frame would like an overlay routing token. This will
+ // create one if needed. Either way, it will send it to the frame.
+ void OnRequestOverlayRoutingToken();
#endif
void OnShowCreatedWindow(int pending_widget_routing_id,
WindowOpenDisposition disposition,
@@ -1177,6 +1194,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
// RenderFrame. This provides access to interfaces implemented in the renderer
// to Java code in the browser process.
std::unique_ptr<service_manager::InterfaceRegistry> java_interface_registry_;
+
+ // IPC-friendly token that represents this host for AndroidOverlays, if we
+ // have created one yet.
+ base::Optional<base::UnguessableToken> overlay_routing_token_;
#endif
// NOTE: This must be the last member.

Powered by Google App Engine
This is Rietveld 408576698