diff options
Diffstat (limited to 'Source/WebCore/html/parser/HTMLResourcePreloader.h')
-rw-r--r-- | Source/WebCore/html/parser/HTMLResourcePreloader.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Source/WebCore/html/parser/HTMLResourcePreloader.h b/Source/WebCore/html/parser/HTMLResourcePreloader.h index f93a093bd..cd10f85de 100644 --- a/Source/WebCore/html/parser/HTMLResourcePreloader.h +++ b/Source/WebCore/html/parser/HTMLResourcePreloader.h @@ -20,11 +20,10 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef HTMLResourcePreloader_h -#define HTMLResourcePreloader_h +#pragma once #include "CachedResource.h" #include "CachedResourceRequest.h" @@ -32,25 +31,29 @@ namespace WebCore { class PreloadRequest { + WTF_MAKE_FAST_ALLOCATED; public: - PreloadRequest(const String& initiator, const String& resourceURL, const URL& baseURL, CachedResource::Type resourceType, const String& mediaAttribute) + enum class ModuleScript { + Yes, + No, + }; + PreloadRequest(const String& initiator, const String& resourceURL, const URL& baseURL, CachedResource::Type resourceType, const String& mediaAttribute, ModuleScript moduleScript) : m_initiator(initiator) - , m_resourceURL(resourceURL.isolatedCopy()) - , m_baseURL(baseURL.copy()) + , m_resourceURL(resourceURL) + , m_baseURL(baseURL.isolatedCopy()) , m_resourceType(resourceType) - , m_mediaAttribute(mediaAttribute.isolatedCopy()) - , m_crossOriginModeAllowsCookies(false) + , m_mediaAttribute(mediaAttribute) + , m_moduleScript(moduleScript) { } - bool isSafeToSendToAnotherThread() const; - CachedResourceRequest resourceRequest(Document&); const String& charset() const { return m_charset; } const String& media() const { return m_mediaAttribute; } void setCharset(const String& charset) { m_charset = charset.isolatedCopy(); } - void setCrossOriginModeAllowsCookies(bool allowsCookies) { m_crossOriginModeAllowsCookies = allowsCookies; } + void setCrossOriginMode(const String& mode) { m_crossOriginMode = mode; } + void setNonce(const String& nonce) { m_nonceAttribute = nonce; } CachedResource::Type resourceType() const { return m_resourceType; } private: @@ -62,7 +65,9 @@ private: String m_charset; CachedResource::Type m_resourceType; String m_mediaAttribute; - bool m_crossOriginModeAllowsCookies; + String m_crossOriginMode; + String m_nonceAttribute; + ModuleScript m_moduleScript; }; typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; @@ -86,6 +91,4 @@ private: WeakPtrFactory<HTMLResourcePreloader> m_weakFactory; }; -} - -#endif +} // namespace WebCore |