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

Unified Diff: content/renderer/web_frame_utils.cc

Issue 1386873003: OOPIFs: Transitioning MHTML generation from view-oriented to frame-oriented. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-generation-mgr-cleanup
Patch Set: Rebasing... Created 5 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/web_frame_utils.cc
diff --git a/content/renderer/web_frame_utils.cc b/content/renderer/web_frame_utils.cc
index 6cc52aacd379c0ea38646f07c00a3afe95fba76f..ee721478c55805817f9bdc51e69edaeefdfaa339 100644
--- a/content/renderer/web_frame_utils.cc
+++ b/content/renderer/web_frame_utils.cc
@@ -8,6 +8,8 @@
#include "content/renderer/render_frame_proxy.h"
#include "ipc/ipc_message.h"
#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
+#include "third_party/WebKit/public/web/WebRemoteFrame.h"
namespace content {
@@ -19,4 +21,16 @@ int GetRoutingIdForFrameOrProxy(blink::WebFrame* web_frame) {
return RenderFrameImpl::FromWebFrame(web_frame)->GetRoutingID();
}
+blink::WebFrame* GetWebFrameFromRoutingIdForFrameOrProxy(int routing_id) {
+ auto* render_frame = RenderFrameImpl::FromRoutingID(routing_id);
+ if (render_frame)
+ return render_frame->GetWebFrame();
+
+ auto* render_frame_proxy = RenderFrameProxy::FromRoutingID(routing_id);
+ if (render_frame_proxy)
+ return render_frame_proxy->web_frame();
+
+ return nullptr;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698