Commit 21fd0270 authored by haraken's avatar haraken Committed by Commit bot

Remove ContextClient from DOMWindowPerformance

Now that DOMWindowPerformance can access DOMWindow with host(),
DOMWindowPerformance doesn't need to observe ContextClient.

This CL removes DOMWindowPerformance::m_window.

BUG=610176

Review-Url: https://codereview.chromium.org/2615633011
Cr-Commit-Position: refs/heads/master@{#441902}
parent 1c14e5b9
...@@ -11,13 +11,11 @@ ...@@ -11,13 +11,11 @@
namespace blink { namespace blink {
DOMWindowPerformance::DOMWindowPerformance(LocalDOMWindow& window) DOMWindowPerformance::DOMWindowPerformance(LocalDOMWindow& window)
: ContextClient(window.frame()), m_window(&window) {} : Supplement<LocalDOMWindow>(window) {}
DEFINE_TRACE(DOMWindowPerformance) { DEFINE_TRACE(DOMWindowPerformance) {
visitor->trace(m_window);
visitor->trace(m_performance); visitor->trace(m_performance);
Supplement<LocalDOMWindow>::trace(visitor); Supplement<LocalDOMWindow>::trace(visitor);
ContextClient::trace(visitor);
} }
// static // static
...@@ -43,7 +41,7 @@ Performance* DOMWindowPerformance::performance(DOMWindow& window) { ...@@ -43,7 +41,7 @@ Performance* DOMWindowPerformance::performance(DOMWindow& window) {
Performance* DOMWindowPerformance::performance() { Performance* DOMWindowPerformance::performance() {
if (!m_performance) if (!m_performance)
m_performance = Performance::create(m_window->frame()); m_performance = Performance::create(host()->frame());
return m_performance.get(); return m_performance.get();
} }
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define DOMWindowPerformance_h #define DOMWindowPerformance_h
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalDOMWindow.h"
#include "platform/Supplementable.h" #include "platform/Supplementable.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
...@@ -15,13 +14,11 @@ ...@@ -15,13 +14,11 @@
namespace blink { namespace blink {
class DOMWindow; class DOMWindow;
class LocalDOMWindow;
class Performance; class Performance;
class CORE_EXPORT DOMWindowPerformance final class CORE_EXPORT DOMWindowPerformance final
: public GarbageCollected<DOMWindowPerformance>, : public GarbageCollected<DOMWindowPerformance>,
public Supplement<LocalDOMWindow>, public Supplement<LocalDOMWindow> {
public ContextClient {
USING_GARBAGE_COLLECTED_MIXIN(DOMWindowPerformance); USING_GARBAGE_COLLECTED_MIXIN(DOMWindowPerformance);
WTF_MAKE_NONCOPYABLE(DOMWindowPerformance); WTF_MAKE_NONCOPYABLE(DOMWindowPerformance);
...@@ -37,8 +34,6 @@ class CORE_EXPORT DOMWindowPerformance final ...@@ -37,8 +34,6 @@ class CORE_EXPORT DOMWindowPerformance final
Performance* performance(); Performance* performance();
// TODO(sof): try to move this direct reference and instead rely on frame().
Member<LocalDOMWindow> m_window;
Member<Performance> m_performance; Member<Performance> m_performance;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment