"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "shell/common/gin_helper/trackable_object.h" between
electron-11.2.3.tar.gz and electron-11.3.0.tar.gz

About: Electron is a framework for creating native cross platform applications with web technologies like JavaScript, HTML, and CSS.

trackable_object.h  (electron-11.2.3):trackable_object.h  (electron-11.3.0)
skipping to change at line 12 skipping to change at line 12
// Use of this source code is governed by the MIT license that can be // Use of this source code is governed by the MIT license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef SHELL_COMMON_GIN_HELPER_TRACKABLE_OBJECT_H_ #ifndef SHELL_COMMON_GIN_HELPER_TRACKABLE_OBJECT_H_
#define SHELL_COMMON_GIN_HELPER_TRACKABLE_OBJECT_H_ #define SHELL_COMMON_GIN_HELPER_TRACKABLE_OBJECT_H_
#include <vector> #include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "shell/common/gin_helper/event_emitter.h" #include "shell/common/gin_helper/event_emitter.h"
#include "shell/common/key_weak_map.h" #include "shell/common/key_weak_map.h"
namespace base { namespace base {
class SupportsUserData; class SupportsUserData;
} }
namespace gin_helper { namespace gin_helper {
// Users should use TrackableObject instead. // Users should use TrackableObject instead.
class TrackableObjectBase { class TrackableObjectBase : public CleanedUpAtExit {
public: public:
TrackableObjectBase(); TrackableObjectBase();
// The ID in weak map. // The ID in weak map.
int32_t weak_map_id() const { return weak_map_id_; } int32_t weak_map_id() const { return weak_map_id_; }
// Wrap TrackableObject into a class that SupportsUserData. // Wrap TrackableObject into a class that SupportsUserData.
void AttachAsUserData(base::SupportsUserData* wrapped); void AttachAsUserData(base::SupportsUserData* wrapped);
// Get the weak_map_id from SupportsUserData. // Get the weak_map_id from SupportsUserData.
static int32_t GetIDFromWrappedClass(base::SupportsUserData* wrapped); static int32_t GetIDFromWrappedClass(base::SupportsUserData* wrapped);
protected: protected:
virtual ~TrackableObjectBase(); ~TrackableObjectBase() override;
// Returns a closure that can destroy the native class. // Returns a closure that can destroy the native class.
base::OnceClosure GetDestroyClosure(); base::OnceClosure GetDestroyClosure();
int32_t weak_map_id_ = 0; int32_t weak_map_id_ = 0;
private: private:
void Destroy(); void Destroy();
base::WeakPtrFactory<TrackableObjectBase> weak_factory_; base::WeakPtrFactory<TrackableObjectBase> weak_factory_;
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)