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

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: sync 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
« no previous file with comments | « chrome/renderer/extensions/extension_dispatcher.h ('k') | chrome/renderer/extensions/extension_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9ed183928dfd4d046998e2a11da09f4c1641016d 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -154,10 +154,18 @@ 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_ExtensionEventAck(extension_id));
+ CheckIdleStatus(extension_id);
+ }
+}
+
+void ExtensionDispatcher::CheckIdleStatus(const std::string& extension_id) {
+ if (!ExtensionProcessBindings::HasPendingRequests(extension_id))
RenderThread::Get()->Send(new ExtensionHostMsg_ExtensionIdle(extension_id));
}
« no previous file with comments | « chrome/renderer/extensions/extension_dispatcher.h ('k') | chrome/renderer/extensions/extension_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698