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 #include "content/browser/loader/buffered_resource_handler.h" | 5 #include "content/browser/loader/buffered_resource_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
379 DCHECK(!defer_ignored); | 379 DCHECK(!defer_ignored); |
380 if (payload_for_old_handler.empty()) { | 380 if (payload_for_old_handler.empty()) { |
381 net::URLRequestStatus status(net::URLRequestStatus::CANCELED, | 381 net::URLRequestStatus status(net::URLRequestStatus::CANCELED, |
382 net::ERR_ABORTED); | 382 net::ERR_ABORTED); |
383 next_handler_->OnResponseCompleted(status, std::string(), &defer_ignored); | 383 next_handler_->OnResponseCompleted(status, std::string(), &defer_ignored); |
384 DCHECK(!defer_ignored); | 384 DCHECK(!defer_ignored); |
385 } else { | 385 } else { |
386 scoped_refptr<net::IOBuffer> buf; | 386 scoped_refptr<net::IOBuffer> buf; |
387 int size = 0; | 387 int size = 0; |
388 | 388 |
389 next_handler_->OnWillRead(&buf, &size, payload_for_old_handler.length()); | 389 next_handler_->OnWillRead(&buf, &size, -1); |
mmenke
2014/06/19 15:08:42
Why this change?
Zachary Kuznia
2014/06/19 18:02:24
This always ends up forwarding to AsyncResourceHan
mmenke
2014/06/19 19:36:26
Ahh...right. Ugly, but we're really bad about how
| |
390 CHECK_GE(size, static_cast<int>(payload_for_old_handler.length())); | 390 CHECK_GE(size, static_cast<int>(payload_for_old_handler.length())); |
391 | 391 |
392 memcpy(buf->data(), payload_for_old_handler.c_str(), | 392 memcpy(buf->data(), payload_for_old_handler.c_str(), |
393 payload_for_old_handler.length()); | 393 payload_for_old_handler.length()); |
394 | 394 |
395 next_handler_->OnReadCompleted(payload_for_old_handler.length(), | 395 next_handler_->OnReadCompleted(payload_for_old_handler.length(), |
396 &defer_ignored); | 396 &defer_ignored); |
397 DCHECK(!defer_ignored); | 397 DCHECK(!defer_ignored); |
398 | 398 |
399 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); | 399 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 request()->LogUnblocked(); | 491 request()->LogUnblocked(); |
492 bool defer = false; | 492 bool defer = false; |
493 if (!ProcessResponse(&defer)) { | 493 if (!ProcessResponse(&defer)) { |
494 controller()->Cancel(); | 494 controller()->Cancel(); |
495 } else if (!defer) { | 495 } else if (!defer) { |
496 controller()->Resume(); | 496 controller()->Resume(); |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 } // namespace content | 500 } // namespace content |
OLD | NEW |