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

Unified Diff: test/unittests/value-serializer-unittest.cc

Issue 2492943002: ValueSerializer: Replace use of std::vector with a delegate-allocated buffer. (Closed)
Patch Set: correct comment Created 4 years, 1 month 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 | « src/value-serializer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/value-serializer-unittest.cc
diff --git a/test/unittests/value-serializer-unittest.cc b/test/unittests/value-serializer-unittest.cc
index fafba2313e5aa16dca4ba459dcb63b527e8d7c6f..2a85cac96813e13375e59c207fd65342aab6eb19 100644
--- a/test/unittests/value-serializer-unittest.cc
+++ b/test/unittests/value-serializer-unittest.cc
@@ -111,7 +111,10 @@ class ValueSerializerTest : public TestWithIsolate {
return Nothing<std::vector<uint8_t>>();
}
AfterEncode();
- return Just(serializer.ReleaseBuffer());
+ std::pair<uint8_t*, size_t> buffer = serializer.Release();
+ std::vector<uint8_t> result(buffer.first, buffer.first + buffer.second);
+ free(buffer.first);
+ return Just(std::move(result));
}
template <typename InputFunctor, typename EncodedDataFunctor>
« no previous file with comments | « src/value-serializer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698