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

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

Issue 100473010: Adding RenderWidgetHostViewChildFrame for OOPIF view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed broken unit test Created 7 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: content/browser/frame_host/cross_process_frame_connector.h
diff --git a/content/browser/frame_host/cross_process_frame_connector.h b/content/browser/frame_host/cross_process_frame_connector.h
new file mode 100644
index 0000000000000000000000000000000000000000..5c8764490f2c966d47b4bbe5dc7c98e0da33ada5
--- /dev/null
+++ b/content/browser/frame_host/cross_process_frame_connector.h
@@ -0,0 +1,81 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_
+#define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_
+
+#include "cc/output/compositor_frame.h"
+#include "ui/gfx/rect.h"
+
+namespace IPC {
+class Message;
+}
+
+struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params;
+
+namespace content {
+class RenderFrameHostImpl;
+class RenderWidgetHostImpl;
+class RenderWidgetHostViewChildFrame;
+
+// -----------------------------------------------------------------------------
+// CrossProcessFrameConnector mediates between a parent frame and an embedded
Charlie Reis 2013/12/12 02:42:05 Thanks-- I like the name much more than CrossProce
kenrb 2013/12/13 18:41:17 Done.
+// child frame that is rendered in a separate process. It contains browser
+// process state for the child frame and has logic for message passing between
Charlie Reis 2013/12/12 02:42:05 nit: passing messages
+// them. It is owned by the child frame's RenderFrameHostManager.
+// -----------------------------------------------------------------------------
+class CrossProcessFrameConnector {
+ public:
+ virtual ~CrossProcessFrameConnector();
+
+ static CrossProcessFrameConnector* CreateCrossProcessFrameConnector(
+ RenderFrameHostImpl* frame_proxy_to_parent_renderer);
Charlie Reis 2013/12/12 02:42:05 Please document what this parameter is supposed to
kenrb 2013/12/13 18:41:17 Would this be redundant with the comment on the me
Charlie Reis 2013/12/16 19:31:08 That comment says it's initially NULL, which doesn
+
+ void Destroy();
+
+ bool OnMessageReceived(const IPC::Message &msg);
+
+ void SetView(RenderWidgetHostViewChildFrame* view);
+
+ // 'Platform' functionality exposed to RenderWidgetHostViewChildFrame.
+ // These methods can forward messages to the child frame proxy in the parent
+ // frame renderer or attempt to handle them within the browser process.
+ void ChildFrameBuffersSwapped(
+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
+ int gpu_host_id);
+
+ void ChildFrameCompositorFrameSwapped(
+ uint32 output_surface_id,
+ scoped_ptr<cc::CompositorFrame> frame);
+
+ gfx::Rect ChildFrameRect();
+
+ private:
+ CrossProcessFrameConnector(
+ RenderFrameHostImpl* frame_proxy_to_parent_renderer);
+
+ // Handlers for messages received from the parent frame.
+ void OnBuffersSwappedACK(std::string mailbox_name,
+ int route_id,
+ int gpu_host_id,
+ uint32 sync_point);
+
+ // frame_proxy_to_parent_renderer_ the RenderFrameHostProxy that routes
Charlie Reis 2013/12/12 02:42:05 nit: is the Actually, just start with "The" and s
kenrb 2013/12/13 18:41:17 Done.
+ // messages to the parent frame's renderer process. Initially NULL.
+ // TODO(kenrb): The type becomes RenderFrameProxyHost when that class comes
+ // to exist.
+ RenderFrameHostImpl* frame_proxy_to_parent_renderer_;
+
+ // child_frame_widget_ is the RenderWidgetHost for the child_frame. There is
+ // at most one RenderWidgetHost per frame because RenderFrameProxyHosts do
+ // not do not require widgets.
+ RenderWidgetHostImpl* child_frame_widget_;
Charlie Reis 2013/12/12 02:42:05 Why isn't this on RenderFrameHostImpl instead? I
kenrb 2013/12/13 18:41:17 RenderWidgetHostImpl will be owned by RenderFrameH
Charlie Reis 2013/12/16 19:31:08 What do you mean by cached? Will it ever be stale
+
+ gfx::Rect child_frame_rect_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_
+

Powered by Google App Engine
This is Rietveld 408576698