diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-26 19:16:56 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-26 19:16:56 +0000 |
commit | 60c528baea1363c118e1b790ef9b16b42680a116 (patch) | |
tree | fe12bd37feed8a21c218ea6595d29289543c5f1f /remoting/client/plugin/pepper_util.h | |
parent | 5ac1bf4e58860310e7794fdb3bcdf42698b84706 (diff) | |
download | chromium_src-60c528baea1363c118e1b790ef9b16b42680a116.zip chromium_src-60c528baea1363c118e1b790ef9b16b42680a116.tar.gz chromium_src-60c528baea1363c118e1b790ef9b16b42680a116.tar.bz2 |
Use PpCompletionCallback in PepperPortAllocatorSession.
Pepper may call callbacks even after the corresponding resource is destroyed.
PepperPortAllocatorSession didn't handle this case properly. Fixed it by using
PpCompletionCallback and weak pointers.
BUG=157404
Review URL: https://chromiumcodereview.appspot.com/11233071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/plugin/pepper_util.h')
-rw-r--r-- | remoting/client/plugin/pepper_util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/remoting/client/plugin/pepper_util.h b/remoting/client/plugin/pepper_util.h index b106b2f..63c0bce 100644 --- a/remoting/client/plugin/pepper_util.h +++ b/remoting/client/plugin/pepper_util.h @@ -21,6 +21,9 @@ namespace remoting { // Adapts a base::Callback to a pp::CompletionCallback, which may be passed to // exactly one Pepper API. If the adapted callback is not used then a copy of // |callback| will be leaked, including references & passed values bound to it. +// Pepper guarantees that each completion callback is called once and only once +// (aborted callbacks are called with PP_ABOIRTED), so there should be no leaks +// as long as the result of this function is passed to Pepper. pp::CompletionCallback PpCompletionCallback(base::Callback<void(int)> callback); // Helpers to convert between different socket address representations. |