| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DBUS_OBJECT_MANAGER_H_ | 5 #ifndef DBUS_OBJECT_MANAGER_H_ |
| 6 #define DBUS_OBJECT_MANAGER_H_ | 6 #define DBUS_OBJECT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // GetManagedObjects() after the implementation classes have been set up. | 72 // GetManagedObjects() after the implementation classes have been set up. |
| 73 // | 73 // |
| 74 // The object manager interface class has one abstract method that must be | 74 // The object manager interface class has one abstract method that must be |
| 75 // implemented by the class to create Properties structures on demand. As well | 75 // implemented by the class to create Properties structures on demand. As well |
| 76 // as implementing this, you will want to implement a public GetProperties() | 76 // as implementing this, you will want to implement a public GetProperties() |
| 77 // method. | 77 // method. |
| 78 // | 78 // |
| 79 // Example: | 79 // Example: |
| 80 // dbus::PropertySet* CreateProperties(dbus::ObjectProxy* object_proxy, | 80 // dbus::PropertySet* CreateProperties(dbus::ObjectProxy* object_proxy, |
| 81 // const std::string& interface_name) | 81 // const std::string& interface_name) |
| 82 // OVERRIDE { | 82 // override { |
| 83 // Properties* properties = new Properties( | 83 // Properties* properties = new Properties( |
| 84 // object_proxy, interface_name, | 84 // object_proxy, interface_name, |
| 85 // base::Bind(&PropertyChanged, | 85 // base::Bind(&PropertyChanged, |
| 86 // weak_ptr_factory_.GetWeakPtr(), | 86 // weak_ptr_factory_.GetWeakPtr(), |
| 87 // object_path)); | 87 // object_path)); |
| 88 // return static_cast<dbus::PropertySet*>(properties); | 88 // return static_cast<dbus::PropertySet*>(properties); |
| 89 // } | 89 // } |
| 90 // | 90 // |
| 91 // Properties* GetProperties(const dbus::ObjectPath& object_path) { | 91 // Properties* GetProperties(const dbus::ObjectPath& object_path) { |
| 92 // return static_cast<Properties*>( | 92 // return static_cast<Properties*>( |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // Note: This should remain the last member so it'll be destroyed and | 352 // Note: This should remain the last member so it'll be destroyed and |
| 353 // invalidate its weak pointers before any other members are destroyed. | 353 // invalidate its weak pointers before any other members are destroyed. |
| 354 base::WeakPtrFactory<ObjectManager> weak_ptr_factory_; | 354 base::WeakPtrFactory<ObjectManager> weak_ptr_factory_; |
| 355 | 355 |
| 356 DISALLOW_COPY_AND_ASSIGN(ObjectManager); | 356 DISALLOW_COPY_AND_ASSIGN(ObjectManager); |
| 357 }; | 357 }; |
| 358 | 358 |
| 359 } // namespace dbus | 359 } // namespace dbus |
| 360 | 360 |
| 361 #endif // DBUS_OBJECT_MANAGER_H_ | 361 #endif // DBUS_OBJECT_MANAGER_H_ |
| OLD | NEW |