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

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

Issue 1403001: Modifying the "dangerous download" algorithm. (Closed)
Patch Set: Moving extension methods out of download_util.h Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3067 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 if (event_time != 0.0) 3078 if (event_time != 0.0)
3079 navigation_state->set_request_time(Time::FromDoubleT(event_time)); 3079 navigation_state->set_request_time(Time::FromDoubleT(event_time));
3080 } 3080 }
3081 3081
3082 // Start time is only set after request time. 3082 // Start time is only set after request time.
3083 navigation_state->set_start_load_time(Time::Now()); 3083 navigation_state->set_start_load_time(Time::Now());
3084 3084
3085 bool is_top_most = !frame->parent(); 3085 bool is_top_most = !frame->parent();
3086 if (is_top_most) { 3086 if (is_top_most) {
3087 navigation_gesture_ = frame->isProcessingUserGesture() ? 3087 navigation_gesture_ = frame->isProcessingUserGesture() ?
3088 NavigationGestureUnknown : NavigationGestureAuto; 3088 NavigationGestureUser : NavigationGestureAuto;
3089 3089
3090 // Make sure redirect tracking state is clear for the new load. 3090 // Make sure redirect tracking state is clear for the new load.
3091 completed_client_redirect_src_ = GURL(); 3091 completed_client_redirect_src_ = GURL();
3092 } else if (frame->parent()->isLoading()) { 3092 } else if (frame->parent()->isLoading()) {
3093 // Take note of AUTO_SUBFRAME loads here, so that we can know how to 3093 // Take note of AUTO_SUBFRAME loads here, so that we can know how to
3094 // load an error page. See didFailProvisionalLoad. 3094 // load an error page. See didFailProvisionalLoad.
3095 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); 3095 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME);
3096 } 3096 }
3097 3097
3098 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( 3098 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame(
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
3446 request.setCachePolicy(state->cache_policy_override()); 3446 request.setCachePolicy(state->cache_policy_override());
3447 } 3447 }
3448 3448
3449 if (top_data_source) { 3449 if (top_data_source) {
3450 NavigationState* state = NavigationState::FromDataSource(top_data_source); 3450 NavigationState* state = NavigationState::FromDataSource(top_data_source);
3451 if (state && request.targetType() == WebURLRequest::TargetIsPrefetch) 3451 if (state && request.targetType() == WebURLRequest::TargetIsPrefetch)
3452 state->set_was_prefetcher(true); 3452 state->set_was_prefetcher(true);
3453 } 3453 }
3454 3454
3455 request.setRequestorID(routing_id_); 3455 request.setRequestorID(routing_id_);
3456 request.setHasUserGesture(frame->isProcessingUserGesture());
3457
3456 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers)) 3458 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers))
3457 request.clearHTTPHeaderField("Referer"); 3459 request.clearHTTPHeaderField("Referer");
3458 3460
3459 // Temporary metrics, see site_isolation_metrics.h 3461 // Temporary metrics, see site_isolation_metrics.h
3460 SiteIsolationMetrics::AddRequest(identifier, request.targetType()); 3462 SiteIsolationMetrics::AddRequest(identifier, request.targetType());
3461 } 3463 }
3462 3464
3463 void RenderView::didReceiveResponse( 3465 void RenderView::didReceiveResponse(
3464 WebFrame* frame, unsigned identifier, const WebURLResponse& response) { 3466 WebFrame* frame, unsigned identifier, const WebURLResponse& response) {
3465 3467
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
5526 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), 5528 IPC::PlatformFileForTransitToPlatformFile(file_for_transit),
5527 message_id); 5529 message_id);
5528 } 5530 }
5529 5531
5530 #if defined(OS_MACOSX) 5532 #if defined(OS_MACOSX)
5531 void RenderView::OnSelectPopupMenuItem(int selected_index) { 5533 void RenderView::OnSelectPopupMenuItem(int selected_index) {
5532 external_popup_menu_->DidSelectItem(selected_index); 5534 external_popup_menu_->DidSelectItem(selected_index);
5533 external_popup_menu_.reset(); 5535 external_popup_menu_.reset();
5534 } 5536 }
5535 #endif 5537 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698