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

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

Issue 1015243004: Move load progress tracking logic to the frame tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. 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
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index 7df1291a9f4cb8e0757e34f9e10498bfe865a121..86edb173ef5b1acf9f427b0ace49230bec9a6fe6 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -28,6 +28,10 @@ base::LazyInstance<FrameTreeNodeIDMap> g_frame_tree_node_id_map =
} // namespace
+const double FrameTreeNode::kLoadingProgressNotStarted = 0.0;
+const double FrameTreeNode::kLoadingProgressMinimum = 0.1;
+const double FrameTreeNode::kLoadingProgressDone = 1.0;
+
int64 FrameTreeNode::next_frame_tree_node_id_ = 1;
// static
@@ -55,7 +59,8 @@ FrameTreeNode::FrameTreeNode(FrameTree* frame_tree,
frame_tree_node_id_(next_frame_tree_node_id_++),
parent_(NULL),
replication_state_(name),
- effective_sandbox_flags_(SandboxFlags::NONE) {
+ effective_sandbox_flags_(SandboxFlags::NONE),
+ loading_progress_(kLoadingProgressNotStarted) {
std::pair<FrameTreeNodeIDMap::iterator, bool> result =
g_frame_tree_node_id_map.Get().insert(
std::make_pair(frame_tree_node_id_, this));
@@ -154,14 +159,6 @@ bool FrameTreeNode::IsLoading() const {
return current_frame_host->is_loading();
}
-double FrameTreeNode::GetLoadingProgress() const {
- RenderFrameHostImpl* current_frame_host =
- render_manager_.current_frame_host();
-
- DCHECK(current_frame_host);
- return current_frame_host->loading_progress();
-}
-
bool FrameTreeNode::CommitPendingSandboxFlags() {
bool did_change_flags =
effective_sandbox_flags_ != replication_state_.sandbox_flags;

Powered by Google App Engine
This is Rietveld 408576698