-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define DBUS_TEST_SERVICE_H_
#include "base/compiler_specific.h"
+#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
-#include "base/threading/thread.h"
#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
#include "dbus/bus.h"
#include "dbus/exported_object.h"
// Request the ownership of a well-known name "TestService".
// |callback| will be called with the result when an ownership request is
// completed.
- void RequestOwnership(base::Callback<void(bool)> callback);
+ void RequestOwnership(base::OnceCallback<void(bool)> callback);
// Release the ownership of the well-known name "TestService".
// |callback| will be called when the ownership has been released.
- void ReleaseOwnership(base::Closure callback);
+ void ReleaseOwnership(base::OnceClosure callback);
// Returns the name of this service.
const std::string& service_name() const { return service_name_; }
// the requested well-known bus name. |callback| and |service_name| are bound
// when the service requests the ownership. |success| is the result of the
// completed request, and is propagated to |callback|.
- void OnOwnership(base::Callback<void(bool)> callback,
+ void OnOwnership(base::OnceCallback<void(bool)> callback,
const std::string& service_name,
bool success);
void SendPropertyInvalidatedSignalInternal();
// Helper function for RequestOwnership().
- void RequestOwnershipInternal(base::Callback<void(bool)> callback);
+ void RequestOwnershipInternal(base::OnceCallback<void(bool)> callback);
// Helper function for ReleaseOwnership().
- void ReleaseOwnershipInternal(base::Closure callback);
+ void ReleaseOwnershipInternal(base::OnceClosure callback);
// Configures the test service to send a PropertiesChanged signal for the
// "Name" property immediately after a call to GetManagedObjects.
bool has_ownership_;
scoped_refptr<Bus> bus_;
- ExportedObject* exported_object_;
- ExportedObject* exported_object_manager_;
+ raw_ptr<ExportedObject, AcrossTasksDanglingUntriaged> exported_object_;
+ raw_ptr<ExportedObject, AcrossTasksDanglingUntriaged>
+ exported_object_manager_;
};
} // namespace dbus