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

Unified Diff: content/renderer/render_view_impl.h

Issue 10827078: Support frame tree propagation between renderers in the same browsing instance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes based on feedback from Charlie. Created 8 years, 4 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/render_view_impl.h
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 04490b93e27b795c3d976fd89974f0a4f0e75040..dd7b0340a8bfd52a05935d5d3d3d3aa73fd21453 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -18,6 +18,7 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/timer.h"
+#include "base/values.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "content/common/edit_command.h"
@@ -527,6 +528,8 @@ class RenderViewImpl : public RenderWidget,
WebKit::WebFrame* frame,
WebKit::WebApplicationCacheHostClient* client);
virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame);
+ virtual void didCreateFrame(WebKit::WebFrame* parent,
+ WebKit::WebFrame* child);
virtual void frameDetached(WebKit::WebFrame* frame);
virtual void willClose(WebKit::WebFrame* frame);
virtual void loadURLExternally(WebKit::WebFrame* frame,
@@ -665,7 +668,8 @@ class RenderViewImpl : public RenderWidget,
virtual void willOpenSocketStream(
WebKit::WebSocketStreamHandle* handle);
virtual bool willCheckAndDispatchMessageEvent(
- WebKit::WebFrame* source,
+ WebKit::WebFrame* sourceFrame,
+ WebKit::WebFrame* targetFrame,
WebKit::WebSecurityOrigin targetOrigin,
WebKit::WebDOMMessageEvent event) OVERRIDE;
virtual WebKit::WebString userAgentOverride(
@@ -1027,6 +1031,10 @@ class RenderViewImpl : public RenderWidget,
void OnJavaBridgeInit();
+ void OnUpdatedFrameTree(int process_id,
+ int route_id,
+ const std::string& frame_tree);
+
// Adding a new message handler? Please add it in alphabetical order above
// and put it in the same position in the .cc file.
@@ -1044,6 +1052,23 @@ class RenderViewImpl : public RenderWidget,
WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
const WebKit::WebGraphicsContext3D::Attributes& attributes);
+ // This method walks the entire frame tree for the |frame| specified and
+ // sends an update to the browser process as described in the
+ // ViewHostMsg_FrameTreeUpdated comments. If |exclude| is set to true,
+ // the subtree for the |frame| is not included in the serialized form.
+ // This is used when a frame is going to be removed from the tree.
+ void SendUpdatedFrameTree(WebKit::WebFrame* frame, bool exclude);
+
+ // Recursively creates a DOM frame tree starting with |frame|, based on
+ // |frame_tree|. For each node, the frame is navigated to the swapped out URL,
+ // the name (if present) is set on it, and all the subframes are created
+ // and added to the DOM.
+ void CreateFrameTree(WebKit::WebFrame* frame, DictionaryValue* frame_tree);
+
+ // Walks the frame hierarchy and returns the frame which corresponds to the
+ // |remote_frame_id|.
Charlie Reis 2012/08/24 23:26:07 remote_frame_id is now stale. Also, I'm still no
nasko 2012/08/27 18:53:37 Done.
+ WebKit::WebFrame* GetFrameByMappedID(int frame_id);
+
void EnsureMediaStreamImpl();
// This callback is triggered when DownloadFavicon completes, either
@@ -1087,7 +1112,7 @@ class RenderViewImpl : public RenderWidget,
bool replace);
// Make this RenderView show an empty, unscriptable page.
- void NavigateToSwappedOutURL();
+ void NavigateToSwappedOutURL(WebKit::WebFrame* frame);
// If we initiated a navigation, this function will populate |document_state|
// with the navigation information saved in OnNavigate().
@@ -1438,6 +1463,29 @@ class RenderViewImpl : public RenderWidget,
// before the guest_to_embedder_channel was ready.
WebKit::WebGraphicsContext3D::Attributes guest_attributes_;
+ // Boolean indicating whether we are in the process of creating the frame
+ // tree for this renderer in response to ViewMsg_UpdateFrameTree. If true,
+ // we won't be sending ViewHostMsg_FrameTreeUpdated messages back to the
+ // browser, as those will be redundant.
+ bool updating_frame_tree_;
+
+ // Boolean indicating that the frame tree has changed, but a message has not
+ // been sent to the browser because a resource has been loading. This helps
Charlie Reis 2012/08/24 23:26:07 nit: resource -> page As we discussed, please als
nasko 2012/08/27 18:53:37 Done.
+ // avoid extra messages being sent to the browser when navigating away from a
+ // page with subframes, which will be destroyed. Instead, a single message
+ // is sent when the load is stopped with the final state of the frame tree.
+ bool pending_frame_tree_update_;
+
+ // If this render view is swapped out "mirror" of an active render view in a
Charlie Reis 2012/08/24 23:26:07 nit: is a
nasko 2012/08/27 18:53:37 Done.
+ // different process, we record the process id and route id for the active RV.
+ // For further details, see the comments on ViewHostMsg_FrameTreeUpdated.
+ int target_process_id_;
+ int target_routing_id_;
+
+ // A map of the current process's frame ids to ids in the remote active render
+ // view, if this is a swapped out render view.
+ std::map<int, int> active_frame_id_map_;
+
// NOTE: pepper_delegate_ should be last member because its constructor calls
// AddObservers method of RenderViewImpl from c-tor.
content::PepperPluginDelegateImpl pepper_delegate_;

Powered by Google App Engine
This is Rietveld 408576698