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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 180113003: Prepare for per frame did{Start,Stop}Loading calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/renderer/render_frame_impl.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 2cbc75124826116f81d8fb596cb3ac96bcfc474f..a80269cb3ebdb77e25ee5bae4f64f8c397f9589c 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -298,6 +298,7 @@ RenderFrameImpl::RenderFrameImpl(RenderViewImpl* render_view, int routing_id)
: frame_(NULL),
render_view_(render_view->AsWeakPtr()),
routing_id_(routing_id),
+ is_loading_(false),
is_swapped_out_(false),
is_detaching_(false),
cookie_jar_(this) {
@@ -2430,11 +2431,35 @@ WebElement RenderFrameImpl::GetFocusedElement() {
return WebElement();
}
-void RenderFrameImpl::didStartLoading() {
+void RenderFrameImpl::didStartLoading(bool to_different_document) {
+ if (is_loading_) {
+ DVLOG(1) << "didStartLoading called while loading";
+ return;
+ }
+
+ is_loading_ = true;
+
+ render_view_->didStartLoading(frame_);
+
Send(new FrameHostMsg_DidStartLoading(routing_id_));
}
void RenderFrameImpl::didStopLoading() {
+ if (!is_loading_) {
+ DVLOG(1) << "DidStopLoading called while not loading";
+ return;
+ }
+
+ is_loading_ = false;
+
+ render_view_->didStopLoading(frame_);
+
+ // NOTE: For now we're doing the safest thing, and sending out notification
+ // when done loading. This currently isn't an issue as the favicon is only
+ // displayed when done loading. Ideally we would send notification when
+ // finished parsing the head, but webkit doesn't support that yet.
+ // The feed discovery code would also benefit from access to the head.
+ // NOTE: Sending of the IPC message happens through the top-level frame.
Send(new FrameHostMsg_DidStopLoading(routing_id_));
}
@@ -2695,4 +2720,8 @@ void RenderFrameImpl::OpenURL(WebFrame* frame,
Send(new FrameHostMsg_OpenURL(routing_id_, params));
}
+void RenderFrameImpl::didChangeLoadProgress(double load_progress) {
+ render_view_->didChangeLoadProgress(frame_, load_progress);
+}
+
} // namespace content
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698