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

Side by Side Diff: content/browser/loader/async_resource_handler.cc

Issue 1314803005: Revert of Reland #1 "ipc: Add a new field num_brokered_attachments to the message header." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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 | content/child/resource_dispatcher.cc » ('j') | 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 #include "content/browser/loader/async_resource_handler.h" 5 #include "content/browser/loader/async_resource_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 GetRequestID(), handle, size, filter->peer_pid())); 322 GetRequestID(), handle, size, filter->peer_pid()));
323 sent_first_data_msg_ = true; 323 sent_first_data_msg_ = true;
324 } 324 }
325 325
326 int data_offset = buffer_->GetLastAllocationOffset(); 326 int data_offset = buffer_->GetLastAllocationOffset();
327 327
328 int64_t current_transfer_size = request()->GetTotalReceivedBytes(); 328 int64_t current_transfer_size = request()->GetTotalReceivedBytes();
329 int encoded_data_length = current_transfer_size - reported_transfer_size_; 329 int encoded_data_length = current_transfer_size - reported_transfer_size_;
330 reported_transfer_size_ = current_transfer_size; 330 reported_transfer_size_ = current_transfer_size;
331 331
332 // TODO(erikchen): Remove me after finished debugging for
333 // http://crbug.com/527588.
334 // The data offset can't exceed the size of the buffer.
335 CHECK_LE(data_offset, kBufferSize);
336
337 filter->Send(new ResourceMsg_DataReceived( 332 filter->Send(new ResourceMsg_DataReceived(
338 GetRequestID(), data_offset, bytes_read, encoded_data_length)); 333 GetRequestID(), data_offset, bytes_read, encoded_data_length));
339 ++pending_data_count_; 334 ++pending_data_count_;
340 335
341 if (!buffer_->CanAllocate()) { 336 if (!buffer_->CanAllocate()) {
342 *defer = did_defer_ = true; 337 *defer = did_defer_ = true;
343 OnDefer(); 338 OnDefer();
344 } 339 }
345 340
346 return true; 341 return true;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 request()->LogUnblocked(); 430 request()->LogUnblocked();
436 controller()->Resume(); 431 controller()->Resume();
437 } 432 }
438 } 433 }
439 434
440 void AsyncResourceHandler::OnDefer() { 435 void AsyncResourceHandler::OnDefer() {
441 request()->LogBlockedBy("AsyncResourceHandler"); 436 request()->LogBlockedBy("AsyncResourceHandler");
442 } 437 }
443 438
444 } // namespace content 439 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698