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

Unified Diff: extensions/browser/process_manager.cc

Issue 129243003: Clear testing callbacks in AppBackgrounPageNaclTest reentrantly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copy callbacks before run Created 6 years, 11 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 | « chrome/browser/extensions/app_background_page_apitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/process_manager.cc
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
index a38f8bca0d1446f298d814ef5ecedc9620fb1370..fed3369a33083ec6e6392d88606c7cb053be6111 100644
--- a/extensions/browser/process_manager.cc
+++ b/extensions/browser/process_manager.cc
@@ -443,8 +443,11 @@ void ProcessManager::KeepaliveImpulse(const Extension* extension) {
}
}
- if (!keepalive_impulse_callback_for_testing_.is_null())
- keepalive_impulse_callback_for_testing_.Run(extension->id());
+ if (!keepalive_impulse_callback_for_testing_.is_null()) {
+ ImpulseCallbackForTesting callback_may_clear_callbacks_reentrantly =
+ keepalive_impulse_callback_for_testing_;
+ callback_may_clear_callbacks_reentrantly.Run(extension->id());
+ }
}
// DecrementLazyKeepaliveCount is called when no calls to KeepaliveImpulse
@@ -459,8 +462,11 @@ void ProcessManager::OnKeepaliveImpulseCheck() {
++i) {
if (i->second.previous_keepalive_impulse && !i->second.keepalive_impulse) {
DecrementLazyKeepaliveCount(i->first);
- if (!keepalive_impulse_decrement_callback_for_testing_.is_null())
- keepalive_impulse_decrement_callback_for_testing_.Run(i->first);
+ if (!keepalive_impulse_decrement_callback_for_testing_.is_null()) {
+ ImpulseCallbackForTesting callback_may_clear_callbacks_reentrantly =
+ keepalive_impulse_decrement_callback_for_testing_;
+ callback_may_clear_callbacks_reentrantly.Run(i->first);
+ }
}
i->second.previous_keepalive_impulse = i->second.keepalive_impulse;
« no previous file with comments | « chrome/browser/extensions/app_background_page_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698