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

Unified Diff: Source/core/frame/FrameDestructionObserver.cpp

Issue 1017313002: Simplify handling of LocalFrame lifecycle notifications. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clear context on FDO::contextDestroyed() 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/FrameDestructionObserver.cpp
diff --git a/Source/core/frame/FrameDestructionObserver.cpp b/Source/core/frame/FrameDestructionObserver.cpp
index 501d9b2d3dad3f6e566191bd4f94277e20f8bf25..2d6c71521994a24c810d81acf70305e03f69d6d4 100644
--- a/Source/core/frame/FrameDestructionObserver.cpp
+++ b/Source/core/frame/FrameDestructionObserver.cpp
@@ -31,32 +31,8 @@
namespace blink {
FrameDestructionObserver::FrameDestructionObserver(LocalFrame* frame)
- : m_frame(nullptr)
{
- observeFrame(frame);
-}
-
-#if !ENABLE(OILPAN)
-FrameDestructionObserver::~FrameDestructionObserver()
-{
- observeFrame(nullptr);
-}
-#endif
-
-void FrameDestructionObserver::observeFrame(LocalFrame* frame)
-{
- if (m_frame)
- m_frame->removeDestructionObserver(this);
-
- m_frame = frame;
-
- if (m_frame)
- m_frame->addDestructionObserver(this);
-}
-
-void FrameDestructionObserver::frameDestroyed()
-{
- m_frame = nullptr;
+ setContext(frame);
}
void FrameDestructionObserver::willDetachFrameHost()
@@ -64,9 +40,4 @@ void FrameDestructionObserver::willDetachFrameHost()
// Subclasses should override this function to handle this notification.
}
-DEFINE_TRACE(FrameDestructionObserver)
-{
- visitor->trace(m_frame);
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698