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

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

Issue 1015243004: Move load progress tracking logic to the frame tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Readding TODO Created 5 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
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 458887baaf6403ba538c8775fadf7fbf695e1ba6..30843d8f2723c8663f30370e980322f67fa3724d 100644
--- a/content/browser/frame_host/frame_tree_node.h
+++ b/content/browser/frame_host/frame_tree_node.h
@@ -30,6 +30,15 @@ class RenderFrameHostImpl;
// are frame-specific (as opposed to page-specific).
class CONTENT_EXPORT FrameTreeNode {
public:
+ // These values indicate the loading progress status. The minimum progress
+ // value matches what Blink's ProgressTracker has traditionally used for a
+ // minimum progress value.
+ // TODO(fdegans): Move these values to the implementation when the relevant
+ // IPCs are moved from WebContentsImpl to RenderFrameHost.
+ static const double kLoadingProgressNotStarted;
+ static const double kLoadingProgressMinimum;
+ static const double kLoadingProgressDone;
+
// Returns the FrameTreeNode with the given global |frame_tree_node_id|,
// regardless of which FrameTree it is in.
static FrameTreeNode* GloballyFindByID(int64 frame_tree_node_id);
@@ -122,11 +131,16 @@ class CONTENT_EXPORT FrameTreeNode {
bool IsDescendantOf(FrameTreeNode* other) const;
- // Returns true if this frame is in a loading state.
+ // Returns true if this node is in a loading state.
bool IsLoading() const;
- // Returns the loading progress of this frame.
- double GetLoadingProgress() const;
+ // Sets this node's loading progress (from 0 to 1).
+ void set_loading_progress(double loading_progress) {
+ loading_progress_ = loading_progress;
+ }
+
+ // Returns this node's loading progress.
+ double loading_progress() const { return loading_progress_; }
private:
void set_parent(FrameTreeNode* parent) { parent_ = parent; }
@@ -178,6 +192,9 @@ class CONTENT_EXPORT FrameTreeNode {
// flags when a navigation for this frame commits.
SandboxFlags effective_sandbox_flags_;
+ // Used to track this node's loading progress (from 0 to 1).
+ double loading_progress_;
+
DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
};
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698