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

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: Another rebase! 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 ImageResource::ImageResource(blink::Image* image, const ResourceLoaderOptions& o ptions) 71 ImageResource::ImageResource(blink::Image* image, const ResourceLoaderOptions& o ptions)
72 : Resource(ResourceRequest(""), Image, options) 72 : Resource(ResourceRequest(""), Image, options)
73 , m_devicePixelRatioHeaderValue(1.0) 73 , m_devicePixelRatioHeaderValue(1.0)
74 , m_image(image) 74 , m_image(image)
75 , m_hasDevicePixelRatioHeaderValue(false) 75 , m_hasDevicePixelRatioHeaderValue(false)
76 { 76 {
77 WTF_LOG(Timers, "new ImageResource(Image) %p", this); 77 WTF_LOG(Timers, "new ImageResource(Image) %p", this);
78 setStatus(Cached); 78 setStatus(Cached);
79 } 79 }
80 80
81 ImageResource::ImageResource(const ResourceRequest& resourceRequest, blink::Imag e* image, const ResourceLoaderOptions& options)
82 : Resource(resourceRequest, Image, options)
83 , m_image(image)
84 {
85 WTF_LOG(Timers, "new ImageResource(ResourceRequest, Image) %p", this);
86 setStatus(Cached);
87 }
88
89 ImageResource::~ImageResource() 81 ImageResource::~ImageResource()
90 { 82 {
91 WTF_LOG(Timers, "~ImageResource %p", this); 83 WTF_LOG(Timers, "~ImageResource %p", this);
92 clearImage(); 84 clearImage();
93 } 85 }
94 86
95 DEFINE_TRACE(ImageResource) 87 DEFINE_TRACE(ImageResource)
96 { 88 {
97 visitor->trace(m_multipartParser); 89 visitor->trace(m_multipartParser);
98 Resource::trace(visitor); 90 Resource::trace(visitor);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 } 495 }
504 } 496 }
505 497
506 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher) 498 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher)
507 { 499 {
508 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low")) 500 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low"))
509 return; 501 return;
510 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache); 502 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache);
511 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); 503 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
512 error(Resource::LoadError); 504 error(Resource::LoadError);
505 setStatus(NotStarted);
513 load(fetcher); 506 load(fetcher);
514 } 507 }
515 508
516 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect ) 509 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect )
517 { 510 {
518 if (!image || image != m_image) 511 if (!image || image != m_image)
519 return; 512 return;
520 notifyObservers(&rect); 513 notifyObservers(&rect);
521 } 514 }
522 515
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 if (response().wasFetchedViaServiceWorker()) 549 if (response().wasFetchedViaServiceWorker())
557 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 550 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
558 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 551 if (!getImage()->currentFrameHasSingleSecurityOrigin())
559 return false; 552 return false;
560 if (passesAccessControlCheck(securityOrigin)) 553 if (passesAccessControlCheck(securityOrigin))
561 return true; 554 return true;
562 return !securityOrigin->taintsCanvas(response().url()); 555 return !securityOrigin->taintsCanvas(response().url());
563 } 556 }
564 557
565 } // namespace blink 558 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698