Currently, blink has a ResourceClient interface that is used to listen to various steps in the resource loading process. The base class has a single NotifyFinished() callback, and subclasses provide others. The most full-featured of these is RawResourceClient, which provides callbacks for most (all?) of the IPCs the renderer process receives related to network requests. There are a couple weird details with the current hierachy:
* StyleSheetResourceClients never get the NotifyFinished() callback from the base class, and instead get custom SetCSSStyleSheet() or SetXSLStyleSheet() callbacks. These could be changed to use NotifyFinished()
* Multiple subclasses have callbacks for getting access to the data as it streams in, rather than waiting for the finish notifications (ScriptResourceClient, StyleSheetResourceClient, and RawResourceClient all do this). We could move this callback down to the base ResourceClient and standardize on that.
* By convention, classes don't implement ResourceClient directly, and always use an intermediate interface. There's no reason this is necessary, so with the first two changes, we can get rid of ScriptResourceClient, StyleSheetResourceClient, and DocumentResourceClient and have their users refer to ResourceClient directly.
Comment 1 by bugdroid1@chromium.org
, Nov 29 2017