Fix PepperTCPSocketMessageFilter crashes.
When a PepperTCPSocketMessageFilter was torn down while it was waiting
on a callback that was passed to NetworkContext to be invoked, Chrome
would crash with a UAF once the callback was invoked. This CL fixes
that by using weak pointers, and fixes a similar issue with the
ServerSocket message filter as well.
Weak pointers are not used with callbacks that are passed to Mojo
pipes the classes own, as they won't be called on teardown, anyways.
This CL also adds a bunch of tests for tearing down the Pepper
MessageFilter while there's a live request in various states.
Commit-Queue: Matt Menke <email@example.com>
Reviewed-by: Bill Budge <firstname.lastname@example.org>
Reviewed-by: Maks Orlovich <email@example.com>
8 files changed