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

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: 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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_response.httpHeaderField("chrome-proxy").contains("q=low"))
515 return; 515 return;
516 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache); 516 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache);
517 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); 517 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
518 if (isLoading()) 518 if (isLoading())
519 m_loader->cancel(); 519 m_loader->cancel();
520 else 520 error(ResourceError::cancelledError(url()));
hiroshige 2016/07/04 12:02:29 Instead of calling error(), how about clear();
megjablon 2016/07/07 00:51:57 Thanks! Was looking for another way that would loa
521 updateImageAndClearBuffer();
522 setStatus(NotStarted); 521 setStatus(NotStarted);
523 fetcher->startLoad(this); 522 fetcher->startLoad(this);
524 } 523 }
525 524
526 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect ) 525 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect )
527 { 526 {
528 if (!image || image != m_image) 527 if (!image || image != m_image)
529 return; 528 return;
530 notifyObservers(&rect); 529 notifyObservers(&rect);
531 } 530 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 if (response().wasFetchedViaServiceWorker()) 563 if (response().wasFetchedViaServiceWorker())
565 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 564 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
566 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 565 if (!getImage()->currentFrameHasSingleSecurityOrigin())
567 return false; 566 return false;
568 if (passesAccessControlCheck(securityOrigin)) 567 if (passesAccessControlCheck(securityOrigin))
569 return true; 568 return true;
570 return !securityOrigin->taintsCanvas(response().url()); 569 return !securityOrigin->taintsCanvas(response().url());
571 } 570 }
572 571
573 } // namespace blink 572 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698