Refactor around ppb_nacl_private_impl and TrustedPluginChannel.
This is the preparation to add new IPC channel for EmbedderServiceChannel.
This contains several small refactoring:
1) Introduces IsValidChannelHandle() to avoid copy-and-paste code.
2) Removes unnecessary "static" keywords.
3) Uses base::Callback instead of PP_CompletionCallback for
TrustedPluginChannel. After we add EmbedderServiceChannel, it is
necessary to wait that the channels are established in parallel.
So, the callback needs to count the number of invocations.
base::Callback makes it much easier than PP_CompletionCallback.
4) Removes unnecessary include directive from the header file.
Instead, uses forward declaration.
5) Invokes connected_callback in dtor if it is not called yet.
6) Invokes completion_callback if trusted plugin channel is somehow
accidentally not created to handle error properly.
TEST=Ran trybots.
BUG=358431
Review URL: https://codereview.chromium.org/
224003002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261675 0039d316-1c4b-4281-b951-d872f2087c98