Shared/ServiceWorkers should not send IPCs for already counted features |
||||
Issue descriptionAPI use (UseCounter::Feature) on Shared/ServiceWorkerGlobalScope are propagated to connecting/controlling documents via the browser process and counted in their UseCounters. This IPC message should be sent only one time per feature and "browser->document" part is actually implemented in that manner (see SharedWorkerHost::CountFeature and ServiceWorkerVersion::CountFeature), but "worker->browser" IPC is sent every time a feature is used. This is not efficient.
,
May 2 2017
WIP CL: https://codereview.chromium.org/2857583003/ (I'll be OOO until May 8 and resume this work after that)
,
May 8 2017
Now working...
,
May 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c7acabe9f43065280edf2dee91ae53f6472dcf02 commit c7acabe9f43065280edf2dee91ae53f6472dcf02 Author: nhiroki <nhiroki@chromium.org> Date: Mon May 08 12:13:13 2017 Worker: Avoid sending IPC messages for features already counted When a feature listed on UseCounter::Feature is used on Shared/ServiceWorkerGlobalScope, it's reported to connecting/controlling documents via the browser process and counted in their UseCounters. These IPC messages should be sent only one time per feature, but unfortunately "worker->browser" IPC is sent every time a feature is used. This is not efficient. This CL memorizes feature use in worker-side and avoids sending duplicate IPC messages to the browser process. <Example of the calling sequence> (Some feature is used on ServiceWorkerGlobalScope) UseCounter::CountFeature - WorkerOrWorkletGlobalScope::CountFeature (memorizes feature use and returns early if it's already reported) - WorkerGlobalScope::ReportFeature - ServiceWorkerGlobalScopeProxy::CountFeature - ServiceWorkerContextClient (sends an IPC message to the browser) BUG= 714551 Review-Url: https://codereview.chromium.org/2857583003 Cr-Commit-Position: refs/heads/master@{#469965} [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/MainThreadWorkletTest.cpp [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.h [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp [modify] https://crrev.com/c7acabe9f43065280edf2dee91ae53f6472dcf02/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
,
May 14 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by nhiroki@chromium.org
, May 2 2017Labels: M-60
Status: Started (was: Assigned)