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

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

Issue 1334593002: Reland #2 "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: Rebase and type error. 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 | « content/browser/browser_main_loop.cc ('k') | content/child/child_thread_impl.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
332 filter->Send(new ResourceMsg_DataReceived( 337 filter->Send(new ResourceMsg_DataReceived(
333 GetRequestID(), data_offset, bytes_read, encoded_data_length)); 338 GetRequestID(), data_offset, bytes_read, encoded_data_length));
334 ++pending_data_count_; 339 ++pending_data_count_;
335 340
336 if (!buffer_->CanAllocate()) { 341 if (!buffer_->CanAllocate()) {
337 *defer = did_defer_ = true; 342 *defer = did_defer_ = true;
338 OnDefer(); 343 OnDefer();
339 } 344 }
340 345
341 return true; 346 return true;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 request()->LogUnblocked(); 435 request()->LogUnblocked();
431 controller()->Resume(); 436 controller()->Resume();
432 } 437 }
433 } 438 }
434 439
435 void AsyncResourceHandler::OnDefer() { 440 void AsyncResourceHandler::OnDefer() {
436 request()->LogBlockedBy("AsyncResourceHandler"); 441 request()->LogBlockedBy("AsyncResourceHandler");
437 } 442 }
438 443
439 } // namespace content 444 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698