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

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: adding comments 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..0584634c45ee9ad4ac8c1a896c0b18012148b7f8 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -592,7 +592,9 @@ 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, DetachType type);
private:
void CallOnReady();
@@ -743,6 +745,12 @@ blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
}
void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame) {
+ frameDetached(frame, DetachType::Remove);
+}
+
+void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame,
+ DetachType type) {
+ DCHECK(type == DetachType::Remove);
if (frame->parent())
frame->parent()->removeChild(frame);
frame->close();

Powered by Google App Engine
This is Rietveld 408576698