Commit 3006a20f authored by haraken's avatar haraken Committed by Commit bot

Remove DOMWindowProperty from PresentationController

We're deprecating DOMWindowProperty, which is now equivalent to ContextLifecycleObserver.
This CL replaces DOMWindowProperty with ContextLifecycleObserver in PresentationController.

BUG=610176

Review-Url: https://codereview.chromium.org/2569963003
Cr-Commit-Position: refs/heads/master@{#438114}
parent 389790dd
......@@ -4,6 +4,7 @@
#include "modules/presentation/PresentationController.h"
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
#include "modules/presentation/PresentationConnection.h"
#include "public/platform/modules/presentation/WebPresentationClient.h"
......@@ -14,7 +15,7 @@ namespace blink {
PresentationController::PresentationController(LocalFrame& frame,
WebPresentationClient* client)
: DOMWindowProperty(&frame), m_client(client) {
: ContextLifecycleObserver(frame.document()), m_client(client) {
if (m_client)
m_client->setController(this);
}
......@@ -58,7 +59,7 @@ DEFINE_TRACE(PresentationController) {
visitor->trace(m_presentation);
visitor->trace(m_connections);
Supplement<LocalFrame>::trace(visitor);
DOMWindowProperty::trace(visitor);
ContextLifecycleObserver::trace(visitor);
}
void PresentationController::didStartDefaultSession(
......@@ -140,12 +141,11 @@ void PresentationController::registerConnection(
m_connections.add(connection);
}
void PresentationController::frameDestroyed() {
void PresentationController::contextDestroyed() {
if (m_client) {
m_client->setController(nullptr);
m_client = nullptr;
}
DOMWindowProperty::frameDestroyed();
}
PresentationConnection* PresentationController::findConnection(
......
......@@ -5,7 +5,7 @@
#ifndef PresentationController_h
#define PresentationController_h
#include "core/frame/DOMWindowProperty.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "core/frame/LocalFrame.h"
#include "modules/ModulesExport.h"
#include "modules/presentation/Presentation.h"
......@@ -27,7 +27,7 @@ enum class WebPresentationConnectionState;
class MODULES_EXPORT PresentationController final
: public GarbageCollectedFinalized<PresentationController>,
public Supplement<LocalFrame>,
public DOMWindowProperty,
public ContextLifecycleObserver,
public WebPresentationController {
USING_GARBAGE_COLLECTED_MIXIN(PresentationController);
WTF_MAKE_NONCOPYABLE(PresentationController);
......@@ -76,8 +76,8 @@ class MODULES_EXPORT PresentationController final
private:
PresentationController(LocalFrame&, WebPresentationClient*);
// Implementation of DOMWindowProperty.
void frameDestroyed() override;
// Implementation of ContextLifecycleObserver.
void contextDestroyed() override;
// Return the connection associated with the given |connectionClient| or
// null if it doesn't exist.
......
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