Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ActiveScriptWrappable_h | 5 #ifndef ActiveScriptWrappable_h |
| 6 #define ActiveScriptWrappable_h | 6 #define ActiveScriptWrappable_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "platform/wtf/Noncopyable.h" | 10 #include "platform/wtf/Noncopyable.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 template <typename T> | 42 template <typename T> |
| 43 class ActiveScriptWrappable : public ActiveScriptWrappableBase { | 43 class ActiveScriptWrappable : public ActiveScriptWrappableBase { |
| 44 WTF_MAKE_NONCOPYABLE(ActiveScriptWrappable); | 44 WTF_MAKE_NONCOPYABLE(ActiveScriptWrappable); |
| 45 | 45 |
| 46 public: | 46 public: |
| 47 ActiveScriptWrappable() {} | 47 ActiveScriptWrappable() {} |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 bool IsContextDestroyed(ActiveScriptWrappableBase* object) const final { | 50 bool IsContextDestroyed(ActiveScriptWrappableBase* object) const final { |
| 51 return !(static_cast<T*>(object)->T::GetExecutionContext)() || | 51 return !(static_cast<T*>(object)->T::GetExecutionContext)() || |
| 52 (static_cast<T*>(object)->T::GetExecutionContext)() | 52 (static_cast<T*>(object)->T::GetExecutionContext)() |
|
hiroshige
2017/05/30 08:52:51
Not blocking https://codereview.chromium.org/29052
| |
| 53 ->IsContextDestroyed(); | 53 ->IsContextDestroyed(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool DispatchHasPendingActivity( | 56 bool DispatchHasPendingActivity( |
| 57 ActiveScriptWrappableBase* object) const final { | 57 ActiveScriptWrappableBase* object) const final { |
| 58 return static_cast<T*>(object)->T::HasPendingActivity(); | 58 return static_cast<T*>(object)->HasPendingActivity(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 ScriptWrappable* ToScriptWrappable( | 61 ScriptWrappable* ToScriptWrappable( |
| 62 ActiveScriptWrappableBase* object) const final { | 62 ActiveScriptWrappableBase* object) const final { |
| 63 return static_cast<T*>(object); | 63 return static_cast<T*>(object); |
| 64 } | 64 } |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| 68 | 68 |
| 69 #endif // ActiveScriptWrappable_h | 69 #endif // ActiveScriptWrappable_h |
| OLD | NEW |