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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 ImageResource::ImageResource(WebCore::Image* image) | 55 ImageResource::ImageResource(WebCore::Image* image) |
56 : Resource(ResourceRequest(""), Image) | 56 : Resource(ResourceRequest(""), Image) |
57 , m_image(image) | 57 , m_image(image) |
58 { | 58 { |
59 setStatus(Cached); | 59 setStatus(Cached); |
60 setLoading(false); | 60 setLoading(false); |
61 setCustomAcceptHeader(); | 61 setCustomAcceptHeader(); |
62 } | 62 } |
63 | 63 |
| 64 ImageResource::ImageResource(const ResourceRequest& resourceRequest, WebCore::Im
age* image) |
| 65 : Resource(resourceRequest, Image) |
| 66 , m_image(image) |
| 67 { |
| 68 setStatus(Cached); |
| 69 setLoading(false); |
| 70 setCustomAcceptHeader(); |
| 71 } |
| 72 |
64 ImageResource::~ImageResource() | 73 ImageResource::~ImageResource() |
65 { | 74 { |
66 clearImage(); | 75 clearImage(); |
67 } | 76 } |
68 | 77 |
69 void ImageResource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions&
options) | 78 void ImageResource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions&
options) |
70 { | 79 { |
71 if (!fetcher || fetcher->autoLoadImages()) | 80 if (!fetcher || fetcher->autoLoadImages()) |
72 Resource::load(fetcher, options); | 81 Resource::load(fetcher, options); |
73 else | 82 else |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) | 471 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) |
463 { | 472 { |
464 if (!image()->currentFrameHasSingleSecurityOrigin()) | 473 if (!image()->currentFrameHasSingleSecurityOrigin()) |
465 return false; | 474 return false; |
466 if (passesAccessControlCheck(securityOrigin)) | 475 if (passesAccessControlCheck(securityOrigin)) |
467 return true; | 476 return true; |
468 return !securityOrigin->taintsCanvas(response().url()); | 477 return !securityOrigin->taintsCanvas(response().url()); |
469 } | 478 } |
470 | 479 |
471 } // namespace WebCore | 480 } // namespace WebCore |
OLD | NEW |