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( ...@@ -107,8 +107,9 @@ blink::mojom::MatchResultPtr EagerlyReadResponseBody(
} // namespace } // namespace
// Implements the mojom interface CacheStorageCache. It's owned by // Implements the mojom interface CacheStorageCache. It's owned by
// CacheStorageDispatcherHost and it's destroyed when client drops the mojo ptr // CacheStorageDispatcherHost and it's destroyed when client drops the mojo
// which in turn removes from StrongBindingSet in CacheStorageDispatcherHost. // remote which in turn removes from UniqueAssociatedReceiverSet in
// CacheStorageDispatcherHost.
class CacheStorageDispatcherHost::CacheImpl class CacheStorageDispatcherHost::CacheImpl
: public blink::mojom::CacheStorageCache { : public blink::mojom::CacheStorageCache {
public: public:
...@@ -400,7 +401,7 @@ class CacheStorageDispatcherHost::CacheImpl ...@@ -400,7 +401,7 @@ class CacheStorageDispatcherHost::CacheImpl
// Implements the mojom interface CacheStorage. It's owned by the // Implements the mojom interface CacheStorage. It's owned by the
// CacheStorageDispatcherHost. The CacheStorageImpl is destroyed when 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. // CacheStorageDispatcherHost.
class CacheStorageDispatcherHost::CacheStorageImpl final class CacheStorageDispatcherHost::CacheStorageImpl final
: public blink::mojom::CacheStorage { : public blink::mojom::CacheStorage {
......
...@@ -34,9 +34,9 @@ ClipboardHostImpl::ClipboardHostImpl( ...@@ -34,9 +34,9 @@ ClipboardHostImpl::ClipboardHostImpl(
void ClipboardHostImpl::Create( void ClipboardHostImpl::Create(
mojo::PendingReceiver<blink::mojom::ClipboardHost> receiver) { mojo::PendingReceiver<blink::mojom::ClipboardHost> receiver) {
// Clipboard implementations do interesting things, like run nested message // Clipboard implementations do interesting things, like run nested message
// loops. Since StrongBinding<T> synchronously destroys on failure, that can // loops. Use manual memory management instead of SelfOwnedReceiver<T> which
// result in some unfortunate use-after-frees after the nested message loops // synchronously destroys on failure and can result in some unfortunate
// exit. // use-after-frees after the nested message loops exit.
auto* host = new ClipboardHostImpl(std::move(receiver)); auto* host = new ClipboardHostImpl(std::move(receiver));
host->receiver_.set_disconnect_handler(base::BindOnce( host->receiver_.set_disconnect_handler(base::BindOnce(
[](ClipboardHostImpl* host) { [](ClipboardHostImpl* host) {
......
...@@ -37,8 +37,6 @@ class GeneratedCodeCacheContext; ...@@ -37,8 +37,6 @@ class GeneratedCodeCacheContext;
// The implementation of a CodeCacheHost, which stores and retrieves resource // The implementation of a CodeCacheHost, which stores and retrieves resource
// metadata, either bytecode or native code, generated by a renderer process. // 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. // Instances of this class must be created and used on the UI thread.
class CONTENT_EXPORT CodeCacheHostImpl : public blink::mojom::CodeCacheHost { class CONTENT_EXPORT CodeCacheHostImpl : public blink::mojom::CodeCacheHost {
public: public:
......
...@@ -50,7 +50,7 @@ void CreateDedicatedWorkerHostFactory( ...@@ -50,7 +50,7 @@ void CreateDedicatedWorkerHostFactory(
// A host for a single dedicated worker. Its lifetime is managed by the // A host for a single dedicated worker. Its lifetime is managed by the
// DedicatedWorkerGlobalScope of the corresponding worker in the renderer via a // 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 class DedicatedWorkerHost final
: public service_manager::mojom::InterfaceProvider, : public service_manager::mojom::InterfaceProvider,
public blink::mojom::DedicatedWorkerHost { public blink::mojom::DedicatedWorkerHost {
......
...@@ -34,7 +34,7 @@ void EmbeddedWorkerInstanceClientImpl::Create( ...@@ -34,7 +34,7 @@ void EmbeddedWorkerInstanceClientImpl::Create(
receiver) { receiver) {
// This won't be leaked because the lifetime will be managed internally. // This won't be leaked because the lifetime will be managed internally.
// See the class documentation for detail. // 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 // a chance to stop by calling TerminateWorkerContext() and waiting
// before destructing. // before destructing.
new EmbeddedWorkerInstanceClientImpl(std::move(receiver), new EmbeddedWorkerInstanceClientImpl(std::move(receiver),
......
...@@ -55,7 +55,7 @@ class PublicIpAddressGeolocationProvider ...@@ -55,7 +55,7 @@ class PublicIpAddressGeolocationProvider
// Central PublicIpAddressLocationNotifier for use by all implementations of // Central PublicIpAddressLocationNotifier for use by all implementations of
// mojom::Geolocation provided by the CreateGeolocation method. // 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. // it must outlive the Geolocation implementations.
std::unique_ptr<PublicIpAddressLocationNotifier> std::unique_ptr<PublicIpAddressLocationNotifier>
public_ip_address_location_notifier_; public_ip_address_location_notifier_;
......
...@@ -44,8 +44,9 @@ HidConnectionImpl::~HidConnectionImpl() { ...@@ -44,8 +44,9 @@ HidConnectionImpl::~HidConnectionImpl() {
DCHECK(hid_connection_); DCHECK(hid_connection_);
hid_connection_->SetClient(nullptr); hid_connection_->SetClient(nullptr);
// Close |hid_connection_| on destruction because this class is owned by a // Close |hid_connection_| on destruction. HidConnectionImpl is owned by
// mojo::StrongBinding and will be destroyed when the pipe is closed. // its mojom::HidConnection receiver and mojom::HidConnectionWatcher remote
// and will self-destruct when either pipe is closed.
hid_connection_->Close(); hid_connection_->Close();
} }
......
...@@ -67,7 +67,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetLogExporter ...@@ -67,7 +67,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetLogExporter
StartCallback callback, StartCallback callback,
const base::FilePath& scratch_dir_path); 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. // outlive it.
NetworkContext* network_context_; NetworkContext* network_context_;
enum State { STATE_IDLE, STATE_WAITING_DIR, STATE_RUNNING } state_; enum State { STATE_IDLE, STATE_WAITING_DIR, STATE_RUNNING } state_;
......
...@@ -15,7 +15,7 @@ namespace { ...@@ -15,7 +15,7 @@ namespace {
// impl object will be sent over mojo instead of the release_callback_ (which is // 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 // not serializable). Once the client calls Release, the release_callback_ will
// be called. An object of this class will remain alive until the MessagePipe // 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 { class TextureReleaserImpl : public viz::mojom::TextureReleaser {
public: public:
explicit TextureReleaserImpl( 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