Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: ppapi/cpp/array_output.h

Issue 9965080: Change the cpp wrappers of audio input/video capture to use CompletionCallbackWithOutput. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More changes in response to Brett's comments. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/cpp/array_output.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/array_output.h
diff --git a/ppapi/cpp/array_output.h b/ppapi/cpp/array_output.h
index 708150757d67dcc4ff354756759b72dfdebdf6bd..57fa79014061fc95ad9e9ce3a6e49ce81b01f5d3 100644
--- a/ppapi/cpp/array_output.h
+++ b/ppapi/cpp/array_output.h
@@ -201,6 +201,7 @@ class ArrayOutputAdapterWithStorage : public ArrayOutputAdapter<T> {
class VarArrayOutputAdapterWithStorage : public ArrayOutputAdapter<PP_Var> {
public:
VarArrayOutputAdapterWithStorage();
+ virtual ~VarArrayOutputAdapterWithStorage();
// Returns the final array of resource objects, converting the PP_Vars
// written by the browser to pp::Var objects.
@@ -237,6 +238,13 @@ class ResourceArrayOutputAdapterWithStorage
set_output(&temp_storage_);
}
+ virtual ~ResourceArrayOutputAdapterWithStorage() {
+ if (!temp_storage_.empty()) {
+ // An easy way to release the resource references held by this object.
+ output();
+ }
+ }
+
// Returns the final array of resource objects, converting the PP_Resources
// written by the browser to resource objects.
//
« no previous file with comments | « no previous file | ppapi/cpp/array_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698