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

Unified Diff: src/string-stream.cc

Issue 2173403002: Replace SmartArrayPointer<T> with unique_ptr<T[]> (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 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 | « src/string-stream.h ('k') | src/wasm/decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index 781f8cd6bf2d5ba1a4401e7b6b177766160ab29d..3ae4580709c25ab058983c6d00b873e18ba82991 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -4,6 +4,8 @@
#include "src/string-stream.h"
+#include <memory>
+
#include "src/handles-inl.h"
#include "src/prototype.h"
@@ -249,12 +251,11 @@ void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1,
Add(CStrVector(format), Vector<FmtElm>(argv, argc));
}
-
-base::SmartArrayPointer<const char> StringStream::ToCString() const {
+std::unique_ptr<char[]> StringStream::ToCString() const {
char* str = NewArray<char>(length_ + 1);
MemCopy(str, buffer_, length_);
str[length_] = '\0';
- return base::SmartArrayPointer<const char>(str);
+ return std::unique_ptr<char[]>(str);
}
« no previous file with comments | « src/string-stream.h ('k') | src/wasm/decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698