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

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: Moved away from hardcoded strings and no static cast needed for tests. 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..5717b45e5a573cc2388092e18ce4acac38ee6b00 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,15 @@ class RenderViewImpl : public RenderWidget,
WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
const WebKit::WebGraphicsContext3D::Attributes& attributes);
+ // This method walks the entire frame tree for the |frame| specified and
+ // returns a JSON serialized version of the tree including the name and id
+ // of each frame.
awong 2012/08/21 19:27:28 This comment seems out of date. There's no return
nasko 2012/08/21 22:24:13 Done.
+ void SendUpdatedFrameTree(WebKit::WebFrame* frame, bool exclude);
+
+ // Walks the frame hierarchy and returns the frame which corresponds to the
+ // |remote_frame_id|.
+ WebKit::WebFrame* GetFrameByRemoteID(int remote_frame_id);
+
void EnsureMediaStreamImpl();
// This callback is triggered when DownloadFavicon completes, either
@@ -1087,7 +1104,8 @@ class RenderViewImpl : public RenderWidget,
bool replace);
// Make this RenderView show an empty, unscriptable page.
- void NavigateToSwappedOutURL();
+ void NavigateToSwappedOutURL(WebKit::WebFrame* frame,
+ DictionaryValue* frame_tree);
// If we initiated a navigation, this function will populate |document_state|
// with the navigation information saved in OnNavigate().
@@ -1438,6 +1456,24 @@ 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 updating the frame
+ // tree for this renderer. If true, we won't be sending frame tree updates
+ // back to the browser.
+ bool updating_frame_tree_;
+
+ // Boolean indicating that the frame tree has changed, but message has not
+ // been sent to the browser due to loading a resource.
awong 2012/08/21 19:27:28 due to loading a resource -> because a resource is
nasko 2012/08/21 22:24:13 Done.
+ bool pending_frame_tree_update_;
+
+ // If this render view is swapped out mirror of an active render view in a
awong 2012/08/21 19:27:28 is swapped -> is a swapped Can we add a bit expla
nasko 2012/08/21 22:24:13 Done.
+ // different process, we record the process id and route id for the active RV.
+ int target_process_id_;
+ int target_routing_id_;
+
+ // A mapping of current process frame ids to ids in the remote active render
+ // view, if this is a swapped out mirror render view.
+ std::map<int, int> frames_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