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

Unified Diff: src/messages.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/messages.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index aa453ed50eb55c00bfd1d2db12160e58a70e809e..ae99df29ddaa6ad912fb3367080a395d7ffe1b2c 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -4,6 +4,8 @@
#include "src/messages.h"
+#include <memory>
+
#include "src/api.h"
#include "src/bootstrapper.h"
#include "src/execution.h"
@@ -31,13 +33,13 @@ MessageLocation::MessageLocation() : start_pos_(-1), end_pos_(-1) {}
void MessageHandler::DefaultMessageReport(Isolate* isolate,
const MessageLocation* loc,
Handle<Object> message_obj) {
- base::SmartArrayPointer<char> str = GetLocalizedMessage(isolate, message_obj);
+ std::unique_ptr<char[]> str = GetLocalizedMessage(isolate, message_obj);
if (loc == NULL) {
PrintF("%s\n", str.get());
} else {
HandleScope scope(isolate);
Handle<Object> data(loc->script()->name(), isolate);
- base::SmartArrayPointer<char> data_str;
+ std::unique_ptr<char[]> data_str;
if (data->IsString())
data_str = Handle<String>::cast(data)->ToCString(DISALLOW_NULLS);
PrintF("%s:%i: %s\n", data_str.get() ? data_str.get() : "<unknown>",
@@ -159,8 +161,7 @@ Handle<String> MessageHandler::GetMessage(Isolate* isolate,
return MessageTemplate::FormatMessage(isolate, message->type(), arg);
}
-
-base::SmartArrayPointer<char> MessageHandler::GetLocalizedMessage(
+std::unique_ptr<char[]> MessageHandler::GetLocalizedMessage(
Isolate* isolate, Handle<Object> data) {
HandleScope scope(isolate);
return GetMessage(isolate, data)->ToCString(DISALLOW_NULLS);
« no previous file with comments | « src/messages.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698