Commit b3282bbc authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Clean up comments about StrongBinding*, old Mojo types

This CL cleans up comments about mojo::StrongBinding* since it's
old Mojo type and replaced with mojo::SelfOwnedReceiver,
mojo::UniqueReceiverSet, or mojo::Receiver.

NOTRY=true

Bug: 955171
Change-Id: I49094d8054ca56d48740ce27efb4f2695b4c4d52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1941447
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarMatt Reynolds <mattreynolds@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721308}
parent 1c52ee05
......@@ -107,8 +107,9 @@ blink::mojom::MatchResultPtr EagerlyReadResponseBody(
} // namespace
// Implements the mojom interface CacheStorageCache. It's owned by
// CacheStorageDispatcherHost and it's destroyed when client drops the mojo ptr
// which in turn removes from StrongBindingSet in CacheStorageDispatcherHost.
// CacheStorageDispatcherHost and it's destroyed when client drops the mojo
// remote which in turn removes from UniqueAssociatedReceiverSet in
// CacheStorageDispatcherHost.
class CacheStorageDispatcherHost::CacheImpl
: public blink::mojom::CacheStorageCache {
public:
......@@ -400,7 +401,7 @@ class CacheStorageDispatcherHost::CacheImpl
// Implements the mojom interface CacheStorage. It's owned by the
// CacheStorageDispatcherHost. The CacheStorageImpl is destroyed when the
// client drops its mojo ptr which in turn removes from StrongBindingSet in
// client drops its mojo remote which in turn removes from UniqueReceiverSet in
// CacheStorageDispatcherHost.
class CacheStorageDispatcherHost::CacheStorageImpl final
: public blink::mojom::CacheStorage {
......
......@@ -34,9 +34,9 @@ ClipboardHostImpl::ClipboardHostImpl(
void ClipboardHostImpl::Create(
mojo::PendingReceiver<blink::mojom::ClipboardHost> receiver) {
// Clipboard implementations do interesting things, like run nested message
// loops. Since StrongBinding<T> synchronously destroys on failure, that can
// result in some unfortunate use-after-frees after the nested message loops
// exit.
// loops. Use manual memory management instead of SelfOwnedReceiver<T> which
// synchronously destroys on failure and can result in some unfortunate
// use-after-frees after the nested message loops exit.
auto* host = new ClipboardHostImpl(std::move(receiver));
host->receiver_.set_disconnect_handler(base::BindOnce(
[](ClipboardHostImpl* host) {
......
......@@ -37,8 +37,6 @@ class GeneratedCodeCacheContext;
// The implementation of a CodeCacheHost, which stores and retrieves resource
// metadata, either bytecode or native code, generated by a renderer process.
// Instances of this class are owned by by the Mojo pipe that's passed to the
// renderer process via StrongBinding.
// Instances of this class must be created and used on the UI thread.
class CONTENT_EXPORT CodeCacheHostImpl : public blink::mojom::CodeCacheHost {
public:
......
......@@ -50,7 +50,7 @@ void CreateDedicatedWorkerHostFactory(
// A host for a single dedicated worker. Its lifetime is managed by the
// DedicatedWorkerGlobalScope of the corresponding worker in the renderer via a
// StrongBinding. This lives on the UI thread.
// SelfOwnedReceiver. This lives on the UI thread.
class DedicatedWorkerHost final
: public service_manager::mojom::InterfaceProvider,
public blink::mojom::DedicatedWorkerHost {
......
......@@ -34,7 +34,7 @@ void EmbeddedWorkerInstanceClientImpl::Create(
receiver) {
// This won't be leaked because the lifetime will be managed internally.
// See the class documentation for detail.
// We can't use MakeStrongBinding because must give the worker thread
// We can't use MakeSelfOwnedReceiver because must give the worker thread
// a chance to stop by calling TerminateWorkerContext() and waiting
// before destructing.
new EmbeddedWorkerInstanceClientImpl(std::move(receiver),
......
......@@ -55,7 +55,7 @@ class PublicIpAddressGeolocationProvider
// Central PublicIpAddressLocationNotifier for use by all implementations of
// mojom::Geolocation provided by the CreateGeolocation method.
// Note that this must be before the StrongBindingSet<mojom::Geolocation> as
// Note that this must be before the UniqueReceiverSet<mojom::Geolocation> as
// it must outlive the Geolocation implementations.
std::unique_ptr<PublicIpAddressLocationNotifier>
public_ip_address_location_notifier_;
......
......@@ -44,8 +44,9 @@ HidConnectionImpl::~HidConnectionImpl() {
DCHECK(hid_connection_);
hid_connection_->SetClient(nullptr);
// Close |hid_connection_| on destruction because this class is owned by a
// mojo::StrongBinding and will be destroyed when the pipe is closed.
// Close |hid_connection_| on destruction. HidConnectionImpl is owned by
// its mojom::HidConnection receiver and mojom::HidConnectionWatcher remote
// and will self-destruct when either pipe is closed.
hid_connection_->Close();
}
......
......@@ -67,7 +67,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetLogExporter
StartCallback callback,
const base::FilePath& scratch_dir_path);
// NetworkContext owns |this| via StrongBindingSet, so this object can't
// NetworkContext owns |this| via UniqueReceiverSet, so this object can't
// outlive it.
NetworkContext* network_context_;
enum State { STATE_IDLE, STATE_WAITING_DIR, STATE_RUNNING } state_;
......
......@@ -15,7 +15,7 @@ namespace {
// impl object will be sent over mojo instead of the release_callback_ (which is
// not serializable). Once the client calls Release, the release_callback_ will
// be called. An object of this class will remain alive until the MessagePipe
// attached to it goes away (i.e. StrongBinding is used).
// attached to it goes away (i.e. SelfOwnedReceiver is used).
class TextureReleaserImpl : public viz::mojom::TextureReleaser {
public:
explicit TextureReleaserImpl(
......
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