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

Unified Diff: ppapi/tests/test_utils.h

Issue 18611004: PPAPI: Initialize CompletionCallbackWithOutput storage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 7 years, 5 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 | « ppapi/tests/test_network_proxy.cc ('k') | ppapi/utility/completion_callback_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_utils.h
diff --git a/ppapi/tests/test_utils.h b/ppapi/tests/test_utils.h
index 8cd32d55c53d2293c9ec676b20966308a514199e..357a1c6a1543ea813af8a44d533eed7bd696fbe5 100644
--- a/ppapi/tests/test_utils.h
+++ b/ppapi/tests/test_utils.h
@@ -188,16 +188,22 @@ template <typename OutputT, typename CallbackT>
class TestCompletionCallbackWithOutputBase {
public:
explicit TestCompletionCallbackWithOutputBase(PP_Instance instance)
- : callback_(instance) {
+ : callback_(instance),
+ output_storage_() {
+ CallbackT::TraitsType::Initialize(&output_storage_);
}
TestCompletionCallbackWithOutputBase(PP_Instance instance, bool force_async)
- : callback_(instance, force_async) {
+ : callback_(instance, force_async),
+ output_storage_() {
+ CallbackT::TraitsType::Initialize(&output_storage_);
}
TestCompletionCallbackWithOutputBase(PP_Instance instance,
CallbackType callback_type)
- : callback_(instance, callback_type) {
+ : callback_(instance, callback_type),
+ output_storage_() {
+ CallbackT::TraitsType::Initialize(&output_storage_);
}
CallbackT GetCallback();
@@ -217,7 +223,10 @@ class TestCompletionCallbackWithOutputBase {
bool failed() { return callback_.failed(); }
const std::string& errors() { return callback_.errors(); }
int32_t result() const { return callback_.result(); }
- void Reset() { return callback_.Reset(); }
+ void Reset() {
+ CallbackT::TraitsType::Initialize(&output_storage_);
+ return callback_.Reset();
+ }
private:
TestCompletionCallback callback_;
@@ -227,7 +236,7 @@ class TestCompletionCallbackWithOutputBase {
template <typename OutputT, typename CallbackT>
CallbackT
TestCompletionCallbackWithOutputBase<OutputT, CallbackT>::GetCallback() {
- callback_.Reset();
+ this->Reset();
if (callback_.callback_type() == PP_BLOCKING) {
CallbackT cc(&output_storage_);
return cc;
« no previous file with comments | « ppapi/tests/test_network_proxy.cc ('k') | ppapi/utility/completion_callback_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698