Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: third_party/WebKit/Source/core/loader/PrerenderHandle.cpp

Issue 1872383002: Abandon Prerender upon finalizing PrerenderHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust abandon() call site Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698