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

Unified Diff: chrome/browser/extensions/extension_process_manager.cc

Issue 11117011: Keep browser process alive while there are platform apps with background pages running. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Delegated Created 8 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/browser/extensions/extension_process_manager.cc
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index 6a2a88f720126915fbdb8b8eb973fe0726d4bbe3..ffd661a684e7dba079969f86884a90b7de7ae8f3 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -11,6 +11,7 @@
#include "base/string_number_conversions.h"
#include "base/time.h"
#include "chrome/browser/extensions/api/runtime/runtime_api.h"
+#include "chrome/browser/extensions/app_extension_host_delegate.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_info_map.h"
@@ -217,9 +218,11 @@ ExtensionHost* ExtensionProcessManager::CreateViewHost(
ExtensionHost* host =
#if defined(OS_MACOSX)
new extensions::ExtensionHostMac(
- extension, GetSiteInstanceForURL(url), url, view_type);
+ extension, new ExtensionHost::Delegate(),
+ GetSiteInstanceForURL(url), url, view_type);
#else
- new ExtensionHost(extension, GetSiteInstanceForURL(url), url, view_type);
+ new ExtensionHost(extension, new ExtensionHost::Delegate(),
+ GetSiteInstanceForURL(url), url, view_type);
#endif
host->CreateView(browser);
OnExtensionHostCreated(host, false);
@@ -280,14 +283,20 @@ void ExtensionProcessManager::CreateBackgroundHost(
if (GetBackgroundHostForExtension(extension->id()))
return;
+ ExtensionHost::Delegate* host_delegate;
+ if (extension->is_platform_app())
+ host_delegate = new extensions::AppBackgroundHostDelegate();
+ else
+ host_delegate = new ExtensionHost::Delegate();
+
ExtensionHost* host =
#if defined(OS_MACOSX)
new extensions::ExtensionHostMac(
- extension, GetSiteInstanceForURL(url), url,
+ extension, host_delegate, GetSiteInstanceForURL(url), url,
chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
#else
- new ExtensionHost(extension, GetSiteInstanceForURL(url), url,
- chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
+ new ExtensionHost(extension, host_delegate, GetSiteInstanceForURL(url),
+ url, chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
#endif
host->CreateRenderViewSoon();

Powered by Google App Engine
This is Rietveld 408576698