| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "core/layout/LayoutImage.h" | 44 #include "core/layout/LayoutImage.h" |
| 45 #include "core/layout/LayoutVideo.h" | 45 #include "core/layout/LayoutVideo.h" |
| 46 #include "core/layout/svg/LayoutSVGImage.h" | 46 #include "core/layout/svg/LayoutSVGImage.h" |
| 47 #include "core/svg/graphics/SVGImage.h" | 47 #include "core/svg/graphics/SVGImage.h" |
| 48 #include "platform/Logging.h" | 48 #include "platform/Logging.h" |
| 49 #include "platform/weborigin/SecurityOrigin.h" | 49 #include "platform/weborigin/SecurityOrigin.h" |
| 50 #include "platform/weborigin/SecurityPolicy.h" | 50 #include "platform/weborigin/SecurityPolicy.h" |
| 51 #include "public/platform/WebCachePolicy.h" | 51 #include "public/platform/WebCachePolicy.h" |
| 52 #include "public/platform/WebURLRequest.h" | 52 #include "public/platform/WebURLRequest.h" |
| 53 #include "wtf/PtrUtil.h" | 53 #include "wtf/PtrUtil.h" |
| 54 #include <memory> | |
| 55 | 54 |
| 56 namespace blink { | 55 namespace blink { |
| 57 | 56 |
| 58 static ImageEventSender& loadEventSender() | 57 static ImageEventSender& loadEventSender() |
| 59 { | 58 { |
| 60 DEFINE_STATIC_LOCAL(ImageEventSender, sender, (ImageEventSender::create(Even
tTypeNames::load))); | 59 DEFINE_STATIC_LOCAL(ImageEventSender, sender, (ImageEventSender::create(Even
tTypeNames::load))); |
| 61 return sender; | 60 return sender; |
| 62 } | 61 } |
| 63 | 62 |
| 64 static ImageEventSender& errorEventSender() | 63 static ImageEventSender& errorEventSender() |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // FIXME: According to | 255 // FIXME: According to |
| 257 // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-cont
ent.html#the-img-element:the-img-element-55 | 256 // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-cont
ent.html#the-img-element:the-img-element-55 |
| 258 // When "update image" is called due to environment changes and the load fai
ls, onerror should not be called. | 257 // When "update image" is called due to environment changes and the load fai
ls, onerror should not be called. |
| 259 // That is currently not the case. | 258 // That is currently not the case. |
| 260 // | 259 // |
| 261 // We don't need to call clearLoader here: Either we were called from the | 260 // We don't need to call clearLoader here: Either we were called from the |
| 262 // task, or our caller updateFromElement cleared the task's loader (and set | 261 // task, or our caller updateFromElement cleared the task's loader (and set |
| 263 // m_pendingTask to null). | 262 // m_pendingTask to null). |
| 264 m_pendingTask.clear(); | 263 m_pendingTask.clear(); |
| 265 // Make sure to only decrement the count when we exit this function | 264 // Make sure to only decrement the count when we exit this function |
| 266 std::unique_ptr<IncrementLoadEventDelayCount> loadDelayCounter; | 265 OwnPtr<IncrementLoadEventDelayCount> loadDelayCounter; |
| 267 loadDelayCounter.swap(m_loadDelayCounter); | 266 loadDelayCounter.swap(m_loadDelayCounter); |
| 268 | 267 |
| 269 Document& document = m_element->document(); | 268 Document& document = m_element->document(); |
| 270 if (!document.isActive()) | 269 if (!document.isActive()) |
| 271 return; | 270 return; |
| 272 | 271 |
| 273 AtomicString imageSourceURL = m_element->imageSourceURL(); | 272 AtomicString imageSourceURL = m_element->imageSourceURL(); |
| 274 KURL url = imageSourceToKURL(imageSourceURL); | 273 KURL url = imageSourceToKURL(imageSourceURL); |
| 275 ImageResource* newImage = nullptr; | 274 ImageResource* newImage = nullptr; |
| 276 if (!url.isNull()) { | 275 if (!url.isNull()) { |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 602 |
| 604 void ImageLoader::elementDidMoveToNewDocument() | 603 void ImageLoader::elementDidMoveToNewDocument() |
| 605 { | 604 { |
| 606 if (m_loadDelayCounter) | 605 if (m_loadDelayCounter) |
| 607 m_loadDelayCounter->documentChanged(m_element->document()); | 606 m_loadDelayCounter->documentChanged(m_element->document()); |
| 608 clearFailedLoadURL(); | 607 clearFailedLoadURL(); |
| 609 setImage(0); | 608 setImage(0); |
| 610 } | 609 } |
| 611 | 610 |
| 612 } // namespace blink | 611 } // namespace blink |
| OLD | NEW |