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 | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights |
5 * reserved. | 5 * reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "core/loader/ImageLoader.h" | 23 #include "core/loader/ImageLoader.h" |
24 | 24 |
25 #include "bindings/core/v8/Microtask.h" | 25 #include "bindings/core/v8/Microtask.h" |
26 #include "bindings/core/v8/ScriptController.h" | 26 #include "bindings/core/v8/ScriptController.h" |
27 #include "bindings/core/v8/ScriptState.h" | 27 #include "bindings/core/v8/ScriptState.h" |
28 #include "bindings/core/v8/V8Binding.h" | 28 #include "bindings/core/v8/V8Binding.h" |
29 #include "bindings/core/v8/V8PerIsolateData.h" | 29 #include "bindings/core/v8/V8PerIsolateData.h" |
30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
31 #include "core/dom/Element.h" | 31 #include "core/dom/Element.h" |
32 #include "core/dom/IncrementLoadEventDelayCount.h" | 32 #include "core/dom/IncrementLoadEventDelayCount.h" |
| 33 #include "core/dom/TaskRunnerHelper.h" |
33 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
34 #include "core/events/EventSender.h" | 35 #include "core/events/EventSender.h" |
35 #include "core/fetch/FetchRequest.h" | 36 #include "core/fetch/FetchRequest.h" |
36 #include "core/fetch/MemoryCache.h" | 37 #include "core/fetch/MemoryCache.h" |
37 #include "core/fetch/ResourceFetcher.h" | 38 #include "core/fetch/ResourceFetcher.h" |
38 #include "core/fetch/ResourceLoadingLog.h" | 39 #include "core/fetch/ResourceLoadingLog.h" |
39 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
40 #include "core/frame/Settings.h" | 41 #include "core/frame/Settings.h" |
41 #include "core/frame/UseCounter.h" | 42 #include "core/frame/UseCounter.h" |
42 #include "core/html/CrossOriginAttribute.h" | 43 #include "core/html/CrossOriginAttribute.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 BypassMainWorldBehavior m_shouldBypassMainWorldCSP; | 149 BypassMainWorldBehavior m_shouldBypassMainWorldCSP; |
149 UpdateFromElementBehavior m_updateBehavior; | 150 UpdateFromElementBehavior m_updateBehavior; |
150 RefPtr<ScriptState> m_scriptState; | 151 RefPtr<ScriptState> m_scriptState; |
151 WeakPtrFactory<Task> m_weakFactory; | 152 WeakPtrFactory<Task> m_weakFactory; |
152 ReferrerPolicy m_referrerPolicy; | 153 ReferrerPolicy m_referrerPolicy; |
153 KURL m_requestURL; | 154 KURL m_requestURL; |
154 }; | 155 }; |
155 | 156 |
156 ImageLoader::ImageLoader(Element* element) | 157 ImageLoader::ImageLoader(Element* element) |
157 : m_element(element), | 158 : m_element(element), |
158 m_derefElementTimer(this, &ImageLoader::timerFired), | 159 m_derefElementTimer(TaskRunnerHelper::get(TaskType::Networking, |
| 160 element->document().frame()), |
| 161 this, |
| 162 &ImageLoader::timerFired), |
159 m_hasPendingLoadEvent(false), | 163 m_hasPendingLoadEvent(false), |
160 m_hasPendingErrorEvent(false), | 164 m_hasPendingErrorEvent(false), |
161 m_imageComplete(true), | 165 m_imageComplete(true), |
162 m_loadingImageDocument(false), | 166 m_loadingImageDocument(false), |
163 m_elementIsProtected(false), | 167 m_elementIsProtected(false), |
164 m_suppressErrorEvents(false) { | 168 m_suppressErrorEvents(false) { |
165 RESOURCE_LOADING_DVLOG(1) << "new ImageLoader " << this; | 169 RESOURCE_LOADING_DVLOG(1) << "new ImageLoader " << this; |
166 } | 170 } |
167 | 171 |
168 ImageLoader::~ImageLoader() {} | 172 ImageLoader::~ImageLoader() {} |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 } | 638 } |
635 | 639 |
636 void ImageLoader::elementDidMoveToNewDocument() { | 640 void ImageLoader::elementDidMoveToNewDocument() { |
637 if (m_loadDelayCounter) | 641 if (m_loadDelayCounter) |
638 m_loadDelayCounter->documentChanged(m_element->document()); | 642 m_loadDelayCounter->documentChanged(m_element->document()); |
639 clearFailedLoadURL(); | 643 clearFailedLoadURL(); |
640 setImage(0); | 644 setImage(0); |
641 } | 645 } |
642 | 646 |
643 } // namespace blink | 647 } // namespace blink |
OLD | NEW |