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

Unified Diff: extensions/renderer/gc_callback.cc

Issue 1887423002: Don't execute the fallback if we already started running the gc callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/gc_callback.cc
diff --git a/extensions/renderer/gc_callback.cc b/extensions/renderer/gc_callback.cc
index 9f4a1d55f7bdf3071dced2228ddd2d86dc8f9f30..46b7f8acdf1e847eee51ad6dc229ece2cba95f47 100644
--- a/extensions/renderer/gc_callback.cc
+++ b/extensions/renderer/gc_callback.cc
@@ -41,6 +41,7 @@ void GCCallback::OnObjectGC(const v8::WeakCallbackInfo<GCCallback>& data) {
}
void GCCallback::RunCallback() {
+ fallback_.Reset();
v8::Isolate* isolate = context_->isolate();
v8::HandleScope handle_scope(isolate);
context_->CallFunction(v8::Local<v8::Function>::New(isolate, callback_));
@@ -48,8 +49,10 @@ void GCCallback::RunCallback() {
}
void GCCallback::OnContextInvalidated() {
- fallback_.Run();
- delete this;
+ if (!fallback_.is_null()) {
+ fallback_.Run();
+ delete this;
+ }
}
} // namespace extensions
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698