views: Store the global set of desktop capture clients as weak pointers

This supports destruction of capture clients during the SetCapture loop.
Cached pointers should be invalidated when objects are destroyed mid-loop.

After, StatusBubbleViews destroys itself when hidden.
Context menus take capture from browsers, destroying the bubble and its capture client mid-loop.

Bug: 938127
Test: No status bubble UAFs when right-clicking links.
Change-Id: I147fc880410e216864699595a983c592ec84f040
Reviewed-by: Scott Violet <>
Commit-Queue: Michael Wasserman <>
Cr-Commit-Position: refs/heads/master@{#641225}
2 files changed