OptimizationGuide: Move inquiry logic from WebContentsObserver
For code simplification, this CL moves logic to inquire about optimization hints for Blink from BlinkOptimizationGuideWebContentsObserver to BlinkOptimizationGuideInquirer. The observer creates and starts the inquirer when a main frame navigation gets ready to commit. If the inquirer for the previous navigation exists, it's destroyed at that point to abort inflight inquiries. > Motivation of this change Before this CL, the observer had mainly 2 responsibilities: (1) observing navigation events on WebContents, (2) inquiring the optimization guide service about hints. (1) is bound with the lifetime of WebContents, while (2) is bound with the lifetime of the main frame. The mismatch exists here. In terms of class modeling, (1) and (2) should have been in separate classes. To fix this mismatch, this CL moves (2) into BlinkOptimizationGuideInquirer. Change-Id: I713da144e4716c0d68f9a14fdc7d4ff6930fa77a Bug: 1113980 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358948 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:Matt Falkenhagen <falken@chromium.org> Reviewed-by:
Kinuko Yasuda <kinuko@chromium.org> Cr-Commit-Position: refs/heads/master@{#799023}
Showing
Please register or sign in to comment