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

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

Issue 1889973002: Refactoring starting a resource load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 } 496 }
497 497
498 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher) 498 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher)
499 { 499 {
500 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low")) 500 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low"))
501 return; 501 return;
502 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache); 502 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache);
503 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); 503 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
504 error(Resource::LoadError); 504 error(Resource::LoadError);
505 setStatus(NotStarted); 505 setStatus(NotStarted);
506 load(fetcher); 506 fetcher->startLoad(this);
Yoav Weiss 2016/04/20 08:52:08 Can you DCHECK that fetcher is non-null here?
Nate Chapin 2016/05/18 23:56:04 This is only called by ResourceFetcher at the mome
507 } 507 }
508 508
509 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect ) 509 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect )
510 { 510 {
511 if (!image || image != m_image) 511 if (!image || image != m_image)
512 return; 512 return;
513 notifyObservers(&rect); 513 notifyObservers(&rect);
514 } 514 }
515 515
516 void ImageResource::onePartInMultipartReceived(const ResourceResponse& response) 516 void ImageResource::onePartInMultipartReceived(const ResourceResponse& response)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 if (response().wasFetchedViaServiceWorker()) 549 if (response().wasFetchedViaServiceWorker())
550 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 550 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
551 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 551 if (!getImage()->currentFrameHasSingleSecurityOrigin())
552 return false; 552 return false;
553 if (passesAccessControlCheck(securityOrigin)) 553 if (passesAccessControlCheck(securityOrigin))
554 return true; 554 return true;
555 return !securityOrigin->taintsCanvas(response().url()); 555 return !securityOrigin->taintsCanvas(response().url());
556 } 556 }
557 557
558 } // namespace blink 558 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698