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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp

Issue 2527353002: Phase II Step 3: Reload LoFi/placeholder images via new ImageResource
Patch Set: Use startLoad() again to avoid re-applying modifications to ResourceRequest on reload Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 void ResourceLoader::didFinishLoadingFirstPartInMultipart() { 410 void ResourceLoader::didFinishLoadingFirstPartInMultipart() {
411 network_instrumentation::endResourceLoad( 411 network_instrumentation::endResourceLoad(
412 m_resource->identifier(), 412 m_resource->identifier(),
413 network_instrumentation::RequestOutcome::Success); 413 network_instrumentation::RequestOutcome::Success);
414 414
415 m_fetcher->handleLoaderFinish(m_resource.get(), 0, 415 m_fetcher->handleLoaderFinish(m_resource.get(), 0,
416 ResourceFetcher::DidFinishFirstPartInMultipart); 416 ResourceFetcher::DidFinishFirstPartInMultipart);
417 } 417 }
418 418
419 void ResourceLoader::reloadIfLoFiOrPlaceholderImage(Resource* resource) {
420 resource->reloadIfLoFiOrPlaceholderImage(m_fetcher.get(),
421 Resource::kReloadIfNeeded);
422 }
423
419 void ResourceLoader::didFinishLoading(double finishTime, 424 void ResourceLoader::didFinishLoading(double finishTime,
420 int64_t encodedDataLength, 425 int64_t encodedDataLength,
421 int64_t encodedBodyLength) { 426 int64_t encodedBodyLength) {
422 m_resource->setEncodedDataLength(encodedDataLength); 427 m_resource->setEncodedDataLength(encodedDataLength);
423 m_resource->addToEncodedBodyLength(encodedBodyLength); 428 m_resource->addToEncodedBodyLength(encodedBodyLength);
424 429
425 m_loader.reset(); 430 m_loader.reset();
426 431
427 network_instrumentation::endResourceLoad( 432 network_instrumentation::endResourceLoad(
428 m_resource->identifier(), 433 m_resource->identifier(),
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 return; 524 return;
520 525
521 // Don't activate if cache policy is explicitly set. 526 // Don't activate if cache policy is explicitly set.
522 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) 527 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy)
523 return; 528 return;
524 529
525 m_isCacheAwareLoadingActivated = true; 530 m_isCacheAwareLoadingActivated = true;
526 } 531 }
527 532
528 } // namespace blink 533 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698