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" |
11 #include "base/command_line.h" | |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/debug/alias.h" | 13 #include "base/debug/alias.h" |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
15 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
16 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
17 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
18 #include "content/child/request_extra_data.h" | 19 #include "content/child/request_extra_data.h" |
20 #include "content/child/site_isolation_policy.h" | |
19 #include "content/common/inter_process_time_ticks_converter.h" | 21 #include "content/common/inter_process_time_ticks_converter.h" |
20 #include "content/common/resource_messages.h" | 22 #include "content/common/resource_messages.h" |
21 #include "content/public/child/resource_dispatcher_delegate.h" | 23 #include "content/public/child/resource_dispatcher_delegate.h" |
24 #include "content/public/common/content_switches.h" | |
22 #include "content/public/common/resource_response.h" | 25 #include "content/public/common/resource_response.h" |
23 #include "net/base/net_errors.h" | 26 #include "net/base/net_errors.h" |
24 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
25 #include "net/base/request_priority.h" | 28 #include "net/base/request_priority.h" |
26 #include "net/http/http_response_headers.h" | 29 #include "net/http/http_response_headers.h" |
27 #include "webkit/common/resource_type.h" | 30 #include "webkit/common/resource_type.h" |
28 | 31 |
29 using webkit_glue::ResourceLoaderBridge; | 32 using webkit_glue::ResourceLoaderBridge; |
30 using webkit_glue::ResourceRequestBody; | 33 using webkit_glue::ResourceRequestBody; |
31 using webkit_glue::ResourceResponseInfo; | 34 using webkit_glue::ResourceResponseInfo; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 // The request to send, created on initialization for modification and | 92 // The request to send, created on initialization for modification and |
90 // appending data. | 93 // appending data. |
91 ResourceHostMsg_Request request_; | 94 ResourceHostMsg_Request request_; |
92 | 95 |
93 // ID for the request, valid once Start()ed, -1 if not valid yet. | 96 // ID for the request, valid once Start()ed, -1 if not valid yet. |
94 int request_id_; | 97 int request_id_; |
95 | 98 |
96 // The routing id used when sending IPC messages. | 99 // The routing id used when sending IPC messages. |
97 int routing_id_; | 100 int routing_id_; |
98 | 101 |
102 // The security origin of the frame that initiates this request | |
Charlie Reis
2013/08/22 18:23:30
nit: End with period.
dsjang
2013/08/22 19:05:55
Done.
| |
103 GURL frame_origin_; | |
104 | |
99 bool is_synchronous_request_; | 105 bool is_synchronous_request_; |
100 }; | 106 }; |
101 | 107 |
102 IPCResourceLoaderBridge::IPCResourceLoaderBridge( | 108 IPCResourceLoaderBridge::IPCResourceLoaderBridge( |
103 ResourceDispatcher* dispatcher, | 109 ResourceDispatcher* dispatcher, |
104 const ResourceLoaderBridge::RequestInfo& request_info) | 110 const ResourceLoaderBridge::RequestInfo& request_info) |
105 : peer_(NULL), | 111 : peer_(NULL), |
106 dispatcher_(dispatcher), | 112 dispatcher_(dispatcher), |
107 request_id_(-1), | 113 request_id_(-1), |
108 routing_id_(request_info.routing_id), | 114 routing_id_(request_info.routing_id), |
(...skipping 19 matching lines...) Expand all Loading... | |
128 request_.is_main_frame = extra_data->is_main_frame(); | 134 request_.is_main_frame = extra_data->is_main_frame(); |
129 request_.frame_id = extra_data->frame_id(); | 135 request_.frame_id = extra_data->frame_id(); |
130 request_.parent_is_main_frame = extra_data->parent_is_main_frame(); | 136 request_.parent_is_main_frame = extra_data->parent_is_main_frame(); |
131 request_.parent_frame_id = extra_data->parent_frame_id(); | 137 request_.parent_frame_id = extra_data->parent_frame_id(); |
132 request_.allow_download = extra_data->allow_download(); | 138 request_.allow_download = extra_data->allow_download(); |
133 request_.transition_type = extra_data->transition_type(); | 139 request_.transition_type = extra_data->transition_type(); |
134 request_.transferred_request_child_id = | 140 request_.transferred_request_child_id = |
135 extra_data->transferred_request_child_id(); | 141 extra_data->transferred_request_child_id(); |
136 request_.transferred_request_request_id = | 142 request_.transferred_request_request_id = |
137 extra_data->transferred_request_request_id(); | 143 extra_data->transferred_request_request_id(); |
144 frame_origin_ = extra_data->frame_origin(); | |
138 } else { | 145 } else { |
139 request_.is_main_frame = false; | 146 request_.is_main_frame = false; |
140 request_.frame_id = -1; | 147 request_.frame_id = -1; |
141 request_.parent_is_main_frame = false; | 148 request_.parent_is_main_frame = false; |
142 request_.parent_frame_id = -1; | 149 request_.parent_frame_id = -1; |
143 request_.allow_download = true; | 150 request_.allow_download = true; |
144 request_.transition_type = PAGE_TRANSITION_LINK; | 151 request_.transition_type = PAGE_TRANSITION_LINK; |
145 request_.transferred_request_child_id = -1; | 152 request_.transferred_request_child_id = -1; |
146 request_.transferred_request_request_id = -1; | 153 request_.transferred_request_request_id = -1; |
147 } | 154 } |
(...skipping 24 matching lines...) Expand all Loading... | |
172 bool IPCResourceLoaderBridge::Start(Peer* peer) { | 179 bool IPCResourceLoaderBridge::Start(Peer* peer) { |
173 if (request_id_ != -1) { | 180 if (request_id_ != -1) { |
174 NOTREACHED() << "Starting a request twice"; | 181 NOTREACHED() << "Starting a request twice"; |
175 return false; | 182 return false; |
176 } | 183 } |
177 | 184 |
178 peer_ = peer; | 185 peer_ = peer; |
179 | 186 |
180 // generate the request ID, and append it to the message | 187 // generate the request ID, and append it to the message |
181 request_id_ = dispatcher_->AddPendingRequest( | 188 request_id_ = dispatcher_->AddPendingRequest( |
182 peer_, request_.resource_type, request_.url); | 189 peer_, request_.resource_type, frame_origin_, request_.url); |
183 | 190 |
184 return dispatcher_->message_sender()->Send( | 191 return dispatcher_->message_sender()->Send( |
185 new ResourceHostMsg_RequestResource(routing_id_, request_id_, request_)); | 192 new ResourceHostMsg_RequestResource(routing_id_, request_id_, request_)); |
186 } | 193 } |
187 | 194 |
188 void IPCResourceLoaderBridge::Cancel() { | 195 void IPCResourceLoaderBridge::Cancel() { |
189 if (request_id_ < 0) { | 196 if (request_id_ < 0) { |
190 NOTREACHED() << "Trying to cancel an unstarted request"; | 197 NOTREACHED() << "Trying to cancel an unstarted request"; |
191 return; | 198 return; |
192 } | 199 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
339 if (delegate_) { | 346 if (delegate_) { |
340 ResourceLoaderBridge::Peer* new_peer = | 347 ResourceLoaderBridge::Peer* new_peer = |
341 delegate_->OnReceivedResponse( | 348 delegate_->OnReceivedResponse( |
342 request_info->peer, response_head.mime_type, request_info->url); | 349 request_info->peer, response_head.mime_type, request_info->url); |
343 if (new_peer) | 350 if (new_peer) |
344 request_info->peer = new_peer; | 351 request_info->peer = new_peer; |
345 } | 352 } |
346 | 353 |
347 ResourceResponseInfo renderer_response_info; | 354 ResourceResponseInfo renderer_response_info; |
348 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); | 355 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); |
356 SiteIsolationPolicy::OnReceivedResponse(request_id, | |
357 request_info->frame_origin, | |
358 request_info->response_url, | |
359 request_info->resource_type, | |
360 renderer_response_info); | |
349 request_info->peer->OnReceivedResponse(renderer_response_info); | 361 request_info->peer->OnReceivedResponse(renderer_response_info); |
350 } | 362 } |
351 | 363 |
352 void ResourceDispatcher::OnReceivedCachedMetadata( | 364 void ResourceDispatcher::OnReceivedCachedMetadata( |
353 int request_id, const std::vector<char>& data) { | 365 int request_id, const std::vector<char>& data) { |
354 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 366 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
355 if (!request_info) | 367 if (!request_info) |
356 return; | 368 return; |
357 | 369 |
358 if (data.size()) | 370 if (data.size()) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 // It is possible for CancelPendingRequest() to be called before we exit | 416 // It is possible for CancelPendingRequest() to be called before we exit |
405 // this scope. | 417 // this scope. |
406 linked_ptr<base::SharedMemory> retain_buffer(request_info->buffer); | 418 linked_ptr<base::SharedMemory> retain_buffer(request_info->buffer); |
407 | 419 |
408 base::TimeTicks time_start = base::TimeTicks::Now(); | 420 base::TimeTicks time_start = base::TimeTicks::Now(); |
409 | 421 |
410 const char* data_ptr = static_cast<char*>(request_info->buffer->memory()); | 422 const char* data_ptr = static_cast<char*>(request_info->buffer->memory()); |
411 CHECK(data_ptr); | 423 CHECK(data_ptr); |
412 CHECK(data_ptr + data_offset); | 424 CHECK(data_ptr + data_offset); |
413 | 425 |
414 request_info->peer->OnReceivedData( | 426 // Check whether this response data is compliant with our cross-site |
415 data_ptr + data_offset, | 427 // document blocking policy. |
416 data_length, | 428 bool ok_response = SiteIsolationPolicy::OnReceivedData( |
Charlie Reis
2013/08/22 18:23:30
This name doesn't describe what the function is do
dsjang
2013/08/22 19:05:55
Done.
| |
417 encoded_data_length); | 429 request_id, data_ptr + data_offset, data_length); |
430 | |
431 // We block a response when the command line switch is on. | |
432 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
433 if (!ok_response && | |
434 command_line.HasSwitch(switches::kCrossSiteDocumentBlocking)) { | |
435 // if data_offset is not-zero, this is not the first data packet for | |
Charlie Reis
2013/08/22 18:23:30
Nit: capitalize sentence.
dsjang
2013/08/22 19:05:55
Done.
| |
436 // this request. We just ignore it. | |
437 if (data_offset == 0) { | |
438 // If we decide to block the response data, we just return an empty | |
439 // one-character string as response data : this is needed to trigger | |
Charlie Reis
2013/08/22 18:23:30
nit: Remove the colon and just have two sentences.
dsjang
2013/08/22 19:05:55
Done.
| |
440 // parsing errors in image decoders, etc. | |
441 LOG(ERROR) << request_info->response_url | |
442 << " is blocked as an illegal cross-site document from " | |
443 << request_info->frame_origin; | |
444 const char* empty_data_ptr = " "; | |
445 request_info->peer->OnReceivedData(empty_data_ptr, 1, 1); | |
446 } | |
447 } else { | |
448 request_info->peer->OnReceivedData( | |
449 data_ptr + data_offset, | |
450 data_length, | |
451 encoded_data_length); | |
452 } | |
418 | 453 |
419 UMA_HISTOGRAM_TIMES("ResourceDispatcher.OnReceivedDataTime", | 454 UMA_HISTOGRAM_TIMES("ResourceDispatcher.OnReceivedDataTime", |
420 base::TimeTicks::Now() - time_start); | 455 base::TimeTicks::Now() - time_start); |
421 } | 456 } |
422 | 457 |
423 // Acknowledge the reception of this data. | 458 // Acknowledge the reception of this data. |
424 message_sender()->Send( | 459 message_sender()->Send( |
425 new ResourceHostMsg_DataReceived_ACK(message.routing_id(), request_id)); | 460 new ResourceHostMsg_DataReceived_ACK(message.routing_id(), request_id)); |
426 } | 461 } |
427 | 462 |
(...skipping 27 matching lines...) Expand all Loading... | |
455 ResourceResponseInfo renderer_response_info; | 490 ResourceResponseInfo renderer_response_info; |
456 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); | 491 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); |
457 if (request_info->peer->OnReceivedRedirect(new_url, renderer_response_info, | 492 if (request_info->peer->OnReceivedRedirect(new_url, renderer_response_info, |
458 &has_new_first_party_for_cookies, | 493 &has_new_first_party_for_cookies, |
459 &new_first_party_for_cookies)) { | 494 &new_first_party_for_cookies)) { |
460 // Double-check if the request is still around. The call above could | 495 // Double-check if the request is still around. The call above could |
461 // potentially remove it. | 496 // potentially remove it. |
462 request_info = GetPendingRequestInfo(request_id); | 497 request_info = GetPendingRequestInfo(request_id); |
463 if (!request_info) | 498 if (!request_info) |
464 return; | 499 return; |
500 // We update the response_url here so that we can sent it to | |
Charlie Reis
2013/08/22 18:23:30
nit: sent -> send
dsjang
2013/08/22 19:05:55
Done.
| |
501 // SiteIsolationPolicy later when OnReceivedResponse is called. | |
502 request_info->response_url = new_url; | |
465 request_info->pending_redirect_message.reset( | 503 request_info->pending_redirect_message.reset( |
466 new ResourceHostMsg_FollowRedirect(routing_id, request_id, | 504 new ResourceHostMsg_FollowRedirect(routing_id, request_id, |
467 has_new_first_party_for_cookies, | 505 has_new_first_party_for_cookies, |
468 new_first_party_for_cookies)); | 506 new_first_party_for_cookies)); |
469 if (!request_info->is_deferred) { | 507 if (!request_info->is_deferred) { |
470 FollowPendingRedirect(request_id, *request_info); | 508 FollowPendingRedirect(request_id, *request_info); |
471 } | 509 } |
472 } else { | 510 } else { |
473 CancelPendingRequest(routing_id, request_id); | 511 CancelPendingRequest(routing_id, request_id); |
474 } | 512 } |
475 } | 513 } |
476 | 514 |
477 void ResourceDispatcher::FollowPendingRedirect( | 515 void ResourceDispatcher::FollowPendingRedirect( |
478 int request_id, | 516 int request_id, |
479 PendingRequestInfo& request_info) { | 517 PendingRequestInfo& request_info) { |
480 IPC::Message* msg = request_info.pending_redirect_message.release(); | 518 IPC::Message* msg = request_info.pending_redirect_message.release(); |
481 if (msg) | 519 if (msg) |
482 message_sender()->Send(msg); | 520 message_sender()->Send(msg); |
483 } | 521 } |
484 | 522 |
485 void ResourceDispatcher::OnRequestComplete( | 523 void ResourceDispatcher::OnRequestComplete( |
486 int request_id, | 524 int request_id, |
487 int error_code, | 525 int error_code, |
488 bool was_ignored_by_handler, | 526 bool was_ignored_by_handler, |
489 const std::string& security_info, | 527 const std::string& security_info, |
490 const base::TimeTicks& browser_completion_time) { | 528 const base::TimeTicks& browser_completion_time) { |
529 // TODO(dsjang): This logging code is just temporary. There has to | |
530 // be a better way to connect the received data to the response_url | |
Charlie Reis
2013/08/22 18:23:30
I don't understand this comment.
1) Are you planni
dsjang
2013/08/22 19:05:55
With the blocking logic, everything about SiteIsol
| |
531 // than this. | |
532 SiteIsolationPolicy::OnRequestComplete(request_id); | |
533 | |
491 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 534 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
492 if (!request_info) | 535 if (!request_info) |
493 return; | 536 return; |
494 request_info->completion_time = ConsumeIOTimestamp(); | 537 request_info->completion_time = ConsumeIOTimestamp(); |
495 request_info->buffer.reset(); | 538 request_info->buffer.reset(); |
496 request_info->buffer_size = 0; | 539 request_info->buffer_size = 0; |
497 | 540 |
498 ResourceLoaderBridge::Peer* peer = request_info->peer; | 541 ResourceLoaderBridge::Peer* peer = request_info->peer; |
499 | 542 |
500 if (delegate_) { | 543 if (delegate_) { |
501 ResourceLoaderBridge::Peer* new_peer = | 544 ResourceLoaderBridge::Peer* new_peer = |
502 delegate_->OnRequestComplete( | 545 delegate_->OnRequestComplete( |
503 request_info->peer, request_info->resource_type, error_code); | 546 request_info->peer, request_info->resource_type, error_code); |
504 if (new_peer) | 547 if (new_peer) |
505 request_info->peer = new_peer; | 548 request_info->peer = new_peer; |
506 } | 549 } |
507 | 550 |
508 base::TimeTicks renderer_completion_time = ToRendererCompletionTime( | 551 base::TimeTicks renderer_completion_time = ToRendererCompletionTime( |
509 *request_info, browser_completion_time); | 552 *request_info, browser_completion_time); |
553 | |
Charlie Reis
2013/08/22 18:23:30
nit: Don't add extra line.
dsjang
2013/08/22 19:05:55
Done.
| |
510 // The request ID will be removed from our pending list in the destructor. | 554 // The request ID will be removed from our pending list in the destructor. |
511 // Normally, dispatching this message causes the reference-counted request to | 555 // Normally, dispatching this message causes the reference-counted request to |
512 // die immediately. | 556 // die immediately. |
513 peer->OnCompletedRequest(error_code, was_ignored_by_handler, security_info, | 557 peer->OnCompletedRequest(error_code, was_ignored_by_handler, security_info, |
514 renderer_completion_time); | 558 renderer_completion_time); |
515 } | 559 } |
516 | 560 |
517 int ResourceDispatcher::AddPendingRequest( | 561 int ResourceDispatcher::AddPendingRequest( |
518 ResourceLoaderBridge::Peer* callback, | 562 ResourceLoaderBridge::Peer* callback, |
519 ResourceType::Type resource_type, | 563 ResourceType::Type resource_type, |
564 const GURL& frame_origin, | |
520 const GURL& request_url) { | 565 const GURL& request_url) { |
521 // Compute a unique request_id for this renderer process. | 566 // Compute a unique request_id for this renderer process. |
522 int id = MakeRequestID(); | 567 int id = MakeRequestID(); |
523 pending_requests_[id] = | 568 pending_requests_[id] = |
524 PendingRequestInfo(callback, resource_type, request_url); | 569 PendingRequestInfo(callback, resource_type, frame_origin, request_url); |
525 return id; | 570 return id; |
526 } | 571 } |
527 | 572 |
528 bool ResourceDispatcher::RemovePendingRequest(int request_id) { | 573 bool ResourceDispatcher::RemovePendingRequest(int request_id) { |
529 PendingRequestList::iterator it = pending_requests_.find(request_id); | 574 PendingRequestList::iterator it = pending_requests_.find(request_id); |
530 if (it == pending_requests_.end()) | 575 if (it == pending_requests_.end()) |
531 return false; | 576 return false; |
532 | 577 |
578 SiteIsolationPolicy::OnRequestComplete(request_id); | |
533 PendingRequestInfo& request_info = it->second; | 579 PendingRequestInfo& request_info = it->second; |
534 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue); | 580 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue); |
535 pending_requests_.erase(it); | 581 pending_requests_.erase(it); |
536 | 582 |
537 return true; | 583 return true; |
538 } | 584 } |
539 | 585 |
540 void ResourceDispatcher::CancelPendingRequest(int routing_id, | 586 void ResourceDispatcher::CancelPendingRequest(int routing_id, |
541 int request_id) { | 587 int request_id) { |
542 PendingRequestList::iterator it = pending_requests_.find(request_id); | 588 PendingRequestList::iterator it = pending_requests_.find(request_id); |
543 if (it == pending_requests_.end()) { | 589 if (it == pending_requests_.end()) { |
544 DVLOG(1) << "unknown request"; | 590 DVLOG(1) << "unknown request"; |
545 return; | 591 return; |
546 } | 592 } |
547 | 593 |
594 SiteIsolationPolicy::OnRequestComplete(request_id); | |
548 PendingRequestInfo& request_info = it->second; | 595 PendingRequestInfo& request_info = it->second; |
549 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue); | 596 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue); |
550 pending_requests_.erase(it); | 597 pending_requests_.erase(it); |
551 | 598 |
552 message_sender()->Send( | 599 message_sender()->Send( |
553 new ResourceHostMsg_CancelRequest(routing_id, request_id)); | 600 new ResourceHostMsg_CancelRequest(routing_id, request_id)); |
554 } | 601 } |
555 | 602 |
556 void ResourceDispatcher::SetDefersLoading(int request_id, bool value) { | 603 void ResourceDispatcher::SetDefersLoading(int request_id, bool value) { |
557 PendingRequestList::iterator it = pending_requests_.find(request_id); | 604 PendingRequestList::iterator it = pending_requests_.find(request_id); |
(...skipping 27 matching lines...) Expand all Loading... | |
585 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo() | 632 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo() |
586 : peer(NULL), | 633 : peer(NULL), |
587 resource_type(ResourceType::SUB_RESOURCE), | 634 resource_type(ResourceType::SUB_RESOURCE), |
588 is_deferred(false), | 635 is_deferred(false), |
589 buffer_size(0) { | 636 buffer_size(0) { |
590 } | 637 } |
591 | 638 |
592 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo( | 639 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo( |
593 webkit_glue::ResourceLoaderBridge::Peer* peer, | 640 webkit_glue::ResourceLoaderBridge::Peer* peer, |
594 ResourceType::Type resource_type, | 641 ResourceType::Type resource_type, |
642 const GURL& frame_origin, | |
595 const GURL& request_url) | 643 const GURL& request_url) |
596 : peer(peer), | 644 : peer(peer), |
597 resource_type(resource_type), | 645 resource_type(resource_type), |
598 is_deferred(false), | 646 is_deferred(false), |
599 url(request_url), | 647 url(request_url), |
648 frame_origin(frame_origin), | |
649 response_url(request_url), | |
600 request_start(base::TimeTicks::Now()) { | 650 request_start(base::TimeTicks::Now()) { |
601 } | 651 } |
602 | 652 |
603 ResourceDispatcher::PendingRequestInfo::~PendingRequestInfo() {} | 653 ResourceDispatcher::PendingRequestInfo::~PendingRequestInfo() {} |
604 | 654 |
605 void ResourceDispatcher::DispatchMessage(const IPC::Message& message) { | 655 void ResourceDispatcher::DispatchMessage(const IPC::Message& message) { |
606 IPC_BEGIN_MESSAGE_MAP(ResourceDispatcher, message) | 656 IPC_BEGIN_MESSAGE_MAP(ResourceDispatcher, message) |
607 IPC_MESSAGE_HANDLER(ResourceMsg_UploadProgress, OnUploadProgress) | 657 IPC_MESSAGE_HANDLER(ResourceMsg_UploadProgress, OnUploadProgress) |
608 IPC_MESSAGE_HANDLER(ResourceMsg_ReceivedResponse, OnReceivedResponse) | 658 IPC_MESSAGE_HANDLER(ResourceMsg_ReceivedResponse, OnReceivedResponse) |
609 IPC_MESSAGE_HANDLER(ResourceMsg_ReceivedCachedMetadata, | 659 IPC_MESSAGE_HANDLER(ResourceMsg_ReceivedCachedMetadata, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
758 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 808 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
759 while (!queue->empty()) { | 809 while (!queue->empty()) { |
760 IPC::Message* message = queue->front(); | 810 IPC::Message* message = queue->front(); |
761 ReleaseResourcesInDataMessage(*message); | 811 ReleaseResourcesInDataMessage(*message); |
762 queue->pop_front(); | 812 queue->pop_front(); |
763 delete message; | 813 delete message; |
764 } | 814 } |
765 } | 815 } |
766 | 816 |
767 } // namespace content | 817 } // namespace content |
OLD | NEW |