Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef FrameProtector_h | |
| 6 #define FrameProtector_h | |
| 7 | |
| 8 #include "platform/heap/Handle.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 | |
| 12 class Frame; | |
| 13 class FrameView; | |
| 14 | |
| 15 class FrameProtector { | |
|
Mads Ager (chromium)
2014/09/03 10:07:54
Let's add a comment to FrameProtector stating that
| |
| 16 DISALLOW_ALLOCATION(); | |
| 17 public: | |
| 18 explicit FrameProtector(PassRefPtrWillBeRawPtr<Frame>); | |
| 19 ~FrameProtector(); | |
| 20 | |
| 21 bool willDispose() const; | |
| 22 | |
| 23 void trace(Visitor*); | |
|
Mads Ager (chromium)
2014/09/03 10:07:54
Trace is unimplemented? It is not used because Fra
zerny-chromium
2014/09/03 12:35:08
A stack allocated object may have parts that are a
sof
2014/09/03 14:28:28
It was an oversight not to add a trace() implement
| |
| 24 | |
| 25 private: | |
| 26 RefPtrWillBeMember<Frame> m_frame; | |
| 27 #if ENABLE(OILPAN) | |
| 28 bool m_isActive; | |
| 29 #endif | |
| 30 }; | |
| 31 | |
| 32 class FrameViewProtector { | |
| 33 STACK_ALLOCATED(); | |
| 34 public: | |
| 35 explicit FrameViewProtector(PassRefPtr<FrameView>); | |
| 36 ~FrameViewProtector(); | |
| 37 | |
| 38 bool willDelete() const; | |
| 39 | |
| 40 private: | |
| 41 RefPtr<FrameView> m_frameView; | |
| 42 #if ENABLE(OILPAN) | |
| 43 // With Oilpan, keep a protector for the FrameView' LocalFrame. | |
| 44 // This is to trigger any disposing of that frame which should | |
| 45 // happen when the FrameViewProtector goes out of scope. | |
| 46 // | |
| 47 // The RefPtr<LocalFrame> achieves this as it is non-Oilpan, | |
| 48 // so no need to keep an additional protector. | |
| 49 FrameProtector m_frameProtector; | |
| 50 #endif | |
| 51 }; | |
| 52 | |
| 53 } // namespace blink | |
| 54 | |
| 55 #endif // FrameProtector_h | |
| OLD | NEW |