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

Unified Diff: content/browser/frame_host/frame_tree_node.h

Issue 925623002: Refactor the loading tracking logic in WebContentsImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years, 10 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: content/browser/frame_host/frame_tree_node.h
diff --git a/content/browser/frame_host/frame_tree_node.h b/content/browser/frame_host/frame_tree_node.h
index 5d0a34bd366fd3875a632891acc18ac624c64080..d6a4bdb879c17c7e1e6d5a79eaf384a0e103ee4b 100644
--- a/content/browser/frame_host/frame_tree_node.h
+++ b/content/browser/frame_host/frame_tree_node.h
@@ -24,6 +24,13 @@ class FrameTree;
class Navigator;
class RenderFrameHostImpl;
+// These values indicate the loading progress status.
+// The minimum progress vlaue matches what Blink's ProgressTracker has
clamy 2015/02/16 14:20:59 nit: s/vlaue/value Also I don't think that a line
Fabrice (no longer in Chrome) 2015/02/20 12:58:58 Done.
+// traditionally used for a minimum progress value.
+const double kNotStartedLoadingProgress = 0.0;
clamy 2015/02/16 14:20:59 So I've found an example of const values in the co
Fabrice (no longer in Chrome) 2015/02/20 12:58:58 Done.
+const double kMinimumLoadingProgress = 0.1;
+const double kDoneLoadingProgress = 1.0;
+
// When a page contains iframes, its renderer process maintains a tree structure
// of those frames. We are mirroring this tree in the browser process. This
// class represents a node in this tree and is a wrapper for all objects that
@@ -108,10 +115,17 @@ class CONTENT_EXPORT FrameTreeNode {
void set_is_loading(bool is_loading) {
is_loading_ = is_loading;
}
+
bool is_loading() const {
return is_loading_;
}
+ void set_loading_progress(double loading_progress) {
+ loading_progress_ = loading_progress;
+ }
+
+ double get_loading_progress() const { return loading_progress_; }
+
RenderFrameHostImpl* current_frame_host() const {
return render_manager_.current_frame_host();
}
@@ -167,6 +181,9 @@ class CONTENT_EXPORT FrameTreeNode {
// RenderFrameHost or using a counter to balance the events out.
bool is_loading_;
+ // Double value representing the frame's completion progress (from 0 to 1).
+ double loading_progress_;
+
DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
};
« no previous file with comments | « no previous file | content/browser/frame_host/frame_tree_node.cc » ('j') | content/browser/web_contents/web_contents_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698