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

Side by Side Diff: Source/core/dom/ScriptExecutionContext.h

Issue 19494002: Distinguish actions registered with setTimeout() and setInterval(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test, and add a new test. Created 7 years, 5 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 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>) = 0; 167 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>) = 0;
168 bool dispatchErrorEvent(const String& errorMessage, int lineNumber, const St ring& sourceURL, CachedScript*); 168 bool dispatchErrorEvent(const String& errorMessage, int lineNumber, const St ring& sourceURL, CachedScript*);
169 169
170 void closeMessagePorts(); 170 void closeMessagePorts();
171 171
172 virtual void refScriptExecutionContext() = 0; 172 virtual void refScriptExecutionContext() = 0;
173 virtual void derefScriptExecutionContext() = 0; 173 virtual void derefScriptExecutionContext() = 0;
174 virtual PassOwnPtr<ContextLifecycleNotifier> createLifecycleNotifier(); 174 virtual PassOwnPtr<ContextLifecycleNotifier> createLifecycleNotifier();
175 175
176 // Implementation details for DOMTimer. No other classes should call these f unctions. 176 // Implementation details for DOMTimer. No other classes should call these f unctions.
177 int installNewTimeout(PassOwnPtr<ScheduledAction>, int timeout, bool singleS hot); 177 int installNewTimeout(DOMTimer::TimerType, PassOwnPtr<ScheduledAction>, int timeout);
178 void removeTimeoutByID(int timeoutID); // This makes underlying DOMTimer ins tance destructed. 178 void removeTimeoutByIDIfTypeMatches(DOMTimer::TimerType, int timeoutID); // This makes underlying DOMTimer instance destructed.
179 179
180 HashSet<MessagePort*> m_messagePorts; 180 HashSet<MessagePort*> m_messagePorts;
181 181
182 int m_circularSequentialID; 182 int m_circularSequentialID;
183 typedef HashMap<int, OwnPtr<DOMTimer> > TimeoutMap; 183 typedef HashMap<int, OwnPtr<DOMTimer> > TimeoutMap;
184 TimeoutMap m_timeouts; 184 TimeoutMap m_timeouts;
185 185
186 bool m_inDispatchErrorEvent; 186 bool m_inDispatchErrorEvent;
187 class PendingException; 187 class PendingException;
188 OwnPtr<Vector<OwnPtr<PendingException> > > m_pendingExceptions; 188 OwnPtr<Vector<OwnPtr<PendingException> > > m_pendingExceptions;
189 189
190 bool m_activeDOMObjectsAreSuspended; 190 bool m_activeDOMObjectsAreSuspended;
191 ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects; 191 ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects;
192 bool m_activeDOMObjectsAreStopped; 192 bool m_activeDOMObjectsAreStopped;
193 193
194 OwnPtr<PublicURLManager> m_publicURLManager; 194 OwnPtr<PublicURLManager> m_publicURLManager;
195 195
196 RefPtr<DatabaseContext> m_databaseContext; 196 RefPtr<DatabaseContext> m_databaseContext;
197 197
198 // The location of this member is important; to make sure contextDestroyed() notification on 198 // The location of this member is important; to make sure contextDestroyed() notification on
199 // ScriptExecutionContext's members (notably m_timeouts) is called before th ey are destructed, 199 // ScriptExecutionContext's members (notably m_timeouts) is called before th ey are destructed,
200 // m_lifecycleNotifer should be placed *after* such members. 200 // m_lifecycleNotifer should be placed *after* such members.
201 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; 201 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier;
202 }; 202 };
203 203
204 } // namespace WebCore 204 } // namespace WebCore
205 205
206 #endif // ScriptExecutionContext_h 206 #endif // ScriptExecutionContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698