Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: third_party/WebKit/Source/core/loader/LinkLoader.h

Issue 1577073005: Add <link rel=preload> onload support for scripts and styles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed lifetime issue of LinkPreloadResourceClients Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/LinkLoader.h
diff --git a/third_party/WebKit/Source/core/loader/LinkLoader.h b/third_party/WebKit/Source/core/loader/LinkLoader.h
index bb79b8e8c50ae8a597f7bd9d1f2f5628c183ff5a..40787caec059b2e9cb84abb48ad934eb3787e502 100644
--- a/third_party/WebKit/Source/core/loader/LinkLoader.h
+++ b/third_party/WebKit/Source/core/loader/LinkLoader.h
@@ -36,6 +36,7 @@
#include "core/fetch/ResourceClient.h"
#include "core/fetch/ResourceOwner.h"
#include "core/loader/LinkLoaderClient.h"
+#include "core/loader/LinkPreloadResourceClients.h"
#include "platform/CrossOriginAttributeValue.h"
#include "platform/PrerenderClient.h"
#include "platform/Timer.h"
@@ -66,11 +67,16 @@ public:
void didSendLoadForPrerender() override;
void didSendDOMContentLoadedForPrerender() override;
+ void triggerEvents(Resource*);
+
void released();
bool loadLink(const LinkRelAttribute&, CrossOriginAttributeValue, const String& type, const String& as, const KURL&, Document&, const NetworkHintsInterface&);
enum CanLoadResources { LoadResources, DoNotLoadResources };
static bool loadLinkFromHeader(const String& headerValue, Document*, const NetworkHintsInterface&, CanLoadResources);
static Resource::Type getTypeFromAsAttribute(const String& as, Document*);
+ WeakPtr<LinkLoader> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
+ void setPreloadResourceClient(PassOwnPtr<LinkPreloadResourceClient> client) { m_linkPreloadResourceClient = client; }
+ LinkPreloadResourceClient* preloadResourceClient() { return m_linkPreloadResourceClient.get(); }
DECLARE_TRACE();
@@ -84,6 +90,8 @@ private:
Timer<LinkLoader> m_linkLoadingErrorTimer;
OwnPtrWillBeMember<PrerenderHandle> m_prerender;
+ WeakPtrFactory<LinkLoader> m_weakPtrFactory;
+ OwnPtrWillBeMember<LinkPreloadResourceClient> m_linkPreloadResourceClient;
};
}

Powered by Google App Engine
This is Rietveld 408576698