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

Side by Side 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 adoptPtr 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 18 matching lines...) Expand all
29 * 29 *
30 */ 30 */
31 31
32 #ifndef LinkLoader_h 32 #ifndef LinkLoader_h
33 #define LinkLoader_h 33 #define LinkLoader_h
34 34
35 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
36 #include "core/fetch/ResourceClient.h" 36 #include "core/fetch/ResourceClient.h"
37 #include "core/fetch/ResourceOwner.h" 37 #include "core/fetch/ResourceOwner.h"
38 #include "core/loader/LinkLoaderClient.h" 38 #include "core/loader/LinkLoaderClient.h"
39 #include "core/loader/LinkPreloadResourceClients.h"
39 #include "platform/CrossOriginAttributeValue.h" 40 #include "platform/CrossOriginAttributeValue.h"
40 #include "platform/PrerenderClient.h" 41 #include "platform/PrerenderClient.h"
41 #include "platform/Timer.h" 42 #include "platform/Timer.h"
42 #include "platform/heap/Handle.h" 43 #include "platform/heap/Handle.h"
43 #include "wtf/OwnPtr.h" 44 #include "wtf/OwnPtr.h"
44 45
45 namespace blink { 46 namespace blink {
46 47
47 class Document; 48 class Document;
48 class LinkRelAttribute; 49 class LinkRelAttribute;
(...skipping 10 matching lines...) Expand all
59 // from ResourceClient 60 // from ResourceClient
60 void notifyFinished(Resource*) override; 61 void notifyFinished(Resource*) override;
61 String debugName() const override { return "LinkLoader"; } 62 String debugName() const override { return "LinkLoader"; }
62 63
63 // from PrerenderClient 64 // from PrerenderClient
64 void didStartPrerender() override; 65 void didStartPrerender() override;
65 void didStopPrerender() override; 66 void didStopPrerender() override;
66 void didSendLoadForPrerender() override; 67 void didSendLoadForPrerender() override;
67 void didSendDOMContentLoadedForPrerender() override; 68 void didSendDOMContentLoadedForPrerender() override;
68 69
70 void triggerEvents(const Resource*);
71
69 void released(); 72 void released();
70 bool loadLink(const LinkRelAttribute&, CrossOriginAttributeValue, const Stri ng& type, const String& as, const KURL&, Document&, const NetworkHintsInterface& ); 73 bool loadLink(const LinkRelAttribute&, CrossOriginAttributeValue, const Stri ng& type, const String& as, const KURL&, Document&, const NetworkHintsInterface& );
71 enum CanLoadResources { LoadResources, DoNotLoadResources }; 74 enum CanLoadResources { LoadResources, DoNotLoadResources };
72 static bool loadLinkFromHeader(const String& headerValue, Document*, const N etworkHintsInterface&, CanLoadResources); 75 static bool loadLinkFromHeader(const String& headerValue, Document*, const N etworkHintsInterface&, CanLoadResources);
73 static Resource::Type getTypeFromAsAttribute(const String& as, Document*); 76 static Resource::Type getTypeFromAsAttribute(const String& as, Document*);
74 77
75 DECLARE_TRACE(); 78 DECLARE_TRACE();
76 79
77 private: 80 private:
78 void linkLoadTimerFired(Timer<LinkLoader>*); 81 void linkLoadTimerFired(Timer<LinkLoader>*);
79 void linkLoadingErrorTimerFired(Timer<LinkLoader>*); 82 void linkLoadingErrorTimerFired(Timer<LinkLoader>*);
83 void createLinkPreloadResourceClient(ResourcePtr<Resource>);
80 84
81 LinkLoaderClient* m_client; 85 LinkLoaderClient* m_client;
82 86
83 Timer<LinkLoader> m_linkLoadTimer; 87 Timer<LinkLoader> m_linkLoadTimer;
84 Timer<LinkLoader> m_linkLoadingErrorTimer; 88 Timer<LinkLoader> m_linkLoadingErrorTimer;
85 89
86 OwnPtrWillBeMember<PrerenderHandle> m_prerender; 90 OwnPtrWillBeMember<PrerenderHandle> m_prerender;
91 OwnPtrWillBeMember<LinkPreloadResourceClient> m_linkPreloadResourceClient;
87 }; 92 };
88 93
89 } 94 }
90 95
91 #endif 96 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/loader/LinkLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698