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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10829028: Add DCHECK(), remove if statement to prevent NULL pointer dereference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index a2cc30276823bf341c90abf188280968a1c46729..9d8cd128cf8acdaa5ef242b39aafb60240ebaef1 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3302,12 +3302,11 @@ void RenderViewImpl::willSendRequest(WebFrame* frame,
content::PageTransition transition_type = content::PAGE_TRANSITION_LINK;
DocumentState* document_state = DocumentState::FromDataSource(data_source);
+ DCHECK(document_state);
Tyler Breisacher (Chromium) 2012/07/25 23:46:18 I think we could probably just leave out this DCHE
NavigationState* navigation_state = document_state->navigation_state();
- if (document_state) {
- if (document_state->is_cache_policy_override_set())
- request.setCachePolicy(document_state->cache_policy_override());
- transition_type = navigation_state->transition_type();
- }
+ if (document_state->is_cache_policy_override_set())
+ request.setCachePolicy(document_state->cache_policy_override());
+ transition_type = navigation_state->transition_type();
WebKit::WebReferrerPolicy referrer_policy;
if (document_state && document_state->is_referrer_policy_set()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698