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

Unified Diff: chrome/browser/android/offline_pages/prerendering_loader.cc

Issue 2473443004: [Offline Pages] Call snapshot controller when OnDomContentLoaded received (Closed)
Patch Set: Added flag to control whether DCL reported. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/prerendering_loader.cc
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.cc b/chrome/browser/android/offline_pages/prerendering_loader.cc
index 3205f6df65fa700dc56039ed02aadb8a81d3a809..c2b85f6e3060a79eb7d225ac13479a40e9ac1a92 100644
--- a/chrome/browser/android/offline_pages/prerendering_loader.cc
+++ b/chrome/browser/android/offline_pages/prerendering_loader.cc
@@ -16,7 +16,12 @@
#include "ui/gfx/geometry/size.h"
namespace {
+// Whether to report DomContentLoaded event to the snapshot controller.
+bool kConsiderDclForSnapshot = false;
+// The delay to wait for snapshotting after DomContentLoaded event if
+// kConsiderDclForSnapshot is true.
long kOfflinePageDclDelayMs = 25000;
+// The delay to wait for snapshotting after OnLoad event.
long kOfflinePageOnloadDelayMs = 2000;
} // namespace
@@ -138,6 +143,11 @@ void PrerenderingLoader::OnPrerenderDomContentLoaded() {
if (!adapter_->GetWebContents()) {
// Without a WebContents object at this point, we are done.
HandleLoadingStopped();
+ } else if (kConsiderDclForSnapshot) {
+ // Inform SnapshotController of DomContentLoaded event so it can
+ // determine when to consider it really LOADED (e.g., some multiple
+ // second delay from this event).
+ snapshot_controller_->DocumentAvailableInMainFrame();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698