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

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

Issue 766183004: Dispose of DOMTimer upon explicit ExecutionContext unregistration. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 | « Source/core/frame/DOMTimer.h ('k') | 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) 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (singleShot) 101 if (singleShot)
102 startOneShot(intervalMilliseconds, FROM_HERE); 102 startOneShot(intervalMilliseconds, FROM_HERE);
103 else 103 else
104 startRepeating(intervalMilliseconds, FROM_HERE); 104 startRepeating(intervalMilliseconds, FROM_HERE);
105 } 105 }
106 106
107 DOMTimer::~DOMTimer() 107 DOMTimer::~DOMTimer()
108 { 108 {
109 } 109 }
110 110
111 void DOMTimer::dispose()
112 {
113 m_action = nullptr;
114 m_userGestureToken = nullptr;
115 stop();
116 }
117
111 int DOMTimer::timeoutID() const 118 int DOMTimer::timeoutID() const
112 { 119 {
113 return m_timeoutID; 120 return m_timeoutID;
114 } 121 }
115 122
116 void DOMTimer::fired() 123 void DOMTimer::fired()
117 { 124 {
118 ExecutionContext* context = executionContext(); 125 ExecutionContext* context = executionContext();
119 context->setTimerNestingLevel(m_nestingLevel); 126 context->setTimerNestingLevel(m_nestingLevel);
120 ASSERT(!context->activeDOMObjectsAreSuspended()); 127 ASSERT(!context->activeDOMObjectsAreSuspended());
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (fireTime - alignedTimeRoundedDown < minimumInterval) 213 if (fireTime - alignedTimeRoundedDown < minimumInterval)
207 return alignedTimeRoundedDown; 214 return alignedTimeRoundedDown;
208 215
209 return alignedTimeRoundedUp; 216 return alignedTimeRoundedUp;
210 } 217 }
211 218
212 return fireTime; 219 return fireTime;
213 } 220 }
214 221
215 } // namespace blink 222 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/DOMTimer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698