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

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

Issue 1569273004: Move ResourceOwner on to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win_chromium_compile_dbg_ng is the worst 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "wtf/OwnPtr.h" 43 #include "wtf/OwnPtr.h"
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class Document; 47 class Document;
48 class LinkRelAttribute; 48 class LinkRelAttribute;
49 class NetworkHintsInterface; 49 class NetworkHintsInterface;
50 class PrerenderHandle; 50 class PrerenderHandle;
51 51
52 // The LinkLoader can load link rel types icon, dns-prefetch, subresource, prefe tch and prerender. 52 // The LinkLoader can load link rel types icon, dns-prefetch, subresource, prefe tch and prerender.
53 class CORE_EXPORT LinkLoader final : public ResourceOwner<Resource, ResourceClie nt>, public PrerenderClient { 53 class CORE_EXPORT LinkLoader final : public NoBaseWillBeGarbageCollectedFinalize d<LinkLoader>, public ResourceOwner<Resource, ResourceClient>, public PrerenderC lient {
54 DISALLOW_NEW(); 54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LinkLoader);
55 public: 55 public:
56 explicit LinkLoader(LinkLoaderClient*); 56 static PassOwnPtrWillBeRawPtr<LinkLoader> create(LinkLoaderClient* client)
57 {
58 return adoptPtrWillBeNoop(new LinkLoader(client));
59 }
57 ~LinkLoader() override; 60 ~LinkLoader() override;
58 61
59 // from ResourceClient 62 // from ResourceClient
60 void notifyFinished(Resource*) override; 63 void notifyFinished(Resource*) override;
61 String debugName() const override { return "LinkLoader"; } 64 String debugName() const override { return "LinkLoader"; }
62 65
63 // from PrerenderClient 66 // from PrerenderClient
64 void didStartPrerender() override; 67 void didStartPrerender() override;
65 void didStopPrerender() override; 68 void didStopPrerender() override;
66 void didSendLoadForPrerender() override; 69 void didSendLoadForPrerender() override;
67 void didSendDOMContentLoadedForPrerender() override; 70 void didSendDOMContentLoadedForPrerender() override;
68 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:
81 explicit LinkLoader(LinkLoaderClient*);
82
78 void linkLoadTimerFired(Timer<LinkLoader>*); 83 void linkLoadTimerFired(Timer<LinkLoader>*);
79 void linkLoadingErrorTimerFired(Timer<LinkLoader>*); 84 void linkLoadingErrorTimerFired(Timer<LinkLoader>*);
80 85
81 LinkLoaderClient* m_client; 86 LinkLoaderClient* m_client;
82 87
83 Timer<LinkLoader> m_linkLoadTimer; 88 Timer<LinkLoader> m_linkLoadTimer;
84 Timer<LinkLoader> m_linkLoadingErrorTimer; 89 Timer<LinkLoader> m_linkLoadingErrorTimer;
85 90
86 OwnPtrWillBeMember<PrerenderHandle> m_prerender; 91 OwnPtrWillBeMember<PrerenderHandle> m_prerender;
87 }; 92 };
88 93
89 } 94 }
90 95
91 #endif 96 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698