OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 Loading... |
43 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 class WebPrerender; | 46 class WebPrerender; |
47 } | 47 } |
48 | 48 |
49 namespace WebCore { | 49 namespace WebCore { |
50 | 50 |
51 class PrerenderClient; | 51 class PrerenderClient; |
52 | 52 |
| 53 // PrerenderRelType is a bitfield since multiple rel attributes can be set |
| 54 // on the same link. |
| 55 enum PrerenderRelType { |
| 56 PrerenderRelTypePrerender = 0x1, |
| 57 PrerenderRelTypeNext = 0x2, |
| 58 }; |
| 59 |
53 class PLATFORM_EXPORT Prerender : public RefCounted<Prerender> { | 60 class PLATFORM_EXPORT Prerender : public RefCounted<Prerender> { |
54 WTF_MAKE_NONCOPYABLE(Prerender); | 61 WTF_MAKE_NONCOPYABLE(Prerender); |
55 public: | 62 public: |
56 class ExtraData : public RefCounted<ExtraData> { | 63 class ExtraData : public RefCounted<ExtraData> { |
57 public: | 64 public: |
58 virtual ~ExtraData() { } | 65 virtual ~ExtraData() { } |
59 }; | 66 }; |
60 | 67 |
61 static PassRefPtr<Prerender> create(PrerenderClient*, const KURL&, const Str
ing& referrer, ReferrerPolicy); | 68 static PassRefPtr<Prerender> create(PrerenderClient*, const KURL&, unsigned
relTypes, const String& referrer, ReferrerPolicy); |
62 ~Prerender(); | 69 ~Prerender(); |
63 | 70 |
64 void removeClient(); | 71 void removeClient(); |
65 | 72 |
66 void add(); | 73 void add(); |
67 void cancel(); | 74 void cancel(); |
68 void abandon(); | 75 void abandon(); |
69 | 76 |
70 const KURL& url() const { return m_url; } | 77 const KURL& url() const { return m_url; } |
| 78 unsigned relTypes() const { return m_relTypes; } |
71 const String& referrer() const { return m_referrer; } | 79 const String& referrer() const { return m_referrer; } |
72 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } | 80 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } |
73 | 81 |
74 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData
; } | 82 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData
; } |
75 ExtraData* extraData() { return m_extraData.get(); } | 83 ExtraData* extraData() { return m_extraData.get(); } |
76 | 84 |
77 void didStartPrerender(); | 85 void didStartPrerender(); |
78 void didStopPrerender(); | 86 void didStopPrerender(); |
79 void didSendLoadForPrerender(); | 87 void didSendLoadForPrerender(); |
80 void didSendDOMContentLoadedForPrerender(); | 88 void didSendDOMContentLoadedForPrerender(); |
81 | 89 |
82 private: | 90 private: |
83 Prerender(PrerenderClient*, const KURL&, const String& referrer, ReferrerPol
icy); | 91 Prerender(PrerenderClient*, const KURL&, unsigned relTypes, const String& re
ferrer, ReferrerPolicy); |
84 | 92 |
85 PrerenderClient* m_client; | 93 PrerenderClient* m_client; |
86 | 94 |
87 const KURL m_url; | 95 const KURL m_url; |
| 96 const unsigned m_relTypes; |
88 const String m_referrer; | 97 const String m_referrer; |
89 const ReferrerPolicy m_referrerPolicy; | 98 const ReferrerPolicy m_referrerPolicy; |
90 | 99 |
91 RefPtr<ExtraData> m_extraData; | 100 RefPtr<ExtraData> m_extraData; |
92 }; | 101 }; |
93 | 102 |
94 } | 103 } |
95 | 104 |
96 #endif // Prerender_h | 105 #endif // Prerender_h |
OLD | NEW |