Factor out common part between ServiceWorkerSubresourceLoader and ServiceWorkerURLLoaderJob |
|||
Issue descriptionServiceWorkerSubresourceLoader and ServiceWorkerURLLoader have a lot of common code. We should factor out the common code so we don't have so much copy/paste coding. Note that ServiceWorkerSubresourceLoader lives in content/child (code that's executed in a renderer process), while ServiceWorkerURLLoader lives in content/browser (code that's executed in the browser process). The common code will have to live in the common place, which is called content/common. There are two rough approaches to take: 1) Create a common base class that the two classes inherit from. 2) Create a common helper class (or classes) that the two classes can use. In this case, I would probably attempt both approaches and see which looks to fit better, but my instinct is usually to go with 2).
,
Aug 28 2017
,
Sep 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/381696320505027cff278d61d029cc71e56143eb commit 381696320505027cff278d61d029cc71e56143eb Author: Emi Morikawa <emim@google.com> Date: Tue Sep 05 15:02:37 2017 Factor out common part between ServiceWorkerSubresourceLoader and ServiceWorkerURLLoaderJob Make new class "ServiceWorkerLoaderHelpers". This contains helper functions for service worker classes that use URLLoader. Bug: 758879 Change-Id: I286336903b6b750ee094947264b163e6debd4995 Reviewed-on: https://chromium-review.googlesource.com/644627 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Commit-Queue: Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#499632} [modify] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/browser/service_worker/service_worker_url_loader_job.cc [modify] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/browser/service_worker/service_worker_url_loader_job.h [modify] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/child/service_worker/service_worker_subresource_loader.cc [modify] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/child/service_worker/service_worker_subresource_loader.h [modify] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/common/BUILD.gn [modify] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/common/DEPS [add] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/common/service_worker/service_worker_loader_helpers.cc [add] https://crrev.com/381696320505027cff278d61d029cc71e56143eb/content/common/service_worker/service_worker_loader_helpers.h
,
Sep 11 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by kinuko@chromium.org
, Aug 25 2017