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

Unified Diff: remoting/base/buffered_socket_writer.cc

Issue 2386733002: Remove stl_util's deletion functions from remoting/. (Closed)
Patch Set: fix Created 4 years, 3 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 | « remoting/base/buffered_socket_writer.h ('k') | remoting/protocol/channel_multiplexer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/buffered_socket_writer.cc
diff --git a/remoting/base/buffered_socket_writer.cc b/remoting/base/buffered_socket_writer.cc
index bd401f8d5be09e473ec30349fea94b6d2521914c..f4e0b9d8c352d3de5d1c28c59037a74913ac3aaf 100644
--- a/remoting/base/buffered_socket_writer.cc
+++ b/remoting/base/buffered_socket_writer.cc
@@ -6,7 +6,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/socket/socket.h"
@@ -46,9 +46,7 @@ std::unique_ptr<BufferedSocketWriter> BufferedSocketWriter::CreateForSocket(
BufferedSocketWriter::BufferedSocketWriter() : weak_factory_(this) {}
-BufferedSocketWriter::~BufferedSocketWriter() {
- base::STLDeleteElements(&queue_);
-}
+BufferedSocketWriter::~BufferedSocketWriter() {}
void BufferedSocketWriter::Start(
const WriteCallback& write_callback,
@@ -68,7 +66,7 @@ void BufferedSocketWriter::Write(
if (closed_)
return;
- queue_.push_back(new PendingPacket(
+ queue_.push_back(base::MakeUnique<PendingPacket>(
new net::DrainableIOBuffer(data.get(), data->size()), done_task));
DoWrite();
@@ -107,7 +105,6 @@ void BufferedSocketWriter::HandleWriteResult(int result) {
if (queue_.front()->data->BytesRemaining() == 0) {
base::Closure done_task = queue_.front()->done_task;
- delete queue_.front();
queue_.pop_front();
if (!done_task.is_null())
« no previous file with comments | « remoting/base/buffered_socket_writer.h ('k') | remoting/protocol/channel_multiplexer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698