-// 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.
#include <utility>
#include <vector>
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/macros.h"
+#include "base/functional/bind.h"
+#include "base/functional/callback.h"
+#include "base/memory/raw_ptr.h"
#include "dbus/dbus_export.h"
#include "dbus/message.h"
#include "dbus/object_proxy.h"
//
// This now allows code using the client implementation to access properties
// in a type-safe manner, and assuming the PropertyChanged callback is
-// propogated up to observers, be notified of changes. A typical access of
+// propagated up to observers, be notified of changes. A typical access of
// the current value of the name property would be:
//
// ExampleClient::Properties* p = example_client->GetProperties(object_path);
class CHROME_DBUS_EXPORT PropertyBase {
public:
PropertyBase();
+
+ PropertyBase(const PropertyBase&) = delete;
+ PropertyBase& operator=(const PropertyBase&) = delete;
+
virtual ~PropertyBase();
// Initializes the |property_set| and property |name| so that method
private:
// Pointer to the PropertySet instance that this instance is a member of,
// no ownership is taken and |property_set_| must outlive this class.
- PropertySet* property_set_;
+ raw_ptr<PropertySet> property_set_;
bool is_valid_;
// Name of the property.
std::string name_;
-
- DISALLOW_COPY_AND_ASSIGN(PropertyBase);
};
// PropertySet groups a collection of properties for a remote object
PropertySet(ObjectProxy* object_proxy, const std::string& interface,
const PropertyChangedCallback& property_changed_callback);
+ PropertySet(const PropertySet&) = delete;
+ PropertySet& operator=(const PropertySet&) = delete;
+
// Destructor; we don't hold on to any references or memory that needs
// explicit clean-up, but clang thinks we might.
virtual ~PropertySet();
// Pointer to object proxy for making method calls, no ownership is taken
// so this must outlive this class.
- ObjectProxy* object_proxy_;
+ raw_ptr<ObjectProxy, AcrossTasksDanglingUntriaged> object_proxy_;
// Interface of property, e.g. "org.chromium.ExampleService", this is
// distinct from the interface of the method call itself which is the
// Weak pointer factory as D-Bus callbacks may last longer than these
// objects.
base::WeakPtrFactory<PropertySet> weak_ptr_factory_{this};
-
- DISALLOW_COPY_AND_ASSIGN(PropertySet);
};
// Property template, this defines the type-specific and type-safe methods