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

Side by Side Diff: chrome/browser/renderer_host/resource_dispatcher_host.cc

Issue 1403001: Modifying the "dangerous download" algorithm. (Closed)
Patch Set: Adding .sys and .drv as Dangerous extensions Created 10 years 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 process_type, 512 process_type,
513 child_id, 513 child_id,
514 route_id, 514 route_id,
515 request_id, 515 request_id,
516 request_data.frame_origin, 516 request_data.frame_origin,
517 request_data.main_frame_origin, 517 request_data.main_frame_origin,
518 request_data.resource_type, 518 request_data.resource_type,
519 upload_size, 519 upload_size,
520 false, // is download 520 false, // is download
521 ResourceType::IsFrame(request_data.resource_type), // allow_download 521 ResourceType::IsFrame(request_data.resource_type), // allow_download
522 request_data.has_user_gesture,
522 request_data.host_renderer_id, 523 request_data.host_renderer_id,
523 request_data.host_render_view_id); 524 request_data.host_render_view_id);
524 ApplyExtensionLocalizationFilter(request_data.url, request_data.resource_type, 525 ApplyExtensionLocalizationFilter(request_data.url, request_data.resource_type,
525 extra_info); 526 extra_info);
526 SetRequestInfo(request, extra_info); // Request takes ownership. 527 SetRequestInfo(request, extra_info); // Request takes ownership.
527 chrome_browser_net::SetOriginProcessUniqueIDForRequest( 528 chrome_browser_net::SetOriginProcessUniqueIDForRequest(
528 request_data.origin_child_id, request); 529 request_data.origin_child_id, request);
529 530
530 if (request->url().SchemeIs(chrome::kBlobScheme) && context) { 531 if (request->url().SchemeIs(chrome::kBlobScheme) && context) {
531 // Hang on to a reference to ensure the blob is not released prior 532 // Hang on to a reference to ensure the blob is not released prior
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 ChildProcessInfo::RENDER_PROCESS, 650 ChildProcessInfo::RENDER_PROCESS,
650 child_id, 651 child_id,
651 route_id, 652 route_id,
652 request_id_, 653 request_id_,
653 "null", // frame_origin 654 "null", // frame_origin
654 "null", // main_frame_origin 655 "null", // main_frame_origin
655 ResourceType::SUB_RESOURCE, 656 ResourceType::SUB_RESOURCE,
656 0, // upload_size 657 0, // upload_size
657 download, // is_download 658 download, // is_download
658 download, // allow_download 659 download, // allow_download
660 false, // has_user_gesture
659 -1, // Host renderer id 661 -1, // Host renderer id
660 -1); // Host render view id 662 -1); // Host render view id
661 } 663 }
662 664
663 void ResourceDispatcherHost::OnClosePageACK( 665 void ResourceDispatcherHost::OnClosePageACK(
664 const ViewMsg_ClosePage_Params& params) { 666 const ViewMsg_ClosePage_Params& params) {
665 if (params.for_cross_site_transition) { 667 if (params.for_cross_site_transition) {
666 // Closes for cross-site transitions are handled such that the cross-site 668 // Closes for cross-site transitions are handled such that the cross-site
667 // transition continues. 669 // transition continues.
668 GlobalRequestID global_id(params.new_render_process_host_id, 670 GlobalRequestID global_id(params.new_render_process_host_id,
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 return is_prefetch_enabled_; 1936 return is_prefetch_enabled_;
1935 } 1937 }
1936 1938
1937 // static 1939 // static
1938 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { 1940 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) {
1939 is_prefetch_enabled_ = value; 1941 is_prefetch_enabled_ = value;
1940 } 1942 }
1941 1943
1942 // static 1944 // static
1943 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; 1945 bool ResourceDispatcherHost::is_prefetch_enabled_ = false;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698