| OLD | NEW |
| 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 Loading... |
| 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" | |
| 40 #include "platform/CrossOriginAttributeValue.h" | 39 #include "platform/CrossOriginAttributeValue.h" |
| 41 #include "platform/PrerenderClient.h" | 40 #include "platform/PrerenderClient.h" |
| 42 #include "platform/Timer.h" | 41 #include "platform/Timer.h" |
| 43 #include "platform/heap/Handle.h" | 42 #include "platform/heap/Handle.h" |
| 44 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
| 45 | 44 |
| 46 namespace blink { | 45 namespace blink { |
| 47 | 46 |
| 48 class Document; | 47 class Document; |
| 49 class LinkRelAttribute; | 48 class LinkRelAttribute; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 60 // from ResourceClient | 59 // from ResourceClient |
| 61 void notifyFinished(Resource*) override; | 60 void notifyFinished(Resource*) override; |
| 62 String debugName() const override { return "LinkLoader"; } | 61 String debugName() const override { return "LinkLoader"; } |
| 63 | 62 |
| 64 // from PrerenderClient | 63 // from PrerenderClient |
| 65 void didStartPrerender() override; | 64 void didStartPrerender() override; |
| 66 void didStopPrerender() override; | 65 void didStopPrerender() override; |
| 67 void didSendLoadForPrerender() override; | 66 void didSendLoadForPrerender() override; |
| 68 void didSendDOMContentLoadedForPrerender() override; | 67 void didSendDOMContentLoadedForPrerender() override; |
| 69 | 68 |
| 70 void triggerEvents(const Resource*); | |
| 71 | |
| 72 void released(); | 69 void released(); |
| 73 bool loadLink(const LinkRelAttribute&, CrossOriginAttributeValue, const Stri
ng& type, const String& as, const KURL&, Document&, const NetworkHintsInterface&
); | 70 bool loadLink(const LinkRelAttribute&, CrossOriginAttributeValue, const Stri
ng& type, const String& as, const KURL&, Document&, const NetworkHintsInterface&
); |
| 74 enum CanLoadResources { LoadResources, DoNotLoadResources }; | 71 enum CanLoadResources { LoadResources, DoNotLoadResources }; |
| 75 static bool loadLinkFromHeader(const String& headerValue, Document*, const N
etworkHintsInterface&, CanLoadResources); | 72 static bool loadLinkFromHeader(const String& headerValue, Document*, const N
etworkHintsInterface&, CanLoadResources); |
| 76 static Resource::Type getTypeFromAsAttribute(const String& as, Document*); | 73 static Resource::Type getTypeFromAsAttribute(const String& as, Document*); |
| 77 | 74 |
| 78 DECLARE_TRACE(); | 75 DECLARE_TRACE(); |
| 79 | 76 |
| 80 private: | 77 private: |
| 81 void linkLoadTimerFired(Timer<LinkLoader>*); | 78 void linkLoadTimerFired(Timer<LinkLoader>*); |
| 82 void linkLoadingErrorTimerFired(Timer<LinkLoader>*); | 79 void linkLoadingErrorTimerFired(Timer<LinkLoader>*); |
| 83 void createLinkPreloadResourceClient(ResourcePtr<Resource>); | |
| 84 | 80 |
| 85 LinkLoaderClient* m_client; | 81 LinkLoaderClient* m_client; |
| 86 | 82 |
| 87 Timer<LinkLoader> m_linkLoadTimer; | 83 Timer<LinkLoader> m_linkLoadTimer; |
| 88 Timer<LinkLoader> m_linkLoadingErrorTimer; | 84 Timer<LinkLoader> m_linkLoadingErrorTimer; |
| 89 | 85 |
| 90 OwnPtrWillBeMember<PrerenderHandle> m_prerender; | 86 OwnPtrWillBeMember<PrerenderHandle> m_prerender; |
| 91 OwnPtrWillBeMember<LinkPreloadResourceClient> m_linkPreloadResourceClient; | |
| 92 }; | 87 }; |
| 93 | 88 |
| 94 } | 89 } |
| 95 | 90 |
| 96 #endif | 91 #endif |
| OLD | NEW |