Remove unneeded cleanup code

This commit is contained in:
Cheng Zhao 2016-04-25 10:23:36 +09:00
parent 60d2cb8a84
commit 993695af07
5 changed files with 0 additions and 39 deletions

View file

@ -167,16 +167,8 @@ void Debugger::BuildPrototype(v8::Isolate* isolate,
.SetMethod("sendCommand", &Debugger::SendCommand);
}
void ClearWrapDebugger() {
g_wrap_debugger.Reset();
}
void SetWrapDebugger(const WrapDebuggerCallback& callback) {
g_wrap_debugger = callback;
// Cleanup the wrapper on exit.
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
base::Bind(ClearWrapDebugger));
}
} // namespace api

View file

@ -184,16 +184,8 @@ mate::Handle<DownloadItem> DownloadItem::Create(
return handle;
}
void ClearWrapDownloadItem() {
g_wrap_download_item.Reset();
}
void SetWrapDownloadItem(const WrapDownloadItemCallback& callback) {
g_wrap_download_item = callback;
// Cleanup the wrapper on exit.
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
base::Bind(ClearWrapDownloadItem));
}
} // namespace api

View file

@ -494,16 +494,8 @@ void Session::BuildPrototype(v8::Isolate* isolate,
.SetProperty("webRequest", &Session::WebRequest);
}
void ClearWrapSession() {
g_wrap_session.Reset();
}
void SetWrapSession(const WrapSessionCallback& callback) {
g_wrap_session = callback;
// Cleanup the wrapper on exit.
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
base::Bind(ClearWrapSession));
}
} // namespace api

View file

@ -1309,16 +1309,8 @@ mate::Handle<WebContents> WebContents::Create(
return handle;
}
void ClearWrapWebContents() {
g_wrap_web_contents.Reset();
}
void SetWrapWebContents(const WrapWebContentsCallback& callback) {
g_wrap_web_contents = callback;
// Cleanup the wrapper on exit.
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
base::Bind(ClearWrapWebContents));
}
} // namespace api

View file

@ -114,8 +114,6 @@ class TrackableObject : public TrackableObjectBase,
void AfterInit(v8::Isolate* isolate) override {
if (!weak_map_) {
weak_map_.reset(new atom::IDWeakMap);
RegisterDestructionCallback(
base::Bind(&TrackableObject<T>::ReleaseAllWeakReferences));
}
weak_map_id_ = weak_map_->Add(isolate, Wrappable<T>::GetWrapper());
if (wrapped_)
@ -123,11 +121,6 @@ class TrackableObject : public TrackableObjectBase,
}
private:
// Releases all weak references in weak map, called when app is terminating.
static void ReleaseAllWeakReferences() {
weak_map_.reset();
}
static scoped_ptr<atom::IDWeakMap> weak_map_;
DISALLOW_COPY_AND_ASSIGN(TrackableObject);