| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); | 182 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); |
| 183 request_info->site_isolation_metadata = | 183 request_info->site_isolation_metadata = |
| 184 SiteIsolationStatsGatherer::OnReceivedResponse( | 184 SiteIsolationStatsGatherer::OnReceivedResponse( |
| 185 request_info->frame_origin, request_info->response_url, | 185 request_info->frame_origin, request_info->response_url, |
| 186 request_info->resource_type, request_info->origin_pid, | 186 request_info->resource_type, request_info->origin_pid, |
| 187 renderer_response_info); | 187 renderer_response_info); |
| 188 request_info->peer->OnReceivedResponse(renderer_response_info); | 188 request_info->peer->OnReceivedResponse(renderer_response_info); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void ResourceDispatcher::OnReceivedCachedMetadata( | 191 void ResourceDispatcher::OnReceivedCachedMetadata( |
| 192 int request_id, const std::vector<char>& data) { | 192 int request_id, |
| 193 const std::vector<uint8_t>& data) { |
| 193 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 194 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
| 194 if (!request_info) | 195 if (!request_info) |
| 195 return; | 196 return; |
| 196 | 197 |
| 197 if (data.size()) | 198 if (data.size()) { |
| 198 request_info->peer->OnReceivedCachedMetadata(&data.front(), data.size()); | 199 request_info->peer->OnReceivedCachedMetadata( |
| 200 reinterpret_cast<const char*>(&data.front()), data.size()); |
| 201 } |
| 199 } | 202 } |
| 200 | 203 |
| 201 void ResourceDispatcher::OnSetDataBuffer(int request_id, | 204 void ResourceDispatcher::OnSetDataBuffer(int request_id, |
| 202 base::SharedMemoryHandle shm_handle, | 205 base::SharedMemoryHandle shm_handle, |
| 203 int shm_size, | 206 int shm_size, |
| 204 base::ProcessId renderer_pid) { | 207 base::ProcessId renderer_pid) { |
| 205 TRACE_EVENT0("loader", "ResourceDispatcher::OnSetDataBuffer"); | 208 TRACE_EVENT0("loader", "ResourceDispatcher::OnSetDataBuffer"); |
| 206 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 209 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
| 207 if (!request_info) | 210 if (!request_info) |
| 208 return; | 211 return; |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 delete message; | 837 delete message; |
| 835 } | 838 } |
| 836 } | 839 } |
| 837 | 840 |
| 838 void ResourceDispatcher::SetResourceSchedulingFilter( | 841 void ResourceDispatcher::SetResourceSchedulingFilter( |
| 839 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 842 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
| 840 resource_scheduling_filter_ = resource_scheduling_filter; | 843 resource_scheduling_filter_ = resource_scheduling_filter; |
| 841 } | 844 } |
| 842 | 845 |
| 843 } // namespace content | 846 } // namespace content |
| OLD | NEW |