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

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

Issue 2683493002: Get signals working in the EXTRA_DATA section of MHTML (Closed)
Patch Set: CR feedback per Dimich Created 3 years, 9 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: chrome/browser/android/offline_pages/prerendering_loader.h
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.h b/chrome/browser/android/offline_pages/prerendering_loader.h
index 7e45fef375163996eddbae437e53c3363f45719d..fac3c415000023f63f2ac369bd53d534d787ddce 100644
--- a/chrome/browser/android/offline_pages/prerendering_loader.h
+++ b/chrome/browser/android/offline_pages/prerendering_loader.h
@@ -6,6 +6,8 @@
#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
#include <memory>
+#include <string>
+#include <vector>
#include "base/callback.h"
#include "chrome/browser/android/offline_pages/prerender_adapter.h"
@@ -82,6 +84,11 @@ class PrerenderingLoader : public PrerenderAdapter::Observer,
// Returns true if the lowbar of snapshotting a page is met.
virtual bool IsLowbarMet();
+ // Returns a vector of strings for analysis of loading progress.
+ const std::vector<std::string>& GetLoadingSignalData() {
+ return signal_data_;
+ }
+
private:
// State of the loader (only one request may be active at a time).
enum class State {
@@ -104,6 +111,12 @@ class PrerenderingLoader : public PrerenderAdapter::Observer,
// Cancels any current prerender and moves loader to idle state.
void CancelPrerender();
+ // Mark the time when we started snapshotting.
+ void SetSnapshotStartTime();
Dmitry Titov 2017/03/29 23:26:29 Does it sets a time of snapshot start? It should b
Pete Williamson 2017/03/31 00:29:48 Done.
+
+ // Add a signal to the signal data.
+ void AddLoadingSignal(const char* signal_name);
+
// Tracks loading state including whether the Loader is idle.
State state_;
@@ -120,6 +133,9 @@ class PrerenderingLoader : public PrerenderAdapter::Observer,
// storage namespace for rendering. This will NOT have the loaded page.
std::unique_ptr<content::WebContents> session_contents_;
+ // Signal data collected for this rendering attempt
+ std::vector<std::string> signal_data_;
+
// Callback to call when the active load request completes, fails, or is
// canceled.
LoadPageCallback load_done_callback_;
@@ -130,6 +146,9 @@ class PrerenderingLoader : public PrerenderAdapter::Observer,
// True if the lowbar of snapshotting a page is met.
bool is_lowbar_met_;
+ // Time in ticks of snapshot start.
+ base::TimeTicks snapshot_start_time_;
+
DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader);
};

Powered by Google App Engine
This is Rietveld 408576698