Chromium Code Reviews| 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 27 matching lines...) Expand all Loading... | |
| 38 #include "core/loader/LinkLoaderClient.h" | 38 #include "core/loader/LinkLoaderClient.h" |
| 39 #include "platform/PrerenderClient.h" | 39 #include "platform/PrerenderClient.h" |
| 40 #include "platform/Timer.h" | 40 #include "platform/Timer.h" |
| 41 #include "platform/heap/Handle.h" | 41 #include "platform/heap/Handle.h" |
| 42 #include "wtf/OwnPtr.h" | 42 #include "wtf/OwnPtr.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class Document; | 46 class Document; |
| 47 class LinkRelAttribute; | 47 class LinkRelAttribute; |
| 48 class NetworkHintsInterface; | |
| 48 class PrerenderHandle; | 49 class PrerenderHandle; |
| 49 | 50 |
| 50 // The LinkLoader can load link rel types icon, dns-prefetch, subresource, prefe tch and prerender. | 51 // The LinkLoader can load link rel types icon, dns-prefetch, subresource, prefe tch and prerender. |
| 51 class CORE_EXPORT LinkLoader final : public ResourceOwner<Resource, ResourceClie nt>, public PrerenderClient { | 52 class CORE_EXPORT LinkLoader final : public ResourceOwner<Resource, ResourceClie nt>, public PrerenderClient { |
| 52 DISALLOW_ALLOCATION(); | 53 DISALLOW_ALLOCATION(); |
| 53 public: | 54 public: |
| 55 | |
|
Mike West
2015/07/23 09:52:23
Nit: No newline.
| |
| 54 explicit LinkLoader(LinkLoaderClient*); | 56 explicit LinkLoader(LinkLoaderClient*); |
| 55 virtual ~LinkLoader(); | 57 virtual ~LinkLoader(); |
| 56 | 58 |
| 57 // from ResourceClient | 59 // from ResourceClient |
| 58 virtual void notifyFinished(Resource*) override; | 60 virtual void notifyFinished(Resource*) override; |
| 59 | 61 |
| 60 // from PrerenderClient | 62 // from PrerenderClient |
| 61 virtual void didStartPrerender() override; | 63 virtual void didStartPrerender() override; |
| 62 virtual void didStopPrerender() override; | 64 virtual void didStopPrerender() override; |
| 63 virtual void didSendLoadForPrerender() override; | 65 virtual void didSendLoadForPrerender() override; |
| 64 virtual void didSendDOMContentLoadedForPrerender() override; | 66 virtual void didSendDOMContentLoadedForPrerender() override; |
| 65 | 67 |
| 66 void released(); | 68 void released(); |
| 67 bool loadLink(const LinkRelAttribute&, const AtomicString& crossOriginMode, const String& type, const String& as, const KURL&, Document&); | 69 bool loadLink(const LinkRelAttribute&, const AtomicString& crossOriginMode, const String& type, const String& as, const KURL&, Document&, const NetworkHints Interface&); |
| 68 static bool loadLinkFromHeader(const String& headerValue, Document*); | 70 static bool loadLinkFromHeader(const String& headerValue, Document*, const N etworkHintsInterface&); |
| 69 | 71 |
| 70 DECLARE_TRACE(); | 72 DECLARE_TRACE(); |
| 71 | 73 |
| 72 private: | 74 private: |
| 73 void linkLoadTimerFired(Timer<LinkLoader>*); | 75 void linkLoadTimerFired(Timer<LinkLoader>*); |
| 74 void linkLoadingErrorTimerFired(Timer<LinkLoader>*); | 76 void linkLoadingErrorTimerFired(Timer<LinkLoader>*); |
| 75 void preloadIfNeeded(const LinkRelAttribute&, const KURL& href, Document&, c onst String& as); | 77 void preloadIfNeeded(const LinkRelAttribute&, const KURL& href, Document&, c onst String& as); |
| 76 | 78 |
| 77 LinkLoaderClient* m_client; | 79 LinkLoaderClient* m_client; |
| 78 | 80 |
| 79 Timer<LinkLoader> m_linkLoadTimer; | 81 Timer<LinkLoader> m_linkLoadTimer; |
| 80 Timer<LinkLoader> m_linkLoadingErrorTimer; | 82 Timer<LinkLoader> m_linkLoadingErrorTimer; |
| 81 | 83 |
| 82 OwnPtrWillBeMember<PrerenderHandle> m_prerender; | 84 OwnPtrWillBeMember<PrerenderHandle> m_prerender; |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 } | 87 } |
| 86 | 88 |
| 87 #endif | 89 #endif |
| OLD | NEW |