Commit ffcf2b75 authored by Johann's avatar Johann Committed by Commit Bot

presentation controller: remove execution context

The PresentationController class does not need
ExecutionContextLifecycleObserver since the mojo::Receiver was migrated
to HeapMojoReceiver. The replacement wrapper includes management of the
presentation_controller_receiver_.

Change-Id: I1c96f897a7b604a23d3e7f0bd61a3b0598faa2f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2137162
Commit-Queue: Johann Koenig <johannkoenig@google.com>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756871}
parent 2d79dc1b
......@@ -240,7 +240,7 @@ ControllerPresentationConnection* ControllerPresentationConnection::Take(
DCHECK(request);
auto* connection = MakeGarbageCollected<ControllerPresentationConnection>(
*controller->GetFrame(), controller, presentation_info.id,
*controller->GetSupplementable(), controller, presentation_info.id,
presentation_info.url);
controller->RegisterConnection(connection);
......
......@@ -22,7 +22,6 @@ namespace blink {
PresentationController::PresentationController(LocalFrame& frame)
: Supplement<LocalFrame>(frame),
ExecutionContextLifecycleObserver(frame.GetDocument()),
presentation_controller_receiver_(this, frame.DomWindow()) {}
PresentationController::~PresentationController() = default;
......@@ -60,7 +59,6 @@ void PresentationController::Trace(Visitor* visitor) {
visitor->Trace(connections_);
visitor->Trace(availability_state_);
Supplement<LocalFrame>::Trace(visitor);
ExecutionContextLifecycleObserver::Trace(visitor);
}
void PresentationController::SetPresentation(Presentation* presentation) {
......@@ -153,10 +151,10 @@ PresentationController::FindExistingConnection(
mojo::Remote<mojom::blink::PresentationService>&
PresentationController::GetPresentationService() {
if (!presentation_service_remote_ && GetFrame()) {
if (!presentation_service_remote_ && GetSupplementable()) {
scoped_refptr<base::SingleThreadTaskRunner> task_runner =
GetFrame()->GetTaskRunner(TaskType::kPresentation);
GetFrame()->GetBrowserInterfaceBroker().GetInterface(
GetSupplementable()->GetTaskRunner(TaskType::kPresentation);
GetSupplementable()->GetBrowserInterfaceBroker().GetInterface(
presentation_service_remote_.BindNewPipeAndPassReceiver(task_runner));
presentation_service_remote_->SetController(
presentation_controller_receiver_.BindNewPipeAndPassRemote(
......
......@@ -8,7 +8,6 @@
#include "base/macros.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/presentation/presentation.mojom-blink.h"
#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/modules/modules_export.h"
......@@ -31,7 +30,6 @@ class PresentationAvailabilityState;
class MODULES_EXPORT PresentationController
: public GarbageCollected<PresentationController>,
public Supplement<LocalFrame>,
public ExecutionContextLifecycleObserver,
public mojom::blink::PresentationController {
USING_GARBAGE_COLLECTED_MIXIN(PresentationController);
......@@ -79,9 +77,6 @@ class MODULES_EXPORT PresentationController
virtual void RemoveAvailabilityObserver(PresentationAvailabilityObserver*);
private:
// Implementation of ExecutionContextLifecycleObserver.
void ContextDestroyed() override {}
// mojom::blink::PresentationController implementation.
void OnScreenAvailabilityUpdated(const KURL&,
mojom::blink::ScreenAvailability) override;
......
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