Commit eb5b7789 authored by Minoru Chikamune's avatar Minoru Chikamune Committed by Chromium LUCI CQ

[HeapMojo] Deprecate HeapMojoWrapperMode::kWithoutContextObserver for DevToolsFrontendImpl.

[purpose]
The HeapMojoWrapperMode::kWithoutContextObserver was a HeapMojoWrapper's "safe mofe" to keep the existing behavior during the COVID-19 code freeze.

The mojo objects on DevToolsFrontendImpl must outlive the ExecutionContext of LocalFrame, so it should not be associated with the ExecutionContext of LocalFrame.

Bug: 1049056
Change-Id: I9c0b469ca206005a00a921838d24569c80f598a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2291911Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833156}
parent cd68a26c
...@@ -65,9 +65,7 @@ const char DevToolsFrontendImpl::kSupplementName[] = "DevToolsFrontendImpl"; ...@@ -65,9 +65,7 @@ const char DevToolsFrontendImpl::kSupplementName[] = "DevToolsFrontendImpl";
DevToolsFrontendImpl::DevToolsFrontendImpl( DevToolsFrontendImpl::DevToolsFrontendImpl(
LocalFrame& frame, LocalFrame& frame,
mojo::PendingAssociatedReceiver<mojom::blink::DevToolsFrontend> receiver) mojo::PendingAssociatedReceiver<mojom::blink::DevToolsFrontend> receiver)
: Supplement<LocalFrame>(frame), : Supplement<LocalFrame>(frame) {
host_(frame.DomWindow()),
receiver_(this, frame.DomWindow()) {
receiver_.Bind(std::move(receiver), receiver_.Bind(std::move(receiver),
frame.GetTaskRunner(TaskType::kMiscPlatformAPI)); frame.GetTaskRunner(TaskType::kMiscPlatformAPI));
} }
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#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_associated_receiver.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_associated_receiver.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_associated_remote.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_associated_remote.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h"
#include "third_party/blink/renderer/platform/supplementable.h" #include "third_party/blink/renderer/platform/supplementable.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
...@@ -84,13 +83,14 @@ class DevToolsFrontendImpl final ...@@ -84,13 +83,14 @@ class DevToolsFrontendImpl final
Member<DevToolsHost> devtools_host_; Member<DevToolsHost> devtools_host_;
String api_script_; String api_script_;
HeapMojoAssociatedRemote<mojom::blink::DevToolsFrontendHost, // The host_ must outlive the ExecutionContext of LocalFrame, so it should not
HeapMojoWrapperMode::kForceWithoutContextObserver> // be associated with the ExecutionContext of LocalFrame.
host_; HeapMojoAssociatedRemote<mojom::blink::DevToolsFrontendHost> host_{nullptr};
// The receiver_ must outlive the ExecutionContext of LocalFrame, so it should
// not be associated with the ExecutionContext of LocalFrame.
HeapMojoAssociatedReceiver<mojom::blink::DevToolsFrontend, HeapMojoAssociatedReceiver<mojom::blink::DevToolsFrontend,
DevToolsFrontendImpl, DevToolsFrontendImpl>
HeapMojoWrapperMode::kForceWithoutContextObserver> receiver_{this, nullptr};
receiver_;
DISALLOW_COPY_AND_ASSIGN(DevToolsFrontendImpl); DISALLOW_COPY_AND_ASSIGN(DevToolsFrontendImpl);
}; };
......
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