Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: gin/modules/timer.cc

Issue 2830723003: Ignore fired timer if the object wrapper is no longer alive (Closed)
Patch Set: Ignore fired timer if the object wrapper is no longer alive Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/modules/timer.cc
diff --git a/gin/modules/timer.cc b/gin/modules/timer.cc
index 9e5a26c8ea9ea88d7033bf38c88007951d43c3aa..e1deeaad8f5698c5f1861d810d2030ae6f11b9c6 100644
--- a/gin/modules/timer.cc
+++ b/gin/modules/timer.cc
@@ -67,9 +67,14 @@ void Timer::OnTimerFired() {
Runner::Scope scope(runner_.get());
v8::Isolate* isolate = runner_->GetContextHolder()->isolate();
+
+ v8::Local<v8::Object> wrapper;
+ if (!GetWrapper(isolate).ToLocal(&wrapper)) {
+ return;
+ }
+
v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(
- GetWrapper(isolate)
- .ToLocalChecked()
+ wrapper
->GetPrivate(runner_->GetContextHolder()->context(),
GetHiddenPropertyName(isolate))
.ToLocalChecked());
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698