| OLD | NEW |
| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/fetch/ResourceClientOrObserverWalker.h" | 29 #include "core/fetch/ResourceClientOrObserverWalker.h" |
| 30 #include "core/fetch/ResourceFetcher.h" | 30 #include "core/fetch/ResourceFetcher.h" |
| 31 #include "core/fetch/ResourceLoader.h" | 31 #include "core/fetch/ResourceLoader.h" |
| 32 #include "core/svg/graphics/SVGImage.h" | 32 #include "core/svg/graphics/SVGImage.h" |
| 33 #include "platform/Logging.h" | 33 #include "platform/Logging.h" |
| 34 #include "platform/RuntimeEnabledFeatures.h" | 34 #include "platform/RuntimeEnabledFeatures.h" |
| 35 #include "platform/SharedBuffer.h" | 35 #include "platform/SharedBuffer.h" |
| 36 #include "platform/TraceEvent.h" | 36 #include "platform/TraceEvent.h" |
| 37 #include "platform/graphics/BitmapImage.h" | 37 #include "platform/graphics/BitmapImage.h" |
| 38 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
| 39 #include "public/platform/WebCachePolicy.h" |
| 39 #include "wtf/CheckedNumeric.h" | 40 #include "wtf/CheckedNumeric.h" |
| 40 #include "wtf/CurrentTime.h" | 41 #include "wtf/CurrentTime.h" |
| 41 #include "wtf/StdLibExtras.h" | 42 #include "wtf/StdLibExtras.h" |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 using ImageResourceObserverWalker = ResourceClientOrObserverWalker<ImageResource
Observer, ImageResourceObserver>; | 46 using ImageResourceObserverWalker = ResourceClientOrObserverWalker<ImageResource
Observer, ImageResourceObserver>; |
| 46 | 47 |
| 47 ImageResource* ImageResource::fetch(FetchRequest& request, ResourceFetcher* fetc
her) | 48 ImageResource* ImageResource::fetch(FetchRequest& request, ResourceFetcher* fetc
her) |
| 48 { | 49 { |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 if (m_image->animationPolicy() != newPolicy) { | 500 if (m_image->animationPolicy() != newPolicy) { |
| 500 m_image->resetAnimation(); | 501 m_image->resetAnimation(); |
| 501 m_image->setAnimationPolicy(newPolicy); | 502 m_image->setAnimationPolicy(newPolicy); |
| 502 } | 503 } |
| 503 } | 504 } |
| 504 | 505 |
| 505 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher) | 506 void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher) |
| 506 { | 507 { |
| 507 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low")) | 508 if (!m_response.httpHeaderField("chrome-proxy").contains("q=low")) |
| 508 return; | 509 return; |
| 509 m_resourceRequest.setCachePolicy(ResourceRequestCachePolicy::BypassingCache)
; | 510 m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache); |
| 510 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); | 511 m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); |
| 511 error(Resource::LoadError); | 512 error(Resource::LoadError); |
| 512 load(fetcher); | 513 load(fetcher); |
| 513 } | 514 } |
| 514 | 515 |
| 515 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect
) | 516 void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect
) |
| 516 { | 517 { |
| 517 if (!image || image != m_image) | 518 if (!image || image != m_image) |
| 518 return; | 519 return; |
| 519 notifyObservers(&rect); | 520 notifyObservers(&rect); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 if (response().wasFetchedViaServiceWorker()) | 556 if (response().wasFetchedViaServiceWorker()) |
| 556 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; | 557 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; |
| 557 if (!getImage()->currentFrameHasSingleSecurityOrigin()) | 558 if (!getImage()->currentFrameHasSingleSecurityOrigin()) |
| 558 return false; | 559 return false; |
| 559 if (passesAccessControlCheck(securityOrigin)) | 560 if (passesAccessControlCheck(securityOrigin)) |
| 560 return true; | 561 return true; |
| 561 return !securityOrigin->taintsCanvas(response().url()); | 562 return !securityOrigin->taintsCanvas(response().url()); |
| 562 } | 563 } |
| 563 | 564 |
| 564 } // namespace blink | 565 } // namespace blink |
| OLD | NEW |