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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 void ResourceDispatcher::OnReceivedData(int request_id, | 215 void ResourceDispatcher::OnReceivedData(int request_id, |
216 int data_offset, | 216 int data_offset, |
217 int data_length, | 217 int data_length, |
218 int encoded_data_length) { | 218 int encoded_data_length) { |
219 TRACE_EVENT0("loader", "ResourceDispatcher::OnReceivedData"); | 219 TRACE_EVENT0("loader", "ResourceDispatcher::OnReceivedData"); |
220 DCHECK_GT(data_length, 0); | 220 DCHECK_GT(data_length, 0); |
221 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 221 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
222 bool send_ack = true; | 222 bool send_ack = true; |
223 if (request_info && data_length > 0) { | 223 if (request_info && data_length > 0) { |
| 224 // TODO(erikchen): Temporary code to help track http://crbug.com/527588. |
| 225 base::debug::Alias(request_info); |
| 226 int buffer_size = request_info->buffer_size; |
| 227 base::debug::Alias(&buffer_size); |
| 228 |
224 CHECK(base::SharedMemory::IsHandleValid(request_info->buffer->handle())); | 229 CHECK(base::SharedMemory::IsHandleValid(request_info->buffer->handle())); |
225 CHECK_GE(request_info->buffer_size, data_offset + data_length); | 230 CHECK_GE(request_info->buffer_size, data_offset + data_length); |
226 | 231 |
227 // Ensure that the SHM buffer remains valid for the duration of this scope. | 232 // Ensure that the SHM buffer remains valid for the duration of this scope. |
228 // It is possible for Cancel() to be called before we exit this scope. | 233 // It is possible for Cancel() to be called before we exit this scope. |
229 // SharedMemoryReceivedDataFactory stores the SHM buffer inside it. | 234 // SharedMemoryReceivedDataFactory stores the SHM buffer inside it. |
230 scoped_refptr<SharedMemoryReceivedDataFactory> factory( | 235 scoped_refptr<SharedMemoryReceivedDataFactory> factory( |
231 request_info->received_data_factory); | 236 request_info->received_data_factory); |
232 | 237 |
233 base::TimeTicks time_start = base::TimeTicks::Now(); | 238 base::TimeTicks time_start = base::TimeTicks::Now(); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 extra_data->transferred_request_request_id(); | 795 extra_data->transferred_request_request_id(); |
791 request->service_worker_provider_id = | 796 request->service_worker_provider_id = |
792 extra_data->service_worker_provider_id(); | 797 extra_data->service_worker_provider_id(); |
793 request->request_body = request_body; | 798 request->request_body = request_body; |
794 if (frame_origin) | 799 if (frame_origin) |
795 *frame_origin = extra_data->frame_origin(); | 800 *frame_origin = extra_data->frame_origin(); |
796 return request.Pass(); | 801 return request.Pass(); |
797 } | 802 } |
798 | 803 |
799 } // namespace content | 804 } // namespace content |
OLD | NEW |