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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 100033: Synchronously update the loading state when a load starts so that the UI will... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 if (is_loading_) { 1150 if (is_loading_) {
1151 DLOG(WARNING) << "DidStartLoading called while loading"; 1151 DLOG(WARNING) << "DidStartLoading called while loading";
1152 return; 1152 return;
1153 } 1153 }
1154 1154
1155 is_loading_ = true; 1155 is_loading_ = true;
1156 // Clear the pointer so that we can assign it only when there is an unknown 1156 // Clear the pointer so that we can assign it only when there is an unknown
1157 // plugin on a page. 1157 // plugin on a page.
1158 first_default_plugin_ = NULL; 1158 first_default_plugin_ = NULL;
1159 1159
1160 Send(new ViewHostMsg_DidStartLoading(routing_id_, page_id_)); 1160 Send(new ViewHostMsg_DidStartLoading(routing_id_));
1161 } 1161 }
1162 1162
1163 void RenderView::DidStopLoading(WebView* webview) { 1163 void RenderView::DidStopLoading(WebView* webview) {
1164 if (!is_loading_) { 1164 if (!is_loading_) {
1165 DLOG(WARNING) << "DidStopLoading called while not loading"; 1165 DLOG(WARNING) << "DidStopLoading called while not loading";
1166 return; 1166 return;
1167 } 1167 }
1168 1168
1169 is_loading_ = false; 1169 is_loading_ = false;
1170 1170
1171 // NOTE: For now we're doing the safest thing, and sending out notification 1171 // NOTE: For now we're doing the safest thing, and sending out notification
1172 // when done loading. This currently isn't an issue as the favicon is only 1172 // when done loading. This currently isn't an issue as the favicon is only
1173 // displayed when done loading. Ideally we would send notification when 1173 // displayed when done loading. Ideally we would send notification when
1174 // finished parsing the head, but webkit doesn't support that yet. 1174 // finished parsing the head, but webkit doesn't support that yet.
1175 // The feed discovery code would also benefit from access to the head. 1175 // The feed discovery code would also benefit from access to the head.
1176 GURL favicon_url(webview->GetMainFrame()->GetFavIconURL()); 1176 GURL favicon_url(webview->GetMainFrame()->GetFavIconURL());
1177 if (!favicon_url.is_empty()) 1177 if (!favicon_url.is_empty())
1178 Send(new ViewHostMsg_UpdateFavIconURL(routing_id_, page_id_, favicon_url)); 1178 Send(new ViewHostMsg_UpdateFavIconURL(routing_id_, page_id_, favicon_url));
1179 1179
1180 AddGURLSearchProvider(webview->GetMainFrame()->GetOSDDURL(), 1180 AddGURLSearchProvider(webview->GetMainFrame()->GetOSDDURL(),
1181 true); // autodetected 1181 true); // autodetected
1182 1182
1183 Send(new ViewHostMsg_DidStopLoading(routing_id_, page_id_)); 1183 Send(new ViewHostMsg_DidStopLoading(routing_id_));
1184 1184
1185 MessageLoop::current()->PostDelayedTask(FROM_HERE, 1185 MessageLoop::current()->PostDelayedTask(FROM_HERE,
1186 method_factory_.NewRunnableMethod(&RenderView::CapturePageInfo, page_id_, 1186 method_factory_.NewRunnableMethod(&RenderView::CapturePageInfo, page_id_,
1187 false), 1187 false),
1188 kDelayForCaptureMs); 1188 kDelayForCaptureMs);
1189 1189
1190 // The page is loaded. Try to process the file we need to upload if any. 1190 // The page is loaded. Try to process the file we need to upload if any.
1191 ProcessPendingUpload(); 1191 ProcessPendingUpload();
1192 1192
1193 // Since the page is done loading, we are sure we don't need to try 1193 // Since the page is done loading, we are sure we don't need to try
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 } 2998 }
2999 } 2999 }
3000 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinishDoc", start_to_finish_doc); 3000 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinishDoc", start_to_finish_doc);
3001 UMA_HISTOGRAM_TIMES("Renderer.All.FinishDocToFinish", finish_doc_to_finish); 3001 UMA_HISTOGRAM_TIMES("Renderer.All.FinishDocToFinish", finish_doc_to_finish);
3002 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinish", start_to_finish); 3002 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinish", start_to_finish);
3003 if (start_to_first_layout.ToInternalValue() >= 0) { 3003 if (start_to_first_layout.ToInternalValue() >= 0) {
3004 UMA_HISTOGRAM_TIMES( 3004 UMA_HISTOGRAM_TIMES(
3005 "Renderer.All.StartToFirstLayout", start_to_first_layout); 3005 "Renderer.All.StartToFirstLayout", start_to_first_layout);
3006 } 3006 }
3007 } 3007 }
OLDNEW
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698