OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2010 Google Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 class CORE_EXPORT CSSPreloaderResourceClient | 102 class CORE_EXPORT CSSPreloaderResourceClient |
103 : public GarbageCollectedFinalized<CSSPreloaderResourceClient>, | 103 : public GarbageCollectedFinalized<CSSPreloaderResourceClient>, |
104 public StyleSheetResourceClient { | 104 public StyleSheetResourceClient { |
105 USING_GARBAGE_COLLECTED_MIXIN(CSSPreloaderResourceClient); | 105 USING_GARBAGE_COLLECTED_MIXIN(CSSPreloaderResourceClient); |
106 | 106 |
107 public: | 107 public: |
108 CSSPreloaderResourceClient(Resource*, HTMLResourcePreloader*); | 108 CSSPreloaderResourceClient(Resource*, HTMLResourcePreloader*); |
109 ~CSSPreloaderResourceClient(); | 109 ~CSSPreloaderResourceClient(); |
110 void setCSSStyleSheet(const String& href, | 110 void setCSSStyleSheet(const String& href, |
111 const KURL& baseURL, | 111 const KURL& baseURL, |
| 112 ReferrerPolicy, |
112 const String& charset, | 113 const String& charset, |
113 const CSSStyleSheetResource*) override; | 114 const CSSStyleSheetResource*) override; |
114 void didAppendFirstData(const CSSStyleSheetResource*) override; | 115 void didAppendFirstData(const CSSStyleSheetResource*) override; |
115 String debugName() const override { return "CSSPreloaderResourceClient"; } | 116 String debugName() const override { return "CSSPreloaderResourceClient"; } |
116 | 117 |
117 DECLARE_TRACE(); | 118 DECLARE_TRACE(); |
118 | 119 |
119 protected: | 120 protected: |
120 // Protected for tests, which don't want to initialize a fully featured | 121 // Protected for tests, which don't want to initialize a fully featured |
121 // DocumentLoader. | 122 // DocumentLoader. |
122 virtual void fetchPreloads(PreloadRequestStream& preloads); | 123 virtual void fetchPreloads(PreloadRequestStream& preloads); |
123 | 124 |
124 private: | 125 private: |
125 void scanCSS(const CSSStyleSheetResource*); | 126 void scanCSS(const CSSStyleSheetResource*); |
126 void clearResource(); | 127 void clearResource(); |
127 | 128 |
128 enum PreloadPolicy { | 129 enum PreloadPolicy { |
129 ScanOnly, | 130 ScanOnly, |
130 ScanAndPreload, | 131 ScanAndPreload, |
131 }; | 132 }; |
132 | 133 |
133 const PreloadPolicy m_policy; | 134 const PreloadPolicy m_policy; |
134 WeakMember<HTMLResourcePreloader> m_preloader; | 135 WeakMember<HTMLResourcePreloader> m_preloader; |
135 WeakMember<CSSStyleSheetResource> m_resource; | 136 WeakMember<CSSStyleSheetResource> m_resource; |
136 }; | 137 }; |
137 | 138 |
138 } // namespace blink | 139 } // namespace blink |
139 | 140 |
140 #endif | 141 #endif |
OLD | NEW |