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

Side by Side Diff: content/common/resource_dispatcher.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, 3 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 | « content/common/request_extra_data.cc ('k') | content/common/resource_dispatcher_unittest.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/common/resource_dispatcher.h" 7 #include "content/common/resource_dispatcher.h"
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 request_.origin_pid = request_info.requestor_pid; 91 request_.origin_pid = request_info.requestor_pid;
92 request_.resource_type = request_info.request_type; 92 request_.resource_type = request_info.request_type;
93 request_.request_context = request_info.request_context; 93 request_.request_context = request_info.request_context;
94 request_.appcache_host_id = request_info.appcache_host_id; 94 request_.appcache_host_id = request_info.appcache_host_id;
95 request_.download_to_file = request_info.download_to_file; 95 request_.download_to_file = request_info.download_to_file;
96 request_.has_user_gesture = request_info.has_user_gesture; 96 request_.has_user_gesture = request_info.has_user_gesture;
97 if (request_info.extra_data) { 97 if (request_info.extra_data) {
98 RequestExtraData* extra_data = 98 RequestExtraData* extra_data =
99 static_cast<RequestExtraData*>(request_info.extra_data); 99 static_cast<RequestExtraData*>(request_info.extra_data);
100 request_.is_main_frame = extra_data->is_main_frame(); 100 request_.is_main_frame = extra_data->is_main_frame();
101 request_.frame_id = extra_data->frame_identifier(); 101 request_.frame_id = extra_data->frame_id();
102 request_.transition_type = extra_data->transition_type();
102 } else { 103 } else {
103 request_.is_main_frame = false; 104 request_.is_main_frame = false;
104 request_.frame_id = -1; 105 request_.frame_id = -1;
106 request_.transition_type = PageTransition::LINK;
105 } 107 }
106 } 108 }
107 109
108 IPCResourceLoaderBridge::~IPCResourceLoaderBridge() { 110 IPCResourceLoaderBridge::~IPCResourceLoaderBridge() {
109 // we remove our hook for the resource dispatcher only when going away, since 111 // we remove our hook for the resource dispatcher only when going away, since
110 // it doesn't keep track of whether we've force terminated the request 112 // it doesn't keep track of whether we've force terminated the request
111 if (request_id_ >= 0) { 113 if (request_id_ >= 0) {
112 // this operation may fail, as the dispatcher will have preemptively 114 // this operation may fail, as the dispatcher will have preemptively
113 // removed us when the renderer sends the ReceivedAllData message. 115 // removed us when the renderer sends the ReceivedAllData message.
114 dispatcher_->RemovePendingRequest(request_id_); 116 dispatcher_->RemovePendingRequest(request_id_);
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 605
604 // static 606 // static
605 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { 607 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) {
606 while (!queue->empty()) { 608 while (!queue->empty()) {
607 IPC::Message* message = queue->front(); 609 IPC::Message* message = queue->front();
608 ReleaseResourcesInDataMessage(*message); 610 ReleaseResourcesInDataMessage(*message);
609 queue->pop_front(); 611 queue->pop_front();
610 delete message; 612 delete message;
611 } 613 }
612 } 614 }
OLDNEW
« no previous file with comments | « content/common/request_extra_data.cc ('k') | content/common/resource_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698