Chromium Code Reviews| Index: chrome/browser/memory/tab_manager.cc |
| diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc |
| index b6062ab348a7fc4de577743cd6eddddf47e7aff5..04c6a4bf10f93f2f874c8c787a639687118ad845 100644 |
| --- a/chrome/browser/memory/tab_manager.cc |
| +++ b/chrome/browser/memory/tab_manager.cc |
| @@ -51,6 +51,8 @@ |
| #include "content/public/browser/memory_pressure_controller.h" |
| #include "content/public/browser/navigation_controller.h" |
| #include "content/public/browser/render_process_host.h" |
| +#include "content/public/browser/service_worker_context.h" |
| +#include "content/public/browser/storage_partition.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/common/page_importance_signals.h" |
| @@ -459,6 +461,14 @@ bool TabManager::CanSuspendBackgroundedRenderer(int render_process_id) { |
| return false; |
| if (IsMediaTab(web_contents)) |
| return false; |
| + |
| + content::ServiceWorkerContext* sw_context = |
| + content::BrowserContext::GetDefaultStoragePartition( |
| + web_contents->GetBrowserContext())->GetServiceWorkerContext(); |
| + DCHECK(!sw_context); |
| + // -- THIS MUST BE CALLED ON THE IO THREAD -- |
| + if (sw_context->IsServiceWorkerExistsOnProcess(render_process_id)) |
|
shimazu
2016/12/13 04:16:36
This is a problem. Do you have any good idea to ca
nhiroki
2016/12/13 04:33:59
Are we on the UI thread here? If so, we could use
nhiroki
2016/12/13 04:34:56
(without thread hopping)
bashi
2016/12/13 04:40:17
Thank you for the info. Yes, we may want to use wo
|
| + return false; |
| } |
| return true; |
| } |