Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 15 matching lines...) Expand all Loading... | |
| 26 | 26 |
| 27 #ifndef ContextLifecycleObserver_h | 27 #ifndef ContextLifecycleObserver_h |
| 28 #define ContextLifecycleObserver_h | 28 #define ContextLifecycleObserver_h |
| 29 | 29 |
| 30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
| 31 #include "core/dom/ExecutionContext.h" | 31 #include "core/dom/ExecutionContext.h" |
| 32 #include "platform/LifecycleObserver.h" | 32 #include "platform/LifecycleObserver.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class LocalFrame; | |
| 37 | |
| 36 class CORE_EXPORT ContextLifecycleObserver | 38 class CORE_EXPORT ContextLifecycleObserver |
| 37 : public LifecycleObserver<ExecutionContext, ContextLifecycleObserver> { | 39 : public LifecycleObserver<ExecutionContext, ContextLifecycleObserver> { |
| 38 public: | 40 public: |
| 39 ExecutionContext* getExecutionContext() const { return lifecycleContext(); } | 41 ExecutionContext* getExecutionContext() const { return lifecycleContext(); } |
| 42 LocalFrame* frame() const; | |
|
sof
2016/12/12 06:35:26
Add a short comment stating when you can expect th
| |
| 40 | 43 |
| 41 enum Type { | 44 enum Type { |
| 42 GenericType, | 45 GenericType, |
| 43 ActiveDOMObjectType, | 46 ActiveDOMObjectType, |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 Type observerType() const { return m_observerType; } | 49 Type observerType() const { return m_observerType; } |
| 47 | 50 |
| 48 protected: | 51 protected: |
| 49 explicit ContextLifecycleObserver(ExecutionContext* executionContext, | 52 explicit ContextLifecycleObserver(ExecutionContext* executionContext, |
| 50 Type type = GenericType) | 53 Type type = GenericType) |
| 51 : LifecycleObserver(executionContext), m_observerType(type) {} | 54 : LifecycleObserver(executionContext), m_observerType(type) {} |
| 52 | 55 |
| 53 private: | 56 private: |
| 54 Type m_observerType; | 57 Type m_observerType; |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 } // namespace blink | 60 } // namespace blink |
| 58 | 61 |
| 59 #endif // ContextLifecycleObserver_h | 62 #endif // ContextLifecycleObserver_h |
| OLD | NEW |