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

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

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 years, 11 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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 DCHECK(context); 48 DCHECK(context);
49 } 49 }
50 50
51 SuspendableTimer::~SuspendableTimer() {} 51 SuspendableTimer::~SuspendableTimer() {}
52 52
53 void SuspendableTimer::stop() { 53 void SuspendableTimer::stop() {
54 m_nextFireInterval = kNextFireIntervalInvalid; 54 m_nextFireInterval = kNextFireIntervalInvalid;
55 TimerBase::stop(); 55 TimerBase::stop();
56 } 56 }
57 57
58 void SuspendableTimer::contextDestroyed() { 58 void SuspendableTimer::contextDestroyed(ExecutionContext*) {
59 stop(); 59 stop();
60 } 60 }
61 61
62 void SuspendableTimer::suspend() { 62 void SuspendableTimer::suspend() {
63 #if ENABLE(ASSERT) 63 #if ENABLE(ASSERT)
64 ASSERT(!m_suspended); 64 ASSERT(!m_suspended);
65 m_suspended = true; 65 m_suspended = true;
66 #endif 66 #endif
67 if (isActive()) { 67 if (isActive()) {
68 m_nextFireInterval = nextFireInterval(); 68 m_nextFireInterval = nextFireInterval();
(...skipping 10 matching lines...) Expand all
79 #endif 79 #endif
80 if (m_nextFireInterval >= 0.0) { 80 if (m_nextFireInterval >= 0.0) {
81 // start() was called before, therefore location() is already set. 81 // start() was called before, therefore location() is already set.
82 // m_nextFireInterval is only set in suspend() if the Timer was active. 82 // m_nextFireInterval is only set in suspend() if the Timer was active.
83 start(m_nextFireInterval, m_repeatInterval, location()); 83 start(m_nextFireInterval, m_repeatInterval, location());
84 m_nextFireInterval = kNextFireIntervalInvalid; 84 m_nextFireInterval = kNextFireIntervalInvalid;
85 } 85 }
86 } 86 }
87 87
88 } // namespace blink 88 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/SuspendableTimer.h ('k') | third_party/WebKit/Source/core/html/AutoplayUmaHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698