Fix Agent assignment when ContextDocument() has null frame

r669571 missed the case where ContextDocument() is not null but has a null frame.
This CL creates a new Agent in that case, just like we do for the FrameScheduler.

Bug: 974892
Change-Id: I1bae1d17653c0570f88ee15fbe4a220cd847ac84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663978
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670355}
1 file changed