Pepper: Fix renderer crash on plugin destruction.
commitf693a594f48a2fcc31ca73417de744287a103a83
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 5 Aug 2014 06:41:00 +0000 (5 06:41 +0000)
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 5 Aug 2014 06:41:00 +0000 (5 06:41 +0000)
treea3d07a54c376bb74c84ee7b22003cf8629435d66
parent89eaeab398d3b8887df7da68b5730c0f5d709895
Pepper: Fix renderer crash on plugin destruction.

The FileDownloader refactor caused callbacks to be more tightly bound to
PnaclCoordinator than they were previously. Before the refactor, callbacks that
were invoked as the pexe was downloaded (or the cached translated nexe was
received) were generated through the CompletionCallbackFactory interface, which
would cause them to be cancelled when PnaclCoordinator was destroyed.

This change checks that the plugin instance is still alive before calling any
of the callbacks in the PPP_PexeStreamHandler interface.

I tried conducting some local testing, but didn't manage to hit quite the same
codepath as the one reported in the bug.

BUG=400171

Review URL: https://codereview.chromium.org/433633003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287472 0039d316-1c4b-4281-b951-d872f2087c98
components/nacl/renderer/ppb_nacl_private_impl.cc