OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/child/resource_dispatcher.h" | 7 #include "content/child/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 10 matching lines...) Expand all Loading... |
21 #include "content/child/sync_load_response.h" | 21 #include "content/child/sync_load_response.h" |
22 #include "content/common/inter_process_time_ticks_converter.h" | 22 #include "content/common/inter_process_time_ticks_converter.h" |
23 #include "content/common/resource_messages.h" | 23 #include "content/common/resource_messages.h" |
24 #include "content/public/child/request_peer.h" | 24 #include "content/public/child/request_peer.h" |
25 #include "content/public/child/resource_dispatcher_delegate.h" | 25 #include "content/public/child/resource_dispatcher_delegate.h" |
26 #include "content/public/common/resource_response.h" | 26 #include "content/public/common/resource_response.h" |
27 #include "net/base/net_errors.h" | 27 #include "net/base/net_errors.h" |
28 #include "net/base/net_util.h" | 28 #include "net/base/net_util.h" |
29 #include "net/base/request_priority.h" | 29 #include "net/base/request_priority.h" |
30 #include "net/http/http_response_headers.h" | 30 #include "net/http/http_response_headers.h" |
31 #include "webkit/child/resource_loader_bridge.h" | |
32 #include "webkit/common/resource_type.h" | 31 #include "webkit/common/resource_type.h" |
33 | 32 |
34 using webkit_glue::ResourceLoaderBridge; | 33 using webkit_glue::ResourceLoaderBridge; |
35 using webkit_glue::ResourceResponseInfo; | 34 using webkit_glue::ResourceResponseInfo; |
36 | 35 |
37 namespace content { | 36 namespace content { |
38 | 37 |
39 namespace { | 38 namespace { |
40 | 39 |
41 // Converts |time| from a remote to local TimeTicks, overwriting the original | 40 // Converts |time| from a remote to local TimeTicks, overwriting the original |
42 // value. | 41 // value. |
43 void RemoteToLocalTimeTicks( | 42 void RemoteToLocalTimeTicks( |
44 const InterProcessTimeTicksConverter& converter, | 43 const InterProcessTimeTicksConverter& converter, |
45 base::TimeTicks* time) { | 44 base::TimeTicks* time) { |
46 RemoteTimeTicks remote_time = RemoteTimeTicks::FromTimeTicks(*time); | 45 RemoteTimeTicks remote_time = RemoteTimeTicks::FromTimeTicks(*time); |
47 *time = converter.ToLocalTimeTicks(remote_time).ToTimeTicks(); | 46 *time = converter.ToLocalTimeTicks(remote_time).ToTimeTicks(); |
48 } | 47 } |
49 | 48 |
50 | 49 void CrashOnMapFailure() { |
51 } // namespace | |
52 | |
53 static void CrashOnMapFailure() { | |
54 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
55 DWORD last_err = GetLastError(); | 51 DWORD last_err = GetLastError(); |
56 base::debug::Alias(&last_err); | 52 base::debug::Alias(&last_err); |
57 #endif | 53 #endif |
58 CHECK(false); | 54 CHECK(false); |
59 } | 55 } |
60 | 56 |
61 // Each resource request is assigned an ID scoped to this process. | 57 // Each resource request is assigned an ID scoped to this process. |
62 static int MakeRequestID() { | 58 int MakeRequestID() { |
63 // NOTE: The resource_dispatcher_host also needs probably unique | 59 // NOTE: The resource_dispatcher_host also needs probably unique |
64 // request_ids, so they count down from -2 (-1 is a special we're | 60 // request_ids, so they count down from -2 (-1 is a special we're |
65 // screwed value), while the renderer process counts up. | 61 // screwed value), while the renderer process counts up. |
66 static int next_request_id = 0; | 62 static int next_request_id = 0; |
67 return next_request_id++; | 63 return next_request_id++; |
68 } | 64 } |
69 | 65 |
70 // ResourceLoaderBridge implementation ---------------------------------------- | 66 } // namespace |
71 | |
72 class IPCResourceLoaderBridge : public ResourceLoaderBridge { | |
73 public: | |
74 IPCResourceLoaderBridge(ResourceDispatcher* dispatcher, | |
75 const RequestInfo& request_info); | |
76 virtual ~IPCResourceLoaderBridge(); | |
77 | |
78 // ResourceLoaderBridge | |
79 virtual void SetRequestBody(ResourceRequestBody* request_body) OVERRIDE; | |
80 virtual bool Start(RequestPeer* peer) OVERRIDE; | |
81 virtual void Cancel() OVERRIDE; | |
82 virtual void SetDefersLoading(bool value) OVERRIDE; | |
83 virtual void DidChangePriority(net::RequestPriority new_priority, | |
84 int intra_priority_value) OVERRIDE; | |
85 virtual void SyncLoad(SyncLoadResponse* response) OVERRIDE; | |
86 | |
87 private: | |
88 RequestPeer* peer_; | |
89 | |
90 // The resource dispatcher for this loader. The bridge doesn't own it, but | |
91 // it's guaranteed to outlive the bridge. | |
92 ResourceDispatcher* dispatcher_; | |
93 | |
94 // The request to send, created on initialization for modification and | |
95 // appending data. | |
96 ResourceHostMsg_Request request_; | |
97 | |
98 // ID for the request, valid once Start()ed, -1 if not valid yet. | |
99 int request_id_; | |
100 | |
101 // The routing id used when sending IPC messages. | |
102 int routing_id_; | |
103 | |
104 // The security origin of the frame that initiates this request. | |
105 GURL frame_origin_; | |
106 | |
107 bool is_synchronous_request_; | |
108 }; | |
109 | |
110 IPCResourceLoaderBridge::IPCResourceLoaderBridge( | |
111 ResourceDispatcher* dispatcher, | |
112 const RequestInfo& request_info) | |
113 : peer_(NULL), | |
114 dispatcher_(dispatcher), | |
115 request_id_(-1), | |
116 routing_id_(request_info.routing_id), | |
117 is_synchronous_request_(false) { | |
118 DCHECK(dispatcher_) << "no resource dispatcher"; | |
119 request_.method = request_info.method; | |
120 request_.url = request_info.url; | |
121 request_.first_party_for_cookies = request_info.first_party_for_cookies; | |
122 request_.referrer = request_info.referrer; | |
123 request_.referrer_policy = request_info.referrer_policy; | |
124 request_.headers = request_info.headers; | |
125 request_.load_flags = request_info.load_flags; | |
126 request_.origin_pid = request_info.requestor_pid; | |
127 request_.resource_type = request_info.request_type; | |
128 request_.priority = request_info.priority; | |
129 request_.request_context = request_info.request_context; | |
130 request_.appcache_host_id = request_info.appcache_host_id; | |
131 request_.download_to_file = request_info.download_to_file; | |
132 request_.has_user_gesture = request_info.has_user_gesture; | |
133 | |
134 const RequestExtraData kEmptyData; | |
135 const RequestExtraData* extra_data; | |
136 if (request_info.extra_data) | |
137 extra_data = static_cast<RequestExtraData*>(request_info.extra_data); | |
138 else | |
139 extra_data = &kEmptyData; | |
140 request_.visiblity_state = extra_data->visibility_state(); | |
141 request_.render_frame_id = extra_data->render_frame_id(); | |
142 request_.is_main_frame = extra_data->is_main_frame(); | |
143 request_.parent_is_main_frame = extra_data->parent_is_main_frame(); | |
144 request_.parent_render_frame_id = extra_data->parent_render_frame_id(); | |
145 request_.allow_download = extra_data->allow_download(); | |
146 request_.transition_type = extra_data->transition_type(); | |
147 request_.should_replace_current_entry = | |
148 extra_data->should_replace_current_entry(); | |
149 request_.transferred_request_child_id = | |
150 extra_data->transferred_request_child_id(); | |
151 request_.transferred_request_request_id = | |
152 extra_data->transferred_request_request_id(); | |
153 request_.service_worker_provider_id = | |
154 extra_data->service_worker_provider_id(); | |
155 frame_origin_ = extra_data->frame_origin(); | |
156 } | |
157 | |
158 IPCResourceLoaderBridge::~IPCResourceLoaderBridge() { | |
159 // we remove our hook for the resource dispatcher only when going away, since | |
160 // it doesn't keep track of whether we've force terminated the request | |
161 if (request_id_ >= 0) { | |
162 // this operation may fail, as the dispatcher will have preemptively | |
163 // removed us when the renderer sends the ReceivedAllData message. | |
164 dispatcher_->RemovePendingRequest(request_id_); | |
165 | |
166 if (request_.download_to_file) { | |
167 dispatcher_->message_sender()->Send( | |
168 new ResourceHostMsg_ReleaseDownloadedFile(request_id_)); | |
169 } | |
170 } | |
171 } | |
172 | |
173 void IPCResourceLoaderBridge::SetRequestBody( | |
174 ResourceRequestBody* request_body) { | |
175 DCHECK(request_id_ == -1) << "request already started"; | |
176 request_.request_body = request_body; | |
177 } | |
178 | |
179 // Writes a footer on the message and sends it | |
180 bool IPCResourceLoaderBridge::Start(RequestPeer* peer) { | |
181 if (request_id_ != -1) { | |
182 NOTREACHED() << "Starting a request twice"; | |
183 return false; | |
184 } | |
185 | |
186 peer_ = peer; | |
187 | |
188 // generate the request ID, and append it to the message | |
189 request_id_ = dispatcher_->AddPendingRequest(peer_, | |
190 request_.resource_type, | |
191 request_.origin_pid, | |
192 frame_origin_, | |
193 request_.url); | |
194 | |
195 return dispatcher_->message_sender()->Send( | |
196 new ResourceHostMsg_RequestResource(routing_id_, request_id_, request_)); | |
197 } | |
198 | |
199 void IPCResourceLoaderBridge::Cancel() { | |
200 if (request_id_ < 0) { | |
201 NOTREACHED() << "Trying to cancel an unstarted request"; | |
202 return; | |
203 } | |
204 | |
205 if (!is_synchronous_request_) | |
206 dispatcher_->CancelPendingRequest(request_id_); | |
207 | |
208 // We can't remove the request ID from the resource dispatcher because more | |
209 // data might be pending. Sending the cancel message may cause more data | |
210 // to be flushed, and will then cause a complete message to be sent. | |
211 } | |
212 | |
213 void IPCResourceLoaderBridge::SetDefersLoading(bool value) { | |
214 if (request_id_ < 0) { | |
215 NOTREACHED() << "Trying to (un)defer an unstarted request"; | |
216 return; | |
217 } | |
218 | |
219 dispatcher_->SetDefersLoading(request_id_, value); | |
220 } | |
221 | |
222 void IPCResourceLoaderBridge::DidChangePriority( | |
223 net::RequestPriority new_priority, int intra_priority_value) { | |
224 if (request_id_ < 0) { | |
225 NOTREACHED() << "Trying to change priority of an unstarted request"; | |
226 return; | |
227 } | |
228 | |
229 dispatcher_->DidChangePriority(routing_id_, request_id_, new_priority, | |
230 intra_priority_value); | |
231 } | |
232 | |
233 void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) { | |
234 if (request_id_ != -1) { | |
235 NOTREACHED() << "Starting a request twice"; | |
236 response->error_code = net::ERR_FAILED; | |
237 return; | |
238 } | |
239 | |
240 request_id_ = MakeRequestID(); | |
241 is_synchronous_request_ = true; | |
242 | |
243 SyncLoadResult result; | |
244 IPC::SyncMessage* msg = new ResourceHostMsg_SyncLoad(routing_id_, request_id_, | |
245 request_, &result); | |
246 // NOTE: This may pump events (see RenderThread::Send). | |
247 if (!dispatcher_->message_sender()->Send(msg)) { | |
248 response->error_code = net::ERR_FAILED; | |
249 return; | |
250 } | |
251 | |
252 response->error_code = result.error_code; | |
253 response->url = result.final_url; | |
254 response->headers = result.headers; | |
255 response->mime_type = result.mime_type; | |
256 response->charset = result.charset; | |
257 response->request_time = result.request_time; | |
258 response->response_time = result.response_time; | |
259 response->encoded_data_length = result.encoded_data_length; | |
260 response->load_timing = result.load_timing; | |
261 response->devtools_info = result.devtools_info; | |
262 response->data.swap(result.data); | |
263 response->download_file_path = result.download_file_path; | |
264 } | |
265 | |
266 // ResourceDispatcher --------------------------------------------------------- | |
267 | 67 |
268 ResourceDispatcher::ResourceDispatcher(IPC::Sender* sender) | 68 ResourceDispatcher::ResourceDispatcher(IPC::Sender* sender) |
269 : message_sender_(sender), | 69 : message_sender_(sender), |
| 70 peer_(NULL), |
| 71 request_id_(-1), |
| 72 routing_id_(-1), |
| 73 is_synchronous_request_(false), |
270 weak_factory_(this), | 74 weak_factory_(this), |
271 delegate_(NULL), | 75 delegate_(NULL), |
272 io_timestamp_(base::TimeTicks()) { | 76 io_timestamp_(base::TimeTicks()) { |
273 } | 77 } |
274 | 78 |
275 ResourceDispatcher::~ResourceDispatcher() { | 79 ResourceDispatcher::~ResourceDispatcher() { |
| 80 // We remove our hook for the resource dispatcher only when going away, since |
| 81 // it doesn't keep track of whether we've force terminated the request |
| 82 if (request_id_ >= 0) { |
| 83 // This operation may fail, as the dispatcher will have preemptively |
| 84 // removed us when the renderer sends the ReceivedAllData message. |
| 85 RemovePendingRequest(request_id_); |
| 86 |
| 87 if (request_->download_to_file) { |
| 88 message_sender_->Send( |
| 89 new ResourceHostMsg_ReleaseDownloadedFile(request_id_)); |
| 90 } |
| 91 } |
276 } | 92 } |
277 | 93 |
278 // ResourceDispatcher implementation ------------------------------------------ | |
279 | |
280 bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { | 94 bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { |
281 if (!IsResourceDispatcherMessage(message)) { | 95 if (!IsResourceDispatcherMessage(message)) { |
282 return false; | 96 return false; |
283 } | 97 } |
284 | 98 |
285 int request_id; | 99 int request_id; |
286 | 100 |
287 PickleIterator iter(message); | 101 PickleIterator iter(message); |
288 if (!message.ReadInt(&iter, &request_id)) { | 102 if (!message.ReadInt(&iter, &request_id)) { |
289 NOTREACHED() << "malformed resource message"; | 103 NOTREACHED() << "malformed resource message"; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 FollowPendingRedirect(request_id, request_info); | 422 FollowPendingRedirect(request_id, request_info); |
609 | 423 |
610 base::MessageLoop::current()->PostTask( | 424 base::MessageLoop::current()->PostTask( |
611 FROM_HERE, | 425 FROM_HERE, |
612 base::Bind(&ResourceDispatcher::FlushDeferredMessages, | 426 base::Bind(&ResourceDispatcher::FlushDeferredMessages, |
613 weak_factory_.GetWeakPtr(), | 427 weak_factory_.GetWeakPtr(), |
614 request_id)); | 428 request_id)); |
615 } | 429 } |
616 } | 430 } |
617 | 431 |
618 void ResourceDispatcher::DidChangePriority( | 432 void ResourceDispatcher::DidChangePriority(int routing_id, |
619 int routing_id, int request_id, net::RequestPriority new_priority, | 433 int request_id, |
620 int intra_priority_value) { | 434 net::RequestPriority new_priority, |
| 435 int intra_priority_value) { |
621 DCHECK(ContainsKey(pending_requests_, request_id)); | 436 DCHECK(ContainsKey(pending_requests_, request_id)); |
622 message_sender()->Send(new ResourceHostMsg_DidChangePriority( | 437 message_sender()->Send(new ResourceHostMsg_DidChangePriority( |
623 request_id, new_priority, intra_priority_value)); | 438 request_id, new_priority, intra_priority_value)); |
624 } | 439 } |
625 | 440 |
626 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo() | 441 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo() |
627 : peer(NULL), | 442 : peer(NULL), |
628 resource_type(ResourceType::SUB_RESOURCE), | 443 resource_type(ResourceType::SUB_RESOURCE), |
629 is_deferred(false), | 444 is_deferred(false), |
630 blocked_response(false), | 445 blocked_response(false), |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 if (index != pending_requests_.end()) { | 502 if (index != pending_requests_.end()) { |
688 PendingRequestInfo& pending_request = index->second; | 503 PendingRequestInfo& pending_request = index->second; |
689 if (pending_request.is_deferred) { | 504 if (pending_request.is_deferred) { |
690 pending_request.deferred_message_queue.swap(q); | 505 pending_request.deferred_message_queue.swap(q); |
691 return; | 506 return; |
692 } | 507 } |
693 } | 508 } |
694 } | 509 } |
695 } | 510 } |
696 | 511 |
697 ResourceLoaderBridge* ResourceDispatcher::CreateBridge( | 512 void ResourceDispatcher::CreateBridge(const RequestInfo& request_info) { |
698 const RequestInfo& request_info) { | 513 request_.reset(new ResourceHostMsg_Request); |
699 return new IPCResourceLoaderBridge(this, request_info); | 514 request_->method = request_info.method; |
| 515 request_->url = request_info.url; |
| 516 request_->first_party_for_cookies = request_info.first_party_for_cookies; |
| 517 request_->referrer = request_info.referrer; |
| 518 request_->referrer_policy = request_info.referrer_policy; |
| 519 request_->headers = request_info.headers; |
| 520 request_->load_flags = request_info.load_flags; |
| 521 request_->origin_pid = request_info.requestor_pid; |
| 522 request_->resource_type = request_info.request_type; |
| 523 request_->priority = request_info.priority; |
| 524 request_->request_context = request_info.request_context; |
| 525 request_->appcache_host_id = request_info.appcache_host_id; |
| 526 request_->download_to_file = request_info.download_to_file; |
| 527 request_->has_user_gesture = request_info.has_user_gesture; |
| 528 |
| 529 const RequestExtraData kEmptyData; |
| 530 const RequestExtraData* extra_data; |
| 531 if (request_info.extra_data) |
| 532 extra_data = static_cast<RequestExtraData*>(request_info.extra_data); |
| 533 else |
| 534 extra_data = &kEmptyData; |
| 535 request_->visiblity_state = extra_data->visibility_state(); |
| 536 request_->render_frame_id = extra_data->render_frame_id(); |
| 537 request_->is_main_frame = extra_data->is_main_frame(); |
| 538 request_->parent_is_main_frame = extra_data->parent_is_main_frame(); |
| 539 request_->parent_render_frame_id = extra_data->parent_render_frame_id(); |
| 540 request_->allow_download = extra_data->allow_download(); |
| 541 request_->transition_type = extra_data->transition_type(); |
| 542 request_->should_replace_current_entry = |
| 543 extra_data->should_replace_current_entry(); |
| 544 request_->transferred_request_child_id = |
| 545 extra_data->transferred_request_child_id(); |
| 546 request_->transferred_request_request_id = |
| 547 extra_data->transferred_request_request_id(); |
| 548 request_->service_worker_provider_id = |
| 549 extra_data->service_worker_provider_id(); |
| 550 frame_origin_ = extra_data->frame_origin(); |
| 551 } |
| 552 |
| 553 void ResourceDispatcher::SetRequestBody(ResourceRequestBody* request_body) { |
| 554 DCHECK(request_id_ == -1) << "request already started"; |
| 555 request_->request_body = request_body; |
| 556 } |
| 557 |
| 558 bool ResourceDispatcher::Start(RequestPeer* peer) { |
| 559 if (request_id_ != -1) { |
| 560 NOTREACHED() << "Starting a request twice"; |
| 561 return false; |
| 562 } |
| 563 |
| 564 peer_ = peer; |
| 565 |
| 566 // generate the request ID, and append it to the message |
| 567 request_id_ = AddPendingRequest(peer_, |
| 568 request_->resource_type, |
| 569 request_->origin_pid, |
| 570 frame_origin_, |
| 571 request_->url); |
| 572 |
| 573 return message_sender_->Send(new ResourceHostMsg_RequestResource( |
| 574 routing_id_, request_id_, *request_.get())); |
| 575 } |
| 576 |
| 577 void ResourceDispatcher::Cancel() { |
| 578 if (request_id_ < 0) { |
| 579 NOTREACHED() << "Trying to cancel an unstarted request"; |
| 580 return; |
| 581 } |
| 582 |
| 583 if (!is_synchronous_request_) |
| 584 CancelPendingRequest(request_id_); |
| 585 |
| 586 // We can't remove the request ID from the resource dispatcher because more |
| 587 // data might be pending. Sending the cancel message may cause more data |
| 588 // to be flushed, and will then cause a complete message to be sent. |
| 589 } |
| 590 |
| 591 void ResourceDispatcher::SetDefersLoading(bool value) { |
| 592 if (request_id_ < 0) { |
| 593 NOTREACHED() << "Trying to (un)defer an unstarted request"; |
| 594 return; |
| 595 } |
| 596 |
| 597 SetDefersLoading(request_id_, value); |
| 598 } |
| 599 |
| 600 void ResourceDispatcher::DidChangePriority(net::RequestPriority new_priority, |
| 601 int intra_priority_value) { |
| 602 if (request_id_ < 0) { |
| 603 NOTREACHED() << "Trying to change priority of an unstarted request"; |
| 604 return; |
| 605 } |
| 606 |
| 607 DidChangePriority( |
| 608 routing_id_, request_id_, new_priority, intra_priority_value); |
| 609 } |
| 610 |
| 611 void ResourceDispatcher::SyncLoad(SyncLoadResponse* response) { |
| 612 if (request_id_ != -1) { |
| 613 NOTREACHED() << "Starting a request twice"; |
| 614 response->error_code = net::ERR_FAILED; |
| 615 return; |
| 616 } |
| 617 |
| 618 request_id_ = MakeRequestID(); |
| 619 is_synchronous_request_ = true; |
| 620 |
| 621 SyncLoadResult result; |
| 622 IPC::SyncMessage* msg = new ResourceHostMsg_SyncLoad( |
| 623 routing_id_, request_id_, *request_.get(), &result); |
| 624 |
| 625 // NOTE: This may pump events (see RenderThread::Send). |
| 626 if (!message_sender_->Send(msg)) { |
| 627 response->error_code = net::ERR_FAILED; |
| 628 return; |
| 629 } |
| 630 |
| 631 response->error_code = result.error_code; |
| 632 response->url = result.final_url; |
| 633 response->headers = result.headers; |
| 634 response->mime_type = result.mime_type; |
| 635 response->charset = result.charset; |
| 636 response->request_time = result.request_time; |
| 637 response->response_time = result.response_time; |
| 638 response->encoded_data_length = result.encoded_data_length; |
| 639 response->load_timing = result.load_timing; |
| 640 response->devtools_info = result.devtools_info; |
| 641 response->data.swap(result.data); |
| 642 response->download_file_path = result.download_file_path; |
700 } | 643 } |
701 | 644 |
702 void ResourceDispatcher::ToResourceResponseInfo( | 645 void ResourceDispatcher::ToResourceResponseInfo( |
703 const PendingRequestInfo& request_info, | 646 const PendingRequestInfo& request_info, |
704 const ResourceResponseHead& browser_info, | 647 const ResourceResponseHead& browser_info, |
705 ResourceResponseInfo* renderer_info) const { | 648 ResourceResponseInfo* renderer_info) const { |
706 *renderer_info = browser_info; | 649 *renderer_info = browser_info; |
707 if (request_info.request_start.is_null() || | 650 if (request_info.request_start.is_null() || |
708 request_info.response_start.is_null() || | 651 request_info.response_start.is_null() || |
709 browser_info.request_start.is_null() || | 652 browser_info.request_start.is_null() || |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 748 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
806 while (!queue->empty()) { | 749 while (!queue->empty()) { |
807 IPC::Message* message = queue->front(); | 750 IPC::Message* message = queue->front(); |
808 ReleaseResourcesInDataMessage(*message); | 751 ReleaseResourcesInDataMessage(*message); |
809 queue->pop_front(); | 752 queue->pop_front(); |
810 delete message; | 753 delete message; |
811 } | 754 } |
812 } | 755 } |
813 | 756 |
814 } // namespace content | 757 } // namespace content |
OLD | NEW |