Loading libs/binder/BpBinder.cpp +10 −15 Original line number Diff line number Diff line Loading @@ -78,7 +78,16 @@ BpBinder::ObjectManager::ObjectManager() BpBinder::ObjectManager::~ObjectManager() { kill(); const size_t N = mObjects.size(); ALOGV("Killing %zu objects in manager %p", N, this); for (auto i : mObjects) { const entry_t& e = i.second; if (e.func != nullptr) { e.func(i.first, e.object, e.cleanupCookie); } } mObjects.clear(); } void* BpBinder::ObjectManager::attach(const void* objectID, void* object, void* cleanupCookie, Loading Loading @@ -144,20 +153,6 @@ sp<IBinder> BpBinder::ObjectManager::lookupOrCreateWeak(const void* objectID, ob return newObj; } void BpBinder::ObjectManager::kill() { const size_t N = mObjects.size(); ALOGV("Killing %zu objects in manager %p", N, this); for (auto i : mObjects) { const entry_t& e = i.second; if (e.func != nullptr) { e.func(i.first, e.object, e.cleanupCookie); } } mObjects.clear(); } // --------------------------------------------------------------------------- sp<BpBinder> BpBinder::create(int32_t handle, std::function<void()>* postTask) { Loading libs/binder/include/binder/BpBinder.h +1 −2 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public: // Stop the current recording. LIBBINDER_EXPORTED status_t stopRecordingBinder(); // Note: This class is not thread safe so protect uses of it when necessary class ObjectManager { public: ObjectManager(); Loading @@ -116,8 +117,6 @@ public: sp<IBinder> lookupOrCreateWeak(const void* objectID, IBinder::object_make_func make, const void* makeArgs); void kill(); private: ObjectManager(const ObjectManager&); ObjectManager& operator=(const ObjectManager&); Loading Loading
libs/binder/BpBinder.cpp +10 −15 Original line number Diff line number Diff line Loading @@ -78,7 +78,16 @@ BpBinder::ObjectManager::ObjectManager() BpBinder::ObjectManager::~ObjectManager() { kill(); const size_t N = mObjects.size(); ALOGV("Killing %zu objects in manager %p", N, this); for (auto i : mObjects) { const entry_t& e = i.second; if (e.func != nullptr) { e.func(i.first, e.object, e.cleanupCookie); } } mObjects.clear(); } void* BpBinder::ObjectManager::attach(const void* objectID, void* object, void* cleanupCookie, Loading Loading @@ -144,20 +153,6 @@ sp<IBinder> BpBinder::ObjectManager::lookupOrCreateWeak(const void* objectID, ob return newObj; } void BpBinder::ObjectManager::kill() { const size_t N = mObjects.size(); ALOGV("Killing %zu objects in manager %p", N, this); for (auto i : mObjects) { const entry_t& e = i.second; if (e.func != nullptr) { e.func(i.first, e.object, e.cleanupCookie); } } mObjects.clear(); } // --------------------------------------------------------------------------- sp<BpBinder> BpBinder::create(int32_t handle, std::function<void()>* postTask) { Loading
libs/binder/include/binder/BpBinder.h +1 −2 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public: // Stop the current recording. LIBBINDER_EXPORTED status_t stopRecordingBinder(); // Note: This class is not thread safe so protect uses of it when necessary class ObjectManager { public: ObjectManager(); Loading @@ -116,8 +117,6 @@ public: sp<IBinder> lookupOrCreateWeak(const void* objectID, IBinder::object_make_func make, const void* makeArgs); void kill(); private: ObjectManager(const ObjectManager&); ObjectManager& operator=(const ObjectManager&); Loading