OLD | NEW |
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/bind.h" | 10 #include "base/bind.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 request_.download_to_file = request_info.download_to_file; | 99 request_.download_to_file = request_info.download_to_file; |
100 request_.has_user_gesture = request_info.has_user_gesture; | 100 request_.has_user_gesture = request_info.has_user_gesture; |
101 if (request_info.extra_data) { | 101 if (request_info.extra_data) { |
102 RequestExtraData* extra_data = | 102 RequestExtraData* extra_data = |
103 static_cast<RequestExtraData*>(request_info.extra_data); | 103 static_cast<RequestExtraData*>(request_info.extra_data); |
104 request_.is_main_frame = extra_data->is_main_frame(); | 104 request_.is_main_frame = extra_data->is_main_frame(); |
105 request_.frame_id = extra_data->frame_id(); | 105 request_.frame_id = extra_data->frame_id(); |
106 request_.parent_is_main_frame = extra_data->parent_is_main_frame(); | 106 request_.parent_is_main_frame = extra_data->parent_is_main_frame(); |
107 request_.parent_frame_id = extra_data->parent_frame_id(); | 107 request_.parent_frame_id = extra_data->parent_frame_id(); |
108 request_.transition_type = extra_data->transition_type(); | 108 request_.transition_type = extra_data->transition_type(); |
| 109 request_.transferred_request_child_id = |
| 110 extra_data->transferred_request_child_id(); |
| 111 request_.transferred_request_request_id = |
| 112 extra_data->transferred_request_request_id(); |
109 } else { | 113 } else { |
110 request_.is_main_frame = false; | 114 request_.is_main_frame = false; |
111 request_.frame_id = -1; | 115 request_.frame_id = -1; |
112 request_.parent_is_main_frame = false; | 116 request_.parent_is_main_frame = false; |
113 request_.parent_frame_id = -1; | 117 request_.parent_frame_id = -1; |
114 request_.transition_type = content::PAGE_TRANSITION_LINK; | 118 request_.transition_type = content::PAGE_TRANSITION_LINK; |
| 119 request_.transferred_request_child_id = -1; |
| 120 request_.transferred_request_request_id = -1; |
115 } | 121 } |
116 } | 122 } |
117 | 123 |
118 IPCResourceLoaderBridge::~IPCResourceLoaderBridge() { | 124 IPCResourceLoaderBridge::~IPCResourceLoaderBridge() { |
119 // we remove our hook for the resource dispatcher only when going away, since | 125 // we remove our hook for the resource dispatcher only when going away, since |
120 // it doesn't keep track of whether we've force terminated the request | 126 // it doesn't keep track of whether we've force terminated the request |
121 if (request_id_ >= 0) { | 127 if (request_id_ >= 0) { |
122 // this operation may fail, as the dispatcher will have preemptively | 128 // this operation may fail, as the dispatcher will have preemptively |
123 // removed us when the renderer sends the ReceivedAllData message. | 129 // removed us when the renderer sends the ReceivedAllData message. |
124 dispatcher_->RemovePendingRequest(request_id_); | 130 dispatcher_->RemovePendingRequest(request_id_); |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 | 621 |
616 // static | 622 // static |
617 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 623 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
618 while (!queue->empty()) { | 624 while (!queue->empty()) { |
619 IPC::Message* message = queue->front(); | 625 IPC::Message* message = queue->front(); |
620 ReleaseResourcesInDataMessage(*message); | 626 ReleaseResourcesInDataMessage(*message); |
621 queue->pop_front(); | 627 queue->pop_front(); |
622 delete message; | 628 delete message; |
623 } | 629 } |
624 } | 630 } |
OLD | NEW |