OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 PrerenderHandle::PrerenderHandle(Document& document, Prerender* prerender) | 61 PrerenderHandle::PrerenderHandle(Document& document, Prerender* prerender) |
62 : DocumentLifecycleObserver(&document) | 62 : DocumentLifecycleObserver(&document) |
63 , m_prerender(prerender) | 63 , m_prerender(prerender) |
64 { | 64 { |
65 } | 65 } |
66 | 66 |
67 PrerenderHandle::~PrerenderHandle() | 67 PrerenderHandle::~PrerenderHandle() |
68 { | 68 { |
69 if (m_prerender) | 69 if (m_prerender) { |
| 70 m_prerender->abandon(); |
70 detach(); | 71 detach(); |
| 72 } |
71 } | 73 } |
72 | 74 |
73 void PrerenderHandle::cancel() | 75 void PrerenderHandle::cancel() |
74 { | 76 { |
75 // Avoid both abandoning and canceling the same prerender. In the abandon ca
se, the LinkLoader cancels the | 77 // Avoid both abandoning and canceling the same prerender. In the abandon ca
se, the LinkLoader cancels the |
76 // PrerenderHandle as the Document is destroyed, even through the DocumentLi
fecycleObserver has already abandoned | 78 // PrerenderHandle as the Document is destroyed, even through the DocumentLi
fecycleObserver has already abandoned |
77 // it. | 79 // it. |
78 if (!m_prerender) | 80 if (!m_prerender) |
79 return; | 81 return; |
80 m_prerender->cancel(); | 82 m_prerender->cancel(); |
(...skipping 24 matching lines...) Expand all Loading... |
105 m_prerender.clear(); | 107 m_prerender.clear(); |
106 } | 108 } |
107 | 109 |
108 DEFINE_TRACE(PrerenderHandle) | 110 DEFINE_TRACE(PrerenderHandle) |
109 { | 111 { |
110 visitor->trace(m_prerender); | 112 visitor->trace(m_prerender); |
111 DocumentLifecycleObserver::trace(visitor); | 113 DocumentLifecycleObserver::trace(visitor); |
112 } | 114 } |
113 | 115 |
114 } // namespace blink | 116 } // namespace blink |
OLD | NEW |