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

Side by Side Diff: Source/platform/AsyncMethodRunner.h

Issue 73993003: Make Notification override hasPendingActivity() to prolong its lifetime while async op is running (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Call stop() Created 7 years, 1 month 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/modules/notifications/Notification.cpp ('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) 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 m_runWhenResumed = false; 103 m_runWhenResumed = false;
104 m_suspended = false; 104 m_suspended = false;
105 return; 105 return;
106 } 106 }
107 107
108 ASSERT(!m_runWhenResumed); 108 ASSERT(!m_runWhenResumed);
109 if (m_timer.isActive()) 109 if (m_timer.isActive())
110 m_timer.stop(); 110 m_timer.stop();
111 } 111 }
112 112
113 bool isActive() const
114 {
115 return m_timer.isActive();
116 }
117
113 private: 118 private:
114 void fired(Timer<AsyncMethodRunner<TargetClass> >*) { (m_object->*m_method)( ); } 119 void fired(Timer<AsyncMethodRunner<TargetClass> >*) { (m_object->*m_method)( ); }
115 120
116 Timer<AsyncMethodRunner<TargetClass> > m_timer; 121 Timer<AsyncMethodRunner<TargetClass> > m_timer;
117 122
118 TargetClass* m_object; 123 TargetClass* m_object;
119 TargetMethod m_method; 124 TargetMethod m_method;
120 125
121 bool m_suspended; 126 bool m_suspended;
122 bool m_runWhenResumed; 127 bool m_runWhenResumed;
123 }; 128 };
124 129
125 } 130 }
126 131
127 #endif 132 #endif
OLDNEW
« no previous file with comments | « Source/modules/notifications/Notification.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698