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

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

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // with a status() != SUCCESS and an error_code() == net::OK. 344 // with a status() != SUCCESS and an error_code() == net::OK.
345 if (status.status() == net::URLRequestStatus::CANCELED && 345 if (status.status() == net::URLRequestStatus::CANCELED &&
346 error_code == net::OK) { 346 error_code == net::OK) {
347 error_code = net::ERR_ABORTED; 347 error_code = net::ERR_ABORTED;
348 } else if (status.status() == net::URLRequestStatus::FAILED && 348 } else if (status.status() == net::URLRequestStatus::FAILED &&
349 error_code == net::OK) { 349 error_code == net::OK) {
350 error_code = net::ERR_FAILED; 350 error_code = net::ERR_FAILED;
351 } 351 }
352 352
353 info->filter()->Send( 353 info->filter()->Send(
354 new ResourceMsg_RequestComplete(request_id, 354 new ResourceMsg_RequestComplete(
355 error_code, 355 request_id, error_code, was_ignored_by_handler,
356 was_ignored_by_handler, 356 request()->response_info().was_cached,
357 security_info, 357 security_info, completion_time));
358 completion_time));
359 } 358 }
360 359
361 bool AsyncResourceHandler::EnsureResourceBufferIsInitialized() { 360 bool AsyncResourceHandler::EnsureResourceBufferIsInitialized() {
362 if (buffer_.get() && buffer_->IsInitialized()) 361 if (buffer_.get() && buffer_->IsInitialized())
363 return true; 362 return true;
364 363
365 if (!has_checked_for_sufficient_resources_) { 364 if (!has_checked_for_sufficient_resources_) {
366 has_checked_for_sufficient_resources_ = true; 365 has_checked_for_sufficient_resources_ = true;
367 if (!rdh_->HasSufficientResourcesForRequest(request())) { 366 if (!rdh_->HasSufficientResourcesForRequest(request())) {
368 controller()->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES); 367 controller()->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES);
(...skipping 13 matching lines...) Expand all
382 request()->LogUnblocked(); 381 request()->LogUnblocked();
383 controller()->Resume(); 382 controller()->Resume();
384 } 383 }
385 } 384 }
386 385
387 void AsyncResourceHandler::OnDefer() { 386 void AsyncResourceHandler::OnDefer() {
388 request()->LogBlockedBy("AsyncResourceHandler"); 387 request()->LogBlockedBy("AsyncResourceHandler");
389 } 388 }
390 389
391 } // namespace content 390 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698