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

Side by Side Diff: third_party/WebKit/Source/core/frame/DOMTimer.cpp

Issue 1959013002: Eagerly remove disposed DOMTimers as observers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp » ('j') | 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 DOMTimer::~DOMTimer() 90 DOMTimer::~DOMTimer()
91 { 91 {
92 } 92 }
93 93
94 void DOMTimer::disposeTimer() 94 void DOMTimer::disposeTimer()
95 { 95 {
96 m_action = nullptr; 96 m_action = nullptr;
97 m_userGestureToken = nullptr; 97 m_userGestureToken = nullptr;
98 stop(); 98 stop();
99 clearContext();
99 } 100 }
100 101
101 void DOMTimer::fired() 102 void DOMTimer::fired()
102 { 103 {
103 ExecutionContext* context = getExecutionContext(); 104 ExecutionContext* context = getExecutionContext();
104 ASSERT(context); 105 ASSERT(context);
105 context->timers()->setTimerNestingLevel(m_nestingLevel); 106 context->timers()->setTimerNestingLevel(m_nestingLevel);
106 ASSERT(!context->activeDOMObjectsAreSuspended()); 107 ASSERT(!context->activeDOMObjectsAreSuspended());
107 // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator. 108 // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
108 UserGestureIndicator gestureIndicator(m_userGestureToken.release()); 109 UserGestureIndicator gestureIndicator(m_userGestureToken.release());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return getExecutionContext()->timers()->timerTaskRunner(); 154 return getExecutionContext()->timers()->timerTaskRunner();
154 } 155 }
155 156
156 DEFINE_TRACE(DOMTimer) 157 DEFINE_TRACE(DOMTimer)
157 { 158 {
158 visitor->trace(m_action); 159 visitor->trace(m_action);
159 SuspendableTimer::trace(visitor); 160 SuspendableTimer::trace(visitor);
160 } 161 }
161 162
162 } // namespace blink 163 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698