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

Issue 2574663002: TabManager checks if ServiceWorker exists on the suspending process (Closed)

Created:
4 years ago by shimazu
Modified:
4 years ago
Reviewers:
nhiroki, bashi
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, shimazu+serviceworker_chromium.org, serviceworker-reviews, jam, nhiroki, kinuko+serviceworker, horo+watch_chromium.org, darin-cc_chromium.org, kinuko+watch, tzik, blink-worker-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

TabManager checks if ServiceWorker exists on the suspending process If the suspending process has a worker thread, currently the worker won't respond with events any more. This patch is to keep the process running which has workers. BUG=671084

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -0 lines) Patch
M chrome/browser/memory/tab_manager.cc View 2 chunks +10 lines, -0 lines 4 comments Download
M content/browser/service_worker/embedded_worker_registry.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_registry.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.cc View 2 chunks +8 lines, -0 lines 0 comments Download
M content/public/browser/service_worker_context.h View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
shimazu
ptal. I tried to implement the check, but I found thread hopping looks necessary. https://codereview.chromium.org/2574663002/diff/1/chrome/browser/memory/tab_manager.cc ...
4 years ago (2016-12-13 04:16:36 UTC) #2
nhiroki
https://codereview.chromium.org/2574663002/diff/1/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2574663002/diff/1/chrome/browser/memory/tab_manager.cc#newcode470 chrome/browser/memory/tab_manager.cc:470: if (sw_context->IsServiceWorkerExistsOnProcess(render_process_id)) On 2016/12/13 04:16:36, shimazu wrote: > This ...
4 years ago (2016-12-13 04:33:59 UTC) #4
nhiroki
https://codereview.chromium.org/2574663002/diff/1/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2574663002/diff/1/chrome/browser/memory/tab_manager.cc#newcode470 chrome/browser/memory/tab_manager.cc:470: if (sw_context->IsServiceWorkerExistsOnProcess(render_process_id)) On 2016/12/13 04:33:59, nhiroki wrote: > On ...
4 years ago (2016-12-13 04:34:57 UTC) #5
bashi
4 years ago (2016-12-13 04:40:17 UTC) #6
https://codereview.chromium.org/2574663002/diff/1/chrome/browser/memory/tab_m...
File chrome/browser/memory/tab_manager.cc (right):

https://codereview.chromium.org/2574663002/diff/1/chrome/browser/memory/tab_m...
chrome/browser/memory/tab_manager.cc:470: if
(sw_context->IsServiceWorkerExistsOnProcess(render_process_id))
On 2016/12/13 04:34:56, nhiroki wrote:
> On 2016/12/13 04:33:59, nhiroki wrote:
> > On 2016/12/13 04:16:36, shimazu wrote:
> > > This is a problem. Do you have any good idea to call this from IO thread?
> > 
> > Are we on the UI thread here? If so, we could use RenderProcessHost's worker
> > counts:
> >
>
https://cs.chromium.org/chromium/src/content/public/browser/render_process_ho...
> 
> (without thread hopping)

Thank you for the info. Yes, we may want to use worker_ref_count() in
MemoryCoordinator::CanSuspendRenderer(). Do you have any idea how many renderers
that have worker_ref_count() > 0? If there are many renderers we can't suspend,
MC wouldn't work well...

Powered by Google App Engine
This is Rietveld 408576698