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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ImageResource.cpp

Issue 2114213002: Fix loading placeholders for Lo-Fi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test Created 4 years, 5 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 504 }
505 505
506 if (m_image->animationPolicy() != newPolicy) { 506 if (m_image->animationPolicy() != newPolicy) {
507 m_image->resetAnimation(); 507 m_image->resetAnimation();
508 m_image->setAnimationPolicy(newPolicy); 508 m_image->setAnimationPolicy(newPolicy);
509 } 509 }
510 } 510 }
511 511
512 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher) 512 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher)
513 { 513 {
514 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low")) 514 if (m_resourceRequest.loFiState() != WebURLRequest::LoFiOn)
hiroshige 2016/07/07 05:21:58 nit: two whitespaces after |!=|.
megjablon 2016/07/07 19:31:52 Done.
515 return;
516 if (isLoaded() && !m_response.httpHeaderField("chrome-proxy").contains("q=lo w"))
515 return; 517 return;
516 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache); 518 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache);
517 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); 519 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
518 if (isLoading()) 520 if (isLoading())
519 m_loader->cancel(); 521 m_loader->cancel();
520 else 522 clear();
521 updateImageAndClearBuffer(); 523 m_data.clear();
524 notifyObservers();
522 setStatus(NotStarted); 525 setStatus(NotStarted);
523 fetcher->startLoad(this); 526 fetcher->startLoad(this);
524 } 527 }
525 528
526 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect ) 529 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect )
527 { 530 {
528 if (!image || image != m_image) 531 if (!image || image != m_image)
529 return; 532 return;
530 notifyObservers(&rect); 533 notifyObservers(&rect);
531 } 534 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 if (response().wasFetchedViaServiceWorker()) 567 if (response().wasFetchedViaServiceWorker())
565 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 568 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
566 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 569 if (!getImage()->currentFrameHasSingleSecurityOrigin())
567 return false; 570 return false;
568 if (passesAccessControlCheck(securityOrigin)) 571 if (passesAccessControlCheck(securityOrigin))
569 return true; 572 return true;
570 return !securityOrigin->taintsCanvas(response().url()); 573 return !securityOrigin->taintsCanvas(response().url());
571 } 574 }
572 575
573 } // namespace blink 576 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698