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

Unified Diff: third_party/WebKit/Source/core/frame/DOMWindowProperty.cpp

Issue 2388693002: Make DOMWindowProperty a thin wrapper of ContextLifecycleObserver
Patch Set: temp Created 4 years 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: third_party/WebKit/Source/core/frame/DOMWindowProperty.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMWindowProperty.cpp b/third_party/WebKit/Source/core/frame/DOMWindowProperty.cpp
index fef480ff8b701718e658ff44702fae26b1b6da03..07dc96440cc2dff41f658d8c0edd9930f8a52f54 100644
--- a/third_party/WebKit/Source/core/frame/DOMWindowProperty.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMWindowProperty.cpp
@@ -26,31 +26,17 @@
#include "core/frame/DOMWindowProperty.h"
-#include "core/frame/LocalDOMWindow.h"
+#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
namespace blink {
-DOMWindowProperty::DOMWindowProperty(LocalFrame* frame) : m_frame(frame) {
- // FIXME: For now it *is* acceptable for a DOMWindowProperty to be created
- // with a null frame. See fast/dom/navigator-detached-no-crash.html for the
- // recipe. We should fix that. <rdar://problem/11567132>
- if (m_frame) {
- // FIXME: Need to figure out what to do with DOMWindowProperties on
- // remote DOM windows.
- m_frame->domWindow()->registerProperty(this);
- }
-}
-
-void DOMWindowProperty::frameDestroyed() {
- // If the property is getting this callback it must have been
- // created with a LocalFrame and it should still have it.
- ASSERT(m_frame);
- m_frame = nullptr;
-}
+DOMWindowProperty::DOMWindowProperty(LocalFrame* frame)
+ : ContextLifecycleObserver(frame ? frame->document() : nullptr) {}
-DEFINE_TRACE(DOMWindowProperty) {
- visitor->trace(m_frame);
+LocalFrame* DOMWindowProperty::frame() const {
+ return getExecutionContext() ? toDocument(getExecutionContext())->frame()
+ : nullptr;
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindowProperty.h ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698