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

Unified Diff: chrome/renderer/render_view.cc

Issue 150208: Set the WebViewDelegate earlier during WebView creation to ensure that... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « no previous file | webkit/glue/webview_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 19802)
+++ chrome/renderer/render_view.cc (working copy)
@@ -1076,19 +1076,16 @@
WebDataSource* ds = main_frame->GetDataSource();
NavigationState* navigation_state = NavigationState::FromDataSource(ds);
- // TODO(darin): It should not be possible for navigation_state to
- // be null here! But the UI test DownloadTest.IncognitoDownload
- // can cause it to happen.
- if (navigation_state) {
- Time now = Time::Now();
- if (navigation_state->first_paint_time().is_null()) {
- navigation_state->set_first_paint_time(now);
- }
- if (navigation_state->first_paint_after_load_time().is_null() &&
- !navigation_state->finish_load_time().is_null()) {
- navigation_state->set_first_paint_after_load_time(now);
- }
+ DCHECK(navigation_state);
+
+ Time now = Time::Now();
+ if (navigation_state->first_paint_time().is_null()) {
+ navigation_state->set_first_paint_time(now);
}
+ if (navigation_state->first_paint_after_load_time().is_null() &&
+ !navigation_state->finish_load_time().is_null()) {
+ navigation_state->set_first_paint_after_load_time(now);
+ }
}
void RenderView::DidStartProvisionalLoadForFrame(
@@ -1318,10 +1315,8 @@
void RenderView::DidFinishLoadForFrame(WebView* webview, WebFrame* frame) {
WebDataSource* ds = frame->GetDataSource();
NavigationState* navigation_state = NavigationState::FromDataSource(ds);
- // TODO(darin): It should not be possible for navigation_state to be null
- // here!
- if (navigation_state)
- navigation_state->set_finish_load_time(Time::Now());
+ DCHECK(navigation_state);
+ navigation_state->set_finish_load_time(Time::Now());
}
void RenderView::DidFailLoadWithError(WebView* webview,
@@ -1336,10 +1331,8 @@
WebFrame* frame) {
WebDataSource* ds = frame->GetDataSource();
NavigationState* navigation_state = NavigationState::FromDataSource(ds);
- // TODO(darin): It should not be possible for navigation_state to be null
- // here!
- if (navigation_state)
- navigation_state->set_finish_document_load_time(Time::Now());
+ DCHECK(navigation_state);
+ navigation_state->set_finish_document_load_time(Time::Now());
Send(new ViewHostMsg_DocumentLoadedInFrame(routing_id_));
@@ -2727,6 +2720,7 @@
DCHECK(ds != NULL);
NavigationState* navigation_state = NavigationState::FromDataSource(ds);
+ DCHECK(navigation_state);
if (navigation_state->transition_type() == PageTransition::START_PAGE)
return;
« no previous file with comments | « no previous file | webkit/glue/webview_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698