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

Side by Side Diff: third_party/WebKit/Source/core/loader/LinkLoader.h

Issue 2648023002: Use TaskRunnerTimer in LinkLoader (Closed)
Patch Set: Created 3 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // The LinkLoader can load link rel types icon, dns-prefetch, subresource, 54 // The LinkLoader can load link rel types icon, dns-prefetch, subresource,
55 // prefetch and prerender. 55 // prefetch and prerender.
56 class CORE_EXPORT LinkLoader final 56 class CORE_EXPORT LinkLoader final
57 : public GarbageCollectedFinalized<LinkLoader>, 57 : public GarbageCollectedFinalized<LinkLoader>,
58 public ResourceOwner<Resource, ResourceClient>, 58 public ResourceOwner<Resource, ResourceClient>,
59 public PrerenderClient { 59 public PrerenderClient {
60 USING_GARBAGE_COLLECTED_MIXIN(LinkLoader); 60 USING_GARBAGE_COLLECTED_MIXIN(LinkLoader);
61 61
62 public: 62 public:
63 static LinkLoader* create(LinkLoaderClient* client) { 63 static LinkLoader* create(LinkLoaderClient* client) {
64 return new LinkLoader(client); 64 return new LinkLoader(client, client->getLoadingTaskRunner());
65 } 65 }
66 ~LinkLoader() override; 66 ~LinkLoader() override;
67 67
68 // from ResourceClient 68 // from ResourceClient
69 void notifyFinished(Resource*) override; 69 void notifyFinished(Resource*) override;
70 String debugName() const override { return "LinkLoader"; } 70 String debugName() const override { return "LinkLoader"; }
71 71
72 // from PrerenderClient 72 // from PrerenderClient
73 void didStartPrerender() override; 73 void didStartPrerender() override;
74 void didStopPrerender() override; 74 void didStopPrerender() override;
(...skipping 26 matching lines...) Expand all
101 const NetworkHintsInterface&, 101 const NetworkHintsInterface&,
102 CanLoadResources, 102 CanLoadResources,
103 MediaPreloadPolicy, 103 MediaPreloadPolicy,
104 ViewportDescriptionWrapper*); 104 ViewportDescriptionWrapper*);
105 static WTF::Optional<Resource::Type> getResourceTypeFromAsAttribute( 105 static WTF::Optional<Resource::Type> getResourceTypeFromAsAttribute(
106 const String& as); 106 const String& as);
107 107
108 DECLARE_TRACE(); 108 DECLARE_TRACE();
109 109
110 private: 110 private:
111 explicit LinkLoader(LinkLoaderClient*); 111 LinkLoader(LinkLoaderClient*, RefPtr<WebTaskRunner>);
112 112
113 void linkLoadTimerFired(TimerBase*); 113 void linkLoadTimerFired(TimerBase*);
114 void linkLoadingErrorTimerFired(TimerBase*); 114 void linkLoadingErrorTimerFired(TimerBase*);
115 void createLinkPreloadResourceClient(Resource*); 115 void createLinkPreloadResourceClient(Resource*);
116 116
117 Member<LinkLoaderClient> m_client; 117 Member<LinkLoaderClient> m_client;
118 118
119 Timer<LinkLoader> m_linkLoadTimer; 119 TaskRunnerTimer<LinkLoader> m_linkLoadTimer;
120 Timer<LinkLoader> m_linkLoadingErrorTimer; 120 TaskRunnerTimer<LinkLoader> m_linkLoadingErrorTimer;
121 121
122 Member<PrerenderHandle> m_prerender; 122 Member<PrerenderHandle> m_prerender;
123 Member<LinkPreloadResourceClient> m_linkPreloadResourceClient; 123 Member<LinkPreloadResourceClient> m_linkPreloadResourceClient;
124 }; 124 };
125 125
126 } // namespace blink 126 } // namespace blink
127 127
128 #endif 128 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.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