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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3284 matching lines...) Expand 10 before | Expand all | Expand 10 after
3295 3295
3296 GURL request_url(request.url()); 3296 GURL request_url(request.url());
3297 GURL new_url; 3297 GURL new_url;
3298 if (content::GetContentClient()->renderer()->WillSendRequest( 3298 if (content::GetContentClient()->renderer()->WillSendRequest(
3299 frame, request_url, &new_url)) { 3299 frame, request_url, &new_url)) {
3300 request.setURL(WebURL(new_url)); 3300 request.setURL(WebURL(new_url));
3301 } 3301 }
3302 3302
3303 content::PageTransition transition_type = content::PAGE_TRANSITION_LINK; 3303 content::PageTransition transition_type = content::PAGE_TRANSITION_LINK;
3304 DocumentState* document_state = DocumentState::FromDataSource(data_source); 3304 DocumentState* document_state = DocumentState::FromDataSource(data_source);
3305 DCHECK(document_state);
Tyler Breisacher (Chromium) 2012/07/25 23:46:18 I think we could probably just leave out this DCHE
3305 NavigationState* navigation_state = document_state->navigation_state(); 3306 NavigationState* navigation_state = document_state->navigation_state();
3306 if (document_state) { 3307 if (document_state->is_cache_policy_override_set())
3307 if (document_state->is_cache_policy_override_set()) 3308 request.setCachePolicy(document_state->cache_policy_override());
3308 request.setCachePolicy(document_state->cache_policy_override()); 3309 transition_type = navigation_state->transition_type();
3309 transition_type = navigation_state->transition_type();
3310 }
3311 3310
3312 WebKit::WebReferrerPolicy referrer_policy; 3311 WebKit::WebReferrerPolicy referrer_policy;
3313 if (document_state && document_state->is_referrer_policy_set()) { 3312 if (document_state && document_state->is_referrer_policy_set()) {
3314 referrer_policy = document_state->referrer_policy(); 3313 referrer_policy = document_state->referrer_policy();
3315 document_state->clear_referrer_policy(); 3314 document_state->clear_referrer_policy();
3316 } else { 3315 } else {
3317 referrer_policy = frame->document().referrerPolicy(); 3316 referrer_policy = frame->document().referrerPolicy();
3318 } 3317 }
3319 3318
3320 // The request's extra data may indicate that we should set a custom user 3319 // The request's extra data may indicate that we should set a custom user
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after
5717 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5716 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5718 return !!RenderThreadImpl::current()->compositor_thread(); 5717 return !!RenderThreadImpl::current()->compositor_thread();
5719 } 5718 }
5720 5719
5721 void RenderViewImpl::OnJavaBridgeInit() { 5720 void RenderViewImpl::OnJavaBridgeInit() {
5722 DCHECK(!java_bridge_dispatcher_); 5721 DCHECK(!java_bridge_dispatcher_);
5723 #if defined(ENABLE_JAVA_BRIDGE) 5722 #if defined(ENABLE_JAVA_BRIDGE)
5724 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5723 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5725 #endif 5724 #endif
5726 } 5725 }
OLDNEW
« 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