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

Unified Diff: content/renderer/render_view.cc

Issue 7624031: Treat files downloaded from the address bar as "always safe" (including extensions per discussion... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/common/resource_messages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view.cc
===================================================================
--- content/renderer/render_view.cc (revision 98485)
+++ content/renderer/render_view.cc (working copy)
@@ -2668,9 +2668,10 @@
// Ignore
}
-void RenderView::willSendRequest(
- WebFrame* frame, unsigned identifier, WebURLRequest& request,
- const WebURLResponse& redirect_response) {
+void RenderView::willSendRequest(WebFrame* frame,
+ unsigned identifier,
+ WebURLRequest& request,
+ const WebURLResponse& redirect_response) {
WebFrame* top_frame = frame->top();
if (!top_frame)
top_frame = frame;
@@ -2679,10 +2680,6 @@
WebDataSource* data_source =
provisional_data_source ? provisional_data_source : top_data_source;
- bool is_top_frame = (frame == top_frame);
- request.setExtraData(
- new RequestExtraData(is_top_frame, frame->identifier()));
-
GURL request_url(request.url());
GURL new_url;
if (content::GetContentClient()->renderer()->WillSendRequest(
@@ -2690,21 +2687,26 @@
request.setURL(WebURL(new_url));
}
- if (data_source) {
- NavigationState* state = NavigationState::FromDataSource(data_source);
- if (state && state->is_cache_policy_override_set())
- request.setCachePolicy(state->cache_policy_override());
+ PageTransition::Type transition_type = PageTransition::LINK;
+ NavigationState* data_state = NavigationState::FromDataSource(data_source);
+ if (data_state) {
+ if (data_state->is_cache_policy_override_set())
+ request.setCachePolicy(data_state->cache_policy_override());
+ transition_type = data_state->transition_type();
}
- if (top_data_source) {
- NavigationState* state = NavigationState::FromDataSource(top_data_source);
- // TODO(gavinp): separate out prefetching and prerender field trials
- // if the rel=prerender rel type is sticking around.
- if (state && (request.targetType() == WebURLRequest::TargetIsPrefetch ||
- request.targetType() == WebURLRequest::TargetIsPrerender))
- state->set_was_prefetcher(true);
- }
+ request.setExtraData(new RequestExtraData((frame == top_frame),
+ frame->identifier(), transition_type));
+ NavigationState* top_data_state =
+ NavigationState::FromDataSource(top_data_source);
+ // TODO(gavinp): separate out prefetching and prerender field trials
+ // if the rel=prerender rel type is sticking around.
+ if (top_data_state &&
+ (request.targetType() == WebURLRequest::TargetIsPrefetch ||
+ request.targetType() == WebURLRequest::TargetIsPrerender))
+ top_data_state->set_was_prefetcher(true);
+
request.setRequestorID(routing_id_);
request.setHasUserGesture(frame->isProcessingUserGesture());
« no previous file with comments | « content/common/resource_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698