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

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

Issue 1829403002: Clean up font loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Resource_status
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 ImageResource::ImageResource(blink::Image* image, const ResourceLoaderOptions& o ptions) 70 ImageResource::ImageResource(blink::Image* image, const ResourceLoaderOptions& o ptions)
71 : Resource(ResourceRequest(""), Image, options) 71 : Resource(ResourceRequest(""), Image, options)
72 , m_devicePixelRatioHeaderValue(1.0) 72 , m_devicePixelRatioHeaderValue(1.0)
73 , m_image(image) 73 , m_image(image)
74 , m_hasDevicePixelRatioHeaderValue(false) 74 , m_hasDevicePixelRatioHeaderValue(false)
75 { 75 {
76 WTF_LOG(Timers, "new ImageResource(Image) %p", this); 76 WTF_LOG(Timers, "new ImageResource(Image) %p", this);
77 setStatus(Cached); 77 setStatus(Cached);
78 } 78 }
79 79
80 ImageResource::ImageResource(const ResourceRequest& resourceRequest, blink::Imag e* image, const ResourceLoaderOptions& options)
81 : Resource(resourceRequest, Image, options)
82 , m_image(image)
83 {
84 WTF_LOG(Timers, "new ImageResource(ResourceRequest, Image) %p", this);
85 setStatus(Cached);
86 }
87
88 ImageResource::~ImageResource() 80 ImageResource::~ImageResource()
89 { 81 {
90 WTF_LOG(Timers, "~ImageResource %p", this); 82 WTF_LOG(Timers, "~ImageResource %p", this);
91 clearImage(); 83 clearImage();
92 } 84 }
93 85
94 DEFINE_TRACE(ImageResource) 86 DEFINE_TRACE(ImageResource)
95 { 87 {
96 visitor->trace(m_multipartParser); 88 visitor->trace(m_multipartParser);
97 Resource::trace(visitor); 89 Resource::trace(visitor);
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 474 }
483 } 475 }
484 476
485 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher) 477 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher)
486 { 478 {
487 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low")) 479 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low"))
488 return; 480 return;
489 m_resourceRequest.setCachePolicy(ResourceRequestCachePolicy::BypassingCache) ; 481 m_resourceRequest.setCachePolicy(ResourceRequestCachePolicy::BypassingCache) ;
490 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); 482 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
491 error(Resource::LoadError); 483 error(Resource::LoadError);
484 setStatus(NotStarted);
492 load(fetcher); 485 load(fetcher);
493 } 486 }
494 487
495 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect ) 488 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect )
496 { 489 {
497 if (!image || image != m_image) 490 if (!image || image != m_image)
498 return; 491 return;
499 notifyObservers(false, &rect); 492 notifyObservers(false, &rect);
500 } 493 }
501 494
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 if (response().wasFetchedViaServiceWorker()) 528 if (response().wasFetchedViaServiceWorker())
536 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 529 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
537 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 530 if (!getImage()->currentFrameHasSingleSecurityOrigin())
538 return false; 531 return false;
539 if (passesAccessControlCheck(securityOrigin)) 532 if (passesAccessControlCheck(securityOrigin))
540 return true; 533 return true;
541 return !securityOrigin->taintsCanvas(response().url()); 534 return !securityOrigin->taintsCanvas(response().url());
542 } 535 }
543 536
544 } // namespace blink 537 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698