Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: content/child/resource_dispatcher.cc

Issue 1512973003: content: Mild change in flavor of debugging for ResourceMsg_DataReceived. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (request_info && data_length > 0) { 238 if (request_info && data_length > 0) {
239 CHECK(base::SharedMemory::IsHandleValid(request_info->buffer->handle())); 239 CHECK(base::SharedMemory::IsHandleValid(request_info->buffer->handle()));
240 CHECK_GE(request_info->buffer_size, data_offset + data_length); 240 CHECK_GE(request_info->buffer_size, data_offset + data_length);
241 241
242 // TODO(erikchen): Temporary debugging. http://crbug.com/527588. 242 // TODO(erikchen): Temporary debugging. http://crbug.com/527588.
243 CHECK_GE(request_info->buffer_size, 0); 243 CHECK_GE(request_info->buffer_size, 0);
244 CHECK_LE(request_info->buffer_size, 512 * 1024); 244 CHECK_LE(request_info->buffer_size, 512 * 1024);
245 CHECK_GE(data_length, 0); 245 CHECK_GE(data_length, 0);
246 CHECK_LE(data_length, 512 * 1024); 246 CHECK_LE(data_length, 512 * 1024);
247 247
248 int cached_data_offset = request_info->data_offset; 248 if (data_offset > 512 * 1024) {
249 CHECK_EQ(cached_data_offset, data_offset); 249 int cached_data_offset = request_info->data_offset;
250 base::debug::Alias(&cached_data_offset);
251 CHECK(false);
252 }
250 253
251 // Ensure that the SHM buffer remains valid for the duration of this scope. 254 // Ensure that the SHM buffer remains valid for the duration of this scope.
252 // It is possible for Cancel() to be called before we exit this scope. 255 // It is possible for Cancel() to be called before we exit this scope.
253 // SharedMemoryReceivedDataFactory stores the SHM buffer inside it. 256 // SharedMemoryReceivedDataFactory stores the SHM buffer inside it.
254 scoped_refptr<SharedMemoryReceivedDataFactory> factory( 257 scoped_refptr<SharedMemoryReceivedDataFactory> factory(
255 request_info->received_data_factory); 258 request_info->received_data_factory);
256 259
257 base::TimeTicks time_start = base::TimeTicks::Now(); 260 base::TimeTicks time_start = base::TimeTicks::Now();
258 261
259 const char* data_start = static_cast<char*>(request_info->buffer->memory()); 262 const char* data_start = static_cast<char*>(request_info->buffer->memory());
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 *frame_origin = extra_data->frame_origin(); 837 *frame_origin = extra_data->frame_origin();
835 return request.Pass(); 838 return request.Pass();
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698