| 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/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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 } | 581 } |
| 582 | 582 |
| 583 void ResourceDispatcher::ToResourceResponseInfo( | 583 void ResourceDispatcher::ToResourceResponseInfo( |
| 584 const PendingRequestInfo& request_info, | 584 const PendingRequestInfo& request_info, |
| 585 const ResourceResponseHead& browser_info, | 585 const ResourceResponseHead& browser_info, |
| 586 ResourceResponseInfo* renderer_info) const { | 586 ResourceResponseInfo* renderer_info) const { |
| 587 *renderer_info = browser_info; | 587 *renderer_info = browser_info; |
| 588 if (request_info.request_start.is_null() || | 588 if (request_info.request_start.is_null() || |
| 589 request_info.response_start.is_null() || | 589 request_info.response_start.is_null() || |
| 590 browser_info.request_start.is_null() || | 590 browser_info.request_start.is_null() || |
| 591 browser_info.response_start.is_null()) { | 591 browser_info.response_start.is_null() || |
| 592 browser_info.load_timing.base_ticks.is_null()) { |
| 592 return; | 593 return; |
| 593 } | 594 } |
| 594 InterProcessTimeTicksConverter converter( | 595 InterProcessTimeTicksConverter converter( |
| 595 LocalTimeTicks::FromTimeTicks(request_info.request_start), | 596 LocalTimeTicks::FromTimeTicks(request_info.request_start), |
| 596 LocalTimeTicks::FromTimeTicks(request_info.response_start), | 597 LocalTimeTicks::FromTimeTicks(request_info.response_start), |
| 597 RemoteTimeTicks::FromTimeTicks(browser_info.request_start), | 598 RemoteTimeTicks::FromTimeTicks(browser_info.request_start), |
| 598 RemoteTimeTicks::FromTimeTicks(browser_info.response_start)); | 599 RemoteTimeTicks::FromTimeTicks(browser_info.response_start)); |
| 599 | 600 |
| 600 LocalTimeTicks renderer_base_ticks = converter.ToLocalTimeTicks( | 601 LocalTimeTicks renderer_base_ticks = converter.ToLocalTimeTicks( |
| 601 RemoteTimeTicks::FromTimeTicks(browser_info.load_timing.base_ticks)); | 602 RemoteTimeTicks::FromTimeTicks(browser_info.load_timing.base_ticks)); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 685 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
| 685 while (!queue->empty()) { | 686 while (!queue->empty()) { |
| 686 IPC::Message* message = queue->front(); | 687 IPC::Message* message = queue->front(); |
| 687 ReleaseResourcesInDataMessage(*message); | 688 ReleaseResourcesInDataMessage(*message); |
| 688 queue->pop_front(); | 689 queue->pop_front(); |
| 689 delete message; | 690 delete message; |
| 690 } | 691 } |
| 691 } | 692 } |
| 692 | 693 |
| 693 } // namespace content | 694 } // namespace content |
| OLD | NEW |