use webcontents id to identify callbacks
This commit is contained in:
parent
3a154ab8ea
commit
2c59f4567e
6 changed files with 25 additions and 21 deletions
|
@ -12,11 +12,11 @@ namespace atom {
|
|||
|
||||
namespace api {
|
||||
|
||||
IDWeakMap::IDWeakMap() {
|
||||
id_weak_map_.reset(new atom::IDWeakMap);
|
||||
IDWeakMap::IDWeakMap() : id_weak_map_(new atom::IDWeakMap) {
|
||||
}
|
||||
|
||||
IDWeakMap::~IDWeakMap() {
|
||||
id_weak_map_ = nullptr;
|
||||
}
|
||||
|
||||
void IDWeakMap::Set(v8::Isolate* isolate,
|
||||
|
|
|
@ -22,7 +22,7 @@ class IDWeakMap : public mate::Wrappable {
|
|||
|
||||
protected:
|
||||
IDWeakMap();
|
||||
virtual ~IDWeakMap();
|
||||
~IDWeakMap();
|
||||
|
||||
// mate::Wrappable:
|
||||
bool IsDestroyed() const override;
|
||||
|
@ -34,7 +34,7 @@ class IDWeakMap : public mate::Wrappable {
|
|||
bool Has(int32_t id);
|
||||
void Remove(int32_t id);
|
||||
|
||||
scoped_ptr<atom::IDWeakMap> id_weak_map_;
|
||||
atom::IDWeakMap* id_weak_map_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(IDWeakMap);
|
||||
};
|
||||
|
|
|
@ -22,8 +22,6 @@ class CallbacksRegistry
|
|||
continue if location.indexOf('(native)') isnt -1
|
||||
continue if location.indexOf('atom.asar') isnt -1
|
||||
[x, filenameAndLine] = /([^/^\)]*)\)?$/gi.exec(location)
|
||||
[x, line, column] = /(\d+):(\d+)/g.exec(filenameAndLine)
|
||||
id += parseInt(line) + parseInt(column)
|
||||
break
|
||||
|
||||
@callbacks[id] = callback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue