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

Unified Diff: content/renderer/dom_proxy_installer.cc

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: New patch, still not quite done Created 9 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/renderer/dom_proxy_installer.cc
diff --git a/content/renderer/dom_proxy_installer.cc b/content/renderer/dom_proxy_installer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..99dee27113da86b70f129cd75b60de0a6847a601
--- /dev/null
+++ b/content/renderer/dom_proxy_installer.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2011 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.
+
+#include "content/renderer/dom_proxy_installer.h"
+#include "content/renderer/dom_proxy_listener.h"
+#include "content/renderer/render_view_impl.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
+
+namespace content {
+
+DOMProxyInstaller::DOMProxyInstaller(RenderView* render_view,
+ int64 browsing_instance_frame_id)
+ : RenderViewObserver(render_view),
+ dom_proxy_listener_(0),
+ browsing_instance_frame_id_(browsing_instance_frame_id) {
+}
+
+DOMProxyInstaller::~DOMProxyInstaller() {
+ if (dom_proxy_listener_) {
+ delete dom_proxy_listener_;
+ }
+}
+
+void DOMProxyInstaller::DidFinishDocumentLoad(WebKit::WebFrame* frame)
+{
+ DCHECK(!dom_proxy_listener_);
+ DCHECK_EQ(frame, static_cast<RenderViewImpl*>(render_view())->webview()->mainFrame());
+
+ dom_proxy_listener_ = new DOMProxyListener(frame,
+ browsing_instance_frame_id_);
+}
+
+void DOMProxyInstaller::Navigate(const GURL& url) {
+ // If we navigate this frame, it's no longer a proxy
+ ClosePage();
+}
+
+void DOMProxyInstaller::ClosePage() {
+ delete this;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698