| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #ifndef ContextLifecycleNotifier_h | 28 #ifndef ContextLifecycleNotifier_h |
| 29 #define ContextLifecycleNotifier_h | 29 #define ContextLifecycleNotifier_h |
| 30 | 30 |
| 31 #include "core/CoreExport.h" | 31 #include "core/CoreExport.h" |
| 32 #include "platform/LifecycleNotifier.h" | 32 #include "platform/LifecycleNotifier.h" |
| 33 #include "wtf/Noncopyable.h" | 33 #include "wtf/Noncopyable.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class ActiveDOMObject; | 37 class SuspendableObject; |
| 38 class ContextLifecycleObserver; | 38 class ContextLifecycleObserver; |
| 39 class ExecutionContext; | 39 class ExecutionContext; |
| 40 | 40 |
| 41 class CORE_EXPORT ContextLifecycleNotifier | 41 class CORE_EXPORT ContextLifecycleNotifier |
| 42 : public LifecycleNotifier<ExecutionContext, ContextLifecycleObserver> { | 42 : public LifecycleNotifier<ExecutionContext, ContextLifecycleObserver> { |
| 43 WTF_MAKE_NONCOPYABLE(ContextLifecycleNotifier); | 43 WTF_MAKE_NONCOPYABLE(ContextLifecycleNotifier); |
| 44 | 44 |
| 45 public: | 45 public: |
| 46 void notifyResumingActiveDOMObjects(); | 46 void notifyResumingSuspendableObjects(); |
| 47 void notifySuspendingActiveDOMObjects(); | 47 void notifySuspendingSuspendableObjects(); |
| 48 | 48 |
| 49 unsigned activeDOMObjectCount() const; | 49 unsigned activeDOMObjectCount() const; |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 // Need a default constructor to link core and modules separately. | 52 // Need a default constructor to link core and modules separately. |
| 53 // If no default constructor, we will see an error: "constructor for | 53 // If no default constructor, we will see an error: "constructor for |
| 54 // 'blink::ExecutionContext' must explicitly initialize the base class | 54 // 'blink::ExecutionContext' must explicitly initialize the base class |
| 55 // 'blink::ContextLifecycleNotifier' which does not have a default | 55 // 'blink::ContextLifecycleNotifier' which does not have a default |
| 56 // constructor ExecutionContext::ExecutionContext()". | 56 // constructor ExecutionContext::ExecutionContext()". |
| 57 ContextLifecycleNotifier() {} | 57 ContextLifecycleNotifier() {} |
| 58 | 58 |
| 59 #if DCHECK_IS_ON() | 59 #if DCHECK_IS_ON() |
| 60 bool contains(ActiveDOMObject*) const; | 60 bool contains(SuspendableObject*) const; |
| 61 #endif | 61 #endif |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| 65 | 65 |
| 66 #endif // ContextLifecycleNotifier_h | 66 #endif // ContextLifecycleNotifier_h |
| OLD | NEW |