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

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

Issue 989473003: Reland of Refactor the loading tracking logic in WebContentsImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert change + nits 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_node.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('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.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index cb1c0cc6c7b3792b975161349aed08125ed3554b..dccf1017076c9385b2a30d46792b13e7b83a33f9 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -35,8 +35,7 @@ FrameTreeNode::FrameTreeNode(FrameTree* frame_tree,
frame_tree_node_id_(next_frame_tree_node_id_++),
parent_(NULL),
replication_state_(name),
- effective_sandbox_flags_(SandboxFlags::NONE),
- is_loading_(false) {
+ effective_sandbox_flags_(SandboxFlags::NONE) {
}
FrameTreeNode::~FrameTreeNode() {
@@ -123,6 +122,28 @@ bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
return false;
}
+bool FrameTreeNode::IsLoading() const {
+ RenderFrameHostImpl* current_frame_host =
+ render_manager_.current_frame_host();
+ RenderFrameHostImpl* pending_frame_host =
+ render_manager_.pending_frame_host();
+
+ DCHECK(current_frame_host);
+ // TODO(fdegans): Change the implementation logic for PlzNavigate once
+ // DidStartLoading and DidStopLoading are properly called.
+ if (pending_frame_host && pending_frame_host->is_loading())
+ return true;
+ 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;
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698