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

Unified Diff: components/printing/renderer/print_web_view_helper.cc

Issue 1149793002: Detach old frame on WebFrame::swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: print Created 5 years, 7 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: components/printing/renderer/print_web_view_helper.cc
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index ab65ed6f255d98276b33fc6e70e8d784fe36efcd..3c718b6da821882df5b556d803990cbef9ad2f08 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -592,7 +592,10 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
blink::WebTreeScopeType scope,
const blink::WebString& name,
blink::WebSandboxFlags sandboxFlags);
+ // TODO(lfg): Remove this method once the blink patch lands.
virtual void frameDetached(blink::WebFrame* frame);
+ virtual void frameDetached(blink::WebFrame* frame,
+ blink::WebDetachReason reason);
private:
void CallOnReady();
@@ -743,6 +746,12 @@ blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
}
void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame) {
+ frameDetached(frame, blink::WebDetachReason::Remove);
+}
+
+void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame,
+ blink::WebDetachReason reason) {
+ DCHECK(reason == blink::WebDetachReason::Remove);
if (frame->parent())
frame->parent()->removeChild(frame);
frame->close();

Powered by Google App Engine
This is Rietveld 408576698