remote_object_freer.h 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_COMMON_API_REMOTE_OBJECT_FREER_H_
  5. #define ATOM_COMMON_API_REMOTE_OBJECT_FREER_H_
  6. #include <string>
  7. #include "atom/common/api/object_life_monitor.h"
  8. namespace atom {
  9. class RemoteObjectFreer : public ObjectLifeMonitor {
  10. public:
  11. static void BindTo(v8::Isolate* isolate,
  12. v8::Local<v8::Object> target,
  13. const std::string& context_id,
  14. int object_id);
  15. protected:
  16. RemoteObjectFreer(v8::Isolate* isolate,
  17. v8::Local<v8::Object> target,
  18. const std::string& context_id,
  19. int object_id);
  20. ~RemoteObjectFreer() override;
  21. void RunDestructor() override;
  22. private:
  23. std::string context_id_;
  24. int object_id_;
  25. int routing_id_;
  26. DISALLOW_COPY_AND_ASSIGN(RemoteObjectFreer);
  27. };
  28. } // namespace atom
  29. #endif // ATOM_COMMON_API_REMOTE_OBJECT_FREER_H_