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

Unified Diff: chrome/renderer/extensions/extension_dispatcher.cc

Issue 8343079: Don't close background pages if there is a pending response (callback). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only track in-flight events when lazy Created 9 years, 2 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
Index: chrome/renderer/extensions/extension_dispatcher.cc
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc
index e6c6d12ea2bf210f205c8a6b4c5d63565f7b9c6b..3ff7e65f9db509eeeee25c28a3f3c57ad7e85d7c 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -154,10 +154,17 @@ void ExtensionDispatcher::OnMessageInvoke(const std::string& extension_id,
kInitialExtensionIdleHandlerDelayS);
}
- // Tell the browser process that we're idle.
+ // Tell the browser process that the event is dispatched and we're idle.
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableLazyBackgroundPages) &&
- function_name == "Event.dispatchJSON") // may always be true
+ function_name == "Event.dispatchJSON") { // may always be true
+ RenderThread::Get()->Send(new ExtensionHostMsg_EventDispatch(extension_id));
+ OnExtensionIdle(extension_id);
+ }
+}
+
+void ExtensionDispatcher::OnExtensionIdle(const std::string& extension_id) {
Aaron Boodman 2011/10/31 17:46:08 How about "CheckIdleStatus".
Tessa MacDuff 2011/10/31 19:01:29 Done.
+ if (!ExtensionProcessBindings::HasPendingRequests(extension_id))
RenderThread::Get()->Send(new ExtensionHostMsg_ExtensionIdle(extension_id));
}

Powered by Google App Engine
This is Rietveld 408576698