Commit 214b0734 authored by Johann's avatar Johann Committed by Commit Bot

heap mojo: migrate background fetch

Use HeapMojoReceiver wrapper so that Oilpan will GC the object.

Change-Id: Ie86954d7a9e5e705cf33eda703d2427bb060f777
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2100457Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarMugdha Lakhani <nator@chromium.org>
Commit-Queue: Johann Koenig <johannkoenig@google.com>
Cr-Commit-Position: refs/heads/master@{#759941}
parent 4c89aee2
...@@ -36,7 +36,9 @@ BackgroundFetchRegistration::BackgroundFetchRegistration( ...@@ -36,7 +36,9 @@ BackgroundFetchRegistration::BackgroundFetchRegistration(
download_total_(registration->registration_data->download_total), download_total_(registration->registration_data->download_total),
downloaded_(registration->registration_data->downloaded), downloaded_(registration->registration_data->downloaded),
result_(registration->registration_data->result), result_(registration->registration_data->result),
failure_reason_(registration->registration_data->failure_reason) { failure_reason_(registration->registration_data->failure_reason),
observer_receiver_(this,
service_worker_registration->GetExecutionContext()) {
DCHECK(service_worker_registration); DCHECK(service_worker_registration);
registration_ = service_worker_registration; registration_ = service_worker_registration;
registration_service_.Bind(std::move(registration->registration_interface)); registration_service_.Bind(std::move(registration->registration_interface));
...@@ -377,6 +379,7 @@ void BackgroundFetchRegistration::UpdateUI( ...@@ -377,6 +379,7 @@ void BackgroundFetchRegistration::UpdateUI(
void BackgroundFetchRegistration::Trace(Visitor* visitor) { void BackgroundFetchRegistration::Trace(Visitor* visitor) {
visitor->Trace(registration_); visitor->Trace(registration_);
visitor->Trace(observers_); visitor->Trace(observers_);
visitor->Trace(observer_receiver_);
EventTargetWithInlineData::Trace(visitor); EventTargetWithInlineData::Trace(visitor);
ActiveScriptWrappable::Trace(visitor); ActiveScriptWrappable::Trace(visitor);
} }
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_BACKGROUND_FETCH_BACKGROUND_FETCH_REGISTRATION_H_
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/background_fetch/background_fetch.mojom-blink.h" #include "third_party/blink/public/mojom/background_fetch/background_fetch.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h" #include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
...@@ -14,6 +13,8 @@ ...@@ -14,6 +13,8 @@
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink { namespace blink {
...@@ -139,8 +140,10 @@ class BackgroundFetchRegistration final ...@@ -139,8 +140,10 @@ class BackgroundFetchRegistration final
mojo::Remote<mojom::blink::BackgroundFetchRegistrationService> mojo::Remote<mojom::blink::BackgroundFetchRegistrationService>
registration_service_; registration_service_;
mojo::Receiver<blink::mojom::blink::BackgroundFetchRegistrationObserver> HeapMojoReceiver<blink::mojom::blink::BackgroundFetchRegistrationObserver,
observer_receiver_{this}; BackgroundFetchRegistration,
HeapMojoWrapperMode::kWithoutContextObserver>
observer_receiver_;
}; };
} // namespace blink } // namespace blink
......
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