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

Unified Diff: src/debug-agent.cc

Issue 1737023: Turn some usages of NewArray with DeleteArray in the same scope into ScopedVector or SmartPointer. (Closed)
Patch Set: Disabling implicit constructors Created 10 years, 8 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/debug.cc ('k') | src/flags.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-agent.cc
diff --git a/src/debug-agent.cc b/src/debug-agent.cc
index 41151d8076c49bce3358bba12fffc3245b90bb13..e2d9304338738d0a606fee1c87424d7cb8072f7e 100644
--- a/src/debug-agent.cc
+++ b/src/debug-agent.cc
@@ -181,15 +181,15 @@ void DebuggerAgentSession::Run() {
buf.GetNext();
len++;
}
- int16_t* temp = NewArray<int16_t>(len + 1);
+ ScopedVector<int16_t> temp(len + 1);
buf.Reset(*message, StrLength(*message));
for (int i = 0; i < len; i++) {
temp[i] = buf.GetNext();
}
// Send the request received to the debugger.
- v8::Debug::SendCommand(reinterpret_cast<const uint16_t *>(temp), len);
- DeleteArray(temp);
+ v8::Debug::SendCommand(reinterpret_cast<const uint16_t *>(temp.start()),
+ len);
}
}
« no previous file with comments | « src/debug.cc ('k') | src/flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698