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

Unified Diff: third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp

Issue 2562303002: Add ContextLifecycleObserver::frame() (Closed)
Patch Set: 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/dom/ContextLifecycleObserver.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..24fcf42d9f4b506da5f42dddf9ec8a94d279ff71
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/dom/ContextLifecycleObserver.h"
+
+#include "core/dom/Document.h"
+#include "core/frame/LocalFrame.h"
+
+namespace blink {
+
+LocalFrame* ContextLifecycleObserver::frame() const {
+ return getExecutionContext() && getExecutionContext()->isDocument()
+ ? toDocument(getExecutionContext())->frame()
+ : nullptr;
+}
+}

Powered by Google App Engine
This is Rietveld 408576698