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

Unified Diff: native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc

Issue 443693002: [NaCl SDK] nacl_io: Remove use of new/delete for data buffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc b/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc
index 816f8e9a832498ed78f2b312af2617c6d0e6f8b6..9b0bfc8f1801f9fa26c1c36f4259fb158b30fa96 100644
--- a/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc
+++ b/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc
@@ -96,11 +96,8 @@ class UdpRecvWork : public UdpWork {
public:
explicit UdpRecvWork(const ScopedUdpEventEmitter& emitter)
: UdpWork(emitter) {
- data_ = new char[kMaxPacketSize];
}
- ~UdpRecvWork() { delete[] data_; }
-
virtual bool Start(int32_t val) {
AUTO_LOCK(emitter_->GetLock());
UdpNode* stream = static_cast<UdpNode*>(emitter_->stream());
@@ -146,7 +143,7 @@ class UdpRecvWork : public UdpWork {
}
private:
- char* data_;
+ char data_[kMaxPacketSize];
PP_Resource addr_;
};
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698