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

Unified Diff: components/dom_distiller/content/distiller_page_web_contents.cc

Issue 146843010: Add support for multipage distillation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/dom_distiller/content/distiller_page_web_contents.cc
diff --git a/components/dom_distiller/content/distiller_page_web_contents.cc b/components/dom_distiller/content/distiller_page_web_contents.cc
index c0c7ff565225cc228a9ec156c87149037986479f..c55f9da3a69be5ba090b5d135c45c25a44f8e665 100644
--- a/components/dom_distiller/content/distiller_page_web_contents.cc
+++ b/components/dom_distiller/content/distiller_page_web_contents.cc
@@ -62,9 +62,13 @@ void DistillerPageWebContents::DidFinishLoad(int64 frame_id,
const GURL& validated_url,
bool is_main_frame,
RenderViewHost* render_view_host) {
+ if (validated_url != web_contents_->GetURL()) {
Yaron 2014/01/29 20:03:41 Why are these necessary? To ensure the page wasn't
shashi 2014/01/29 22:51:37 Done, I can use is_main_frame.
+ return;
+ }
content::WebContentsObserver::Observe(NULL);
OnLoadURLDone();
}
+
void DistillerPageWebContents::DidFailLoad(
int64 frame_id,
const GURL& validated_url,
@@ -72,6 +76,9 @@ void DistillerPageWebContents::DidFailLoad(
int error_code,
const base::string16& error_description,
RenderViewHost* render_view_host) {
+ if (validated_url != web_contents_->GetURL()) {
+ return;
+ }
content::WebContentsObserver::Observe(NULL);
OnLoadURLFailed();
}

Powered by Google App Engine
This is Rietveld 408576698