OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef HTMLResourcePreloader_h | 26 #ifndef HTMLResourcePreloader_h |
27 #define HTMLResourcePreloader_h | 27 #define HTMLResourcePreloader_h |
28 | 28 |
29 #include "core/fetch/FetchRequest.h" | 29 #include "core/fetch/FetchRequest.h" |
30 #include "core/fetch/Resource.h" | 30 #include "core/fetch/Resource.h" |
| 31 #include "core/html/parser/CSSPreloadScanner.h" |
31 #include "core/html/parser/PreloadRequest.h" | 32 #include "core/html/parser/PreloadRequest.h" |
32 #include "core/html/parser/ResourcePreloader.h" | 33 #include "core/html/parser/ResourcePreloader.h" |
33 #include "core/loader/NetworkHintsInterface.h" | 34 #include "core/loader/NetworkHintsInterface.h" |
34 #include "wtf/CurrentTime.h" | 35 #include "wtf/CurrentTime.h" |
35 #include "wtf/text/TextPosition.h" | 36 #include "wtf/text/TextPosition.h" |
36 #include <memory> | 37 #include <memory> |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 class CORE_EXPORT HTMLResourcePreloader final : public GarbageCollected<HTMLReso
urcePreloader>, public ResourcePreloader { | 41 class CORE_EXPORT HTMLResourcePreloader final : public GarbageCollected<HTMLReso
urcePreloader>, public ResourcePreloader { |
41 WTF_MAKE_NONCOPYABLE(HTMLResourcePreloader); | 42 WTF_MAKE_NONCOPYABLE(HTMLResourcePreloader); |
42 friend class HTMLResourcePreloaderTest; | 43 friend class HTMLResourcePreloaderTest; |
43 public: | 44 public: |
44 static HTMLResourcePreloader* create(Document&); | 45 static HTMLResourcePreloader* create(Document&); |
| 46 int countPreloads(); |
| 47 Document* document() { return m_document.get(); } |
45 DECLARE_TRACE(); | 48 DECLARE_TRACE(); |
46 | 49 |
47 protected: | 50 protected: |
48 void preload(std::unique_ptr<PreloadRequest>, const NetworkHintsInterface&)
override; | 51 void preload(std::unique_ptr<PreloadRequest>, const NetworkHintsInterface&)
override; |
49 | 52 |
50 private: | 53 private: |
51 explicit HTMLResourcePreloader(Document&); | 54 explicit HTMLResourcePreloader(Document&); |
52 | 55 |
53 Member<Document> m_document; | 56 Member<Document> m_document; |
| 57 HeapHashSet<Member<CSSPreloaderResourceClient>> m_cssPreloaders; |
54 }; | 58 }; |
55 | 59 |
56 } // namespace blink | 60 } // namespace blink |
57 | 61 |
58 #endif | 62 #endif |
OLD | NEW |