Eliminate ExtensionAPIFrameIdMap |
||||
Issue descriptionExtensionFrameIdMap maps pairs of (Render process id, routing id or render frame host id) to its corresponding FrameData (frame_id, parent_frame_id, tab_id, window_id). Here "frame_id" refers to the FrameTreeNodeID (FTNId) of the frame. This data is persisted on the UI thread (by listening on to RenderFrameCreated etc.). This is read on the IO thread with synchronization achieved using locks. ExtensionApiFrameIdMap is used by the Web Request API on the IO thread to access FrameData for a network request. This is done only for sub-resource loads (For navigation requests, FrameData is available as part of NavigationUIData (with PlzNavigate)). As per UMA, about 0.2% of times, the FrameData for a request is not available on the IO thread. In these cases, we hop to the UI thread and back, blocking the request till then. It would be nice to eliminate this and have the FrameData for a request always available on the IO thread.
,
Feb 15 2018
1) This is hard to do in the current state of the code, in particular since we're heavily refactoring the network stack and how it interacts with content as part of the network service. I think if we want to invest in a solution, it should be one that works with the network service. 2) No: requests are received on the IO thread. If we wanted to initialize this struct on the UI thread, we'd have to block every single subresource request on a round-trip to the UI thread. This is strictly worse than blocking 0.2% of the time. More generally, as explained in 1), this area of the code is changing due to the network service happening. Do you already have a plan in place for how WebURLRequest will be supported in the network service world? If not, this is where we should start. If that plan is there and still relies on the ExtensionAPIFrameIdMap, then we can have a look at eliminating it, we might be easier to do in a network service world by relying on subresource URLLoaderFactories. +jam for network service related questions.
,
Feb 15 2018
cc: rockot@ who is working on supporting web request API with network service. Ken, can you look at the bug and elaborate a bit on how will constructs like FrameData (associating network requests with render frames) look in a network-service world. Would constructs like ExtensionAPIFrameIDMap no longer be needed?
,
Feb 15 2018
Right, anything which exists for the sole purpose of duplicating UI-thread data on the IO-thread (which seems to be the point of ExtensionAPIFrameIDMap) should disappear. In general once the network stack is moved off the IO thread there are really no legitimate reasons for extensions to be doing work there.
,
Feb 15 2018
Sounds good, will close this then. |
||||
►
Sign in to add a comment |
||||
Comment 1 by karandeepb@chromium.org
, Feb 15 2018