| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 if (!m_prerender) | 82 if (!m_prerender) |
| 83 return; | 83 return; |
| 84 m_prerender->cancel(); | 84 m_prerender->cancel(); |
| 85 detach(); | 85 detach(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 const KURL& PrerenderHandle::url() const { | 88 const KURL& PrerenderHandle::url() const { |
| 89 return m_prerender->url(); | 89 return m_prerender->url(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void PrerenderHandle::contextDestroyed() { | 92 void PrerenderHandle::contextDestroyed(ExecutionContext*) { |
| 93 // A PrerenderHandle is not removed from LifecycleNotifier::m_observers until | 93 // A PrerenderHandle is not removed from LifecycleNotifier::m_observers until |
| 94 // the next GC runs. Thus contextDestroyed() can be called for a | 94 // the next GC runs. Thus contextDestroyed() can be called for a |
| 95 // PrerenderHandle that is already cancelled (and thus detached). In that | 95 // PrerenderHandle that is already cancelled (and thus detached). In that |
| 96 // case, we should not detach the PrerenderHandle again. | 96 // case, we should not detach the PrerenderHandle again. |
| 97 if (!m_prerender) | 97 if (!m_prerender) |
| 98 return; | 98 return; |
| 99 m_prerender->abandon(); | 99 m_prerender->abandon(); |
| 100 detach(); | 100 detach(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void PrerenderHandle::detach() { | 103 void PrerenderHandle::detach() { |
| 104 m_prerender->dispose(); | 104 m_prerender->dispose(); |
| 105 m_prerender.clear(); | 105 m_prerender.clear(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 DEFINE_TRACE(PrerenderHandle) { | 108 DEFINE_TRACE(PrerenderHandle) { |
| 109 visitor->trace(m_prerender); | 109 visitor->trace(m_prerender); |
| 110 ContextLifecycleObserver::trace(visitor); | 110 ContextLifecycleObserver::trace(visitor); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |