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

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

Issue 1024543004: Disallow adding ContextLifecycleObservers during iteration. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tidier LifecycleObserver ctor Created 5 years, 9 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 | « Source/core/core.gypi ('k') | Source/core/dom/ContextLifecycleNotifier.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 * Copyright (C) 2013 Google Inc. All Rights Reserved. 3 * Copyright (C) 2013 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 23 matching lines...) Expand all
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class ActiveDOMObject; 37 class ActiveDOMObject;
38 class ContextLifecycleObserver; 38 class ContextLifecycleObserver;
39 class ExecutionContext; 39 class ExecutionContext;
40 40
41 class CORE_EXPORT ContextLifecycleNotifier : public LifecycleNotifier<ExecutionC ontext, ContextLifecycleObserver> { 41 class CORE_EXPORT ContextLifecycleNotifier : public LifecycleNotifier<ExecutionC ontext, ContextLifecycleObserver> {
42 WTF_MAKE_NONCOPYABLE(ContextLifecycleNotifier); 42 WTF_MAKE_NONCOPYABLE(ContextLifecycleNotifier);
43 public: 43 public:
44 void addObserver(ContextLifecycleObserver*);
45
46 void notifyResumingActiveDOMObjects(); 44 void notifyResumingActiveDOMObjects();
47 void notifySuspendingActiveDOMObjects(); 45 void notifySuspendingActiveDOMObjects();
48 void notifyStoppingActiveDOMObjects(); 46 void notifyStoppingActiveDOMObjects();
49 47
50 unsigned activeDOMObjectCount() const; 48 unsigned activeDOMObjectCount() const;
51 bool hasPendingActivity() const; 49 bool hasPendingActivity() const;
52 50
53 protected: 51 protected:
54 // Need a default constructor to link core and modules separately. 52 // Need a default constructor to link core and modules separately.
55 // If no default constructor, we will see an error: "constructor for 53 // If no default constructor, we will see an error: "constructor for
56 // 'blink::ExecutionContext' must explicitly initialize the base class 54 // 'blink::ExecutionContext' must explicitly initialize the base class
57 // 'blink::ContextLifecycleNotifier' which does not have a default 55 // 'blink::ContextLifecycleNotifier' which does not have a default
58 // constructor ExecutionContext::ExecutionContext()". 56 // constructor ExecutionContext::ExecutionContext()".
59 ContextLifecycleNotifier() { } 57 ContextLifecycleNotifier() { }
60 58
61 #if ENABLE(ASSERT) 59 #if ENABLE(ASSERT)
62 bool contains(ActiveDOMObject*) const; 60 bool contains(ActiveDOMObject*) const;
63 #endif 61 #endif
64 }; 62 };
65 63
66 } // namespace blink 64 } // namespace blink
67 65
68 #endif // ContextLifecycleNotifier_h 66 #endif // ContextLifecycleNotifier_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/ContextLifecycleNotifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698