| Index: extensions/browser/process_manager.cc
|
| diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
|
| index 756d953047b34b90cceac86f0e851ce9e0243f72..397f8da85e26be546f3bc6e20e8d52f1dce81b88 100644
|
| --- a/extensions/browser/process_manager.cc
|
| +++ b/extensions/browser/process_manager.cc
|
| @@ -422,6 +422,9 @@ void ProcessManager::KeepaliveImpulse(const Extension* extension) {
|
| IncrementLazyKeepaliveCount(extension);
|
| }
|
| }
|
| +
|
| + if (!keepalive_impulse_callback_for_testing_.is_null())
|
| + keepalive_impulse_callback_for_testing_.Run(extension->id());
|
| }
|
|
|
| // DecrementLazyKeepaliveCount is called when no calls to KeepaliveImpulse
|
| @@ -434,8 +437,11 @@ void ProcessManager::OnKeepaliveImpulseCheck() {
|
| for (BackgroundPageDataMap::iterator i = background_page_data_.begin();
|
| i != background_page_data_.end();
|
| ++i) {
|
| - if (i->second.previous_keepalive_impulse && !i->second.keepalive_impulse)
|
| + 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);
|
| + }
|
|
|
| i->second.previous_keepalive_impulse = i->second.keepalive_impulse;
|
| i->second.keepalive_impulse = false;
|
| @@ -564,6 +570,16 @@ content::BrowserContext* ProcessManager::GetBrowserContext() const {
|
| return site_instance_->GetBrowserContext();
|
| }
|
|
|
| +void ProcessManager::SetKeepaliveImpulseCallbackForTesting(
|
| + const ImpulseCallbackForTesting& callback) {
|
| + keepalive_impulse_callback_for_testing_ = callback;
|
| +}
|
| +
|
| +void ProcessManager::SetKeepaliveImpulseDecrementCallbackForTesting(
|
| + const ImpulseCallbackForTesting& callback) {
|
| + keepalive_impulse_decrement_callback_for_testing_ = callback;
|
| +}
|
| +
|
| void ProcessManager::Observe(int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
|
|