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

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

Issue 481753002: Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years 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 | Annotate | Revision Log
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 , m_loadingMultipartContent(false) 49 , m_loadingMultipartContent(false)
50 , m_hasDevicePixelRatioHeaderValue(false) 50 , m_hasDevicePixelRatioHeaderValue(false)
51 { 51 {
52 WTF_LOG(Timers, "new ImageResource(ResourceRequest) %p", this); 52 WTF_LOG(Timers, "new ImageResource(ResourceRequest) %p", this);
53 setStatus(Unknown); 53 setStatus(Unknown);
54 setCustomAcceptHeader(); 54 setCustomAcceptHeader();
55 } 55 }
56 56
57 ImageResource::ImageResource(blink::Image* image) 57 ImageResource::ImageResource(blink::Image* image)
58 : Resource(ResourceRequest(""), Image) 58 : Resource(ResourceRequest(""), Image)
59 , m_devicePixelRatioHeaderValue(1.0)
59 , m_image(image) 60 , m_image(image)
61 , m_loadingMultipartContent(false)
62 , m_hasDevicePixelRatioHeaderValue(false)
60 { 63 {
61 WTF_LOG(Timers, "new ImageResource(Image) %p", this); 64 WTF_LOG(Timers, "new ImageResource(Image) %p", this);
62 setStatus(Cached); 65 setStatus(Cached);
63 setLoading(false); 66 setLoading(false);
64 setCustomAcceptHeader(); 67 setCustomAcceptHeader();
65 } 68 }
66 69
67 ImageResource::ImageResource(const ResourceRequest& resourceRequest, blink::Imag e* image) 70 ImageResource::ImageResource(const ResourceRequest& resourceRequest, blink::Imag e* image)
68 : Resource(resourceRequest, Image) 71 : Resource(resourceRequest, Image)
69 , m_image(image) 72 , m_image(image)
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 if (response().wasFetchedViaServiceWorker()) 507 if (response().wasFetchedViaServiceWorker())
505 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 508 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
506 if (!image()->currentFrameHasSingleSecurityOrigin()) 509 if (!image()->currentFrameHasSingleSecurityOrigin())
507 return false; 510 return false;
508 if (passesAccessControlCheck(securityOrigin)) 511 if (passesAccessControlCheck(securityOrigin))
509 return true; 512 return true;
510 return !securityOrigin->taintsCanvas(response().url()); 513 return !securityOrigin->taintsCanvas(response().url());
511 } 514 }
512 515
513 } // namespace blink 516 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698