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

Side by Side Diff: blimp/net/blimp_message_output_buffer.cc

Issue 2250433006: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « blimp/net/blimp_message_multiplexer.cc ('k') | blimp/net/blimp_message_thread_pipe.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/net/blimp_message_output_buffer.h" 5 #include "blimp/net/blimp_message_output_buffer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 message->set_message_id(++prev_message_id_); 68 message->set_message_id(++prev_message_id_);
69 69
70 current_buffer_size_bytes_ += message->ByteSize(); 70 current_buffer_size_bytes_ += message->ByteSize();
71 if (max_buffer_size_bytes_ < current_buffer_size_bytes_) 71 if (max_buffer_size_bytes_ < current_buffer_size_bytes_)
72 DLOG(WARNING) << "Output Buffer Size exceeds " << max_buffer_size_bytes_ 72 DLOG(WARNING) << "Output Buffer Size exceeds " << max_buffer_size_bytes_
73 << "bytes. Current size: " << current_buffer_size_bytes_ 73 << "bytes. Current size: " << current_buffer_size_bytes_
74 << " bytes."; 74 << " bytes.";
75 75
76 write_buffer_.push_back( 76 write_buffer_.push_back(
77 base::WrapUnique(new BufferEntry(std::move(message), callback))); 77 base::MakeUnique<BufferEntry>(std::move(message), callback));
78 78
79 // Write the message 79 // Write the message
80 if (write_buffer_.size() == 1 && output_processor_) { 80 if (write_buffer_.size() == 1 && output_processor_) {
81 WriteNextMessageIfReady(); 81 WriteNextMessageIfReady();
82 } 82 }
83 } 83 }
84 84
85 // Flushes acknowledged messages from the buffer and invokes their 85 // Flushes acknowledged messages from the buffer and invokes their
86 // |callbacks|, if any. 86 // |callbacks|, if any.
87 void BlimpMessageOutputBuffer::OnMessageCheckpoint(int64_t message_id) { 87 void BlimpMessageOutputBuffer::OnMessageCheckpoint(int64_t message_id) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 VLOG(2) << "Write result=" << net::ErrorToString(result); 151 VLOG(2) << "Write result=" << net::ErrorToString(result);
152 if (result == net::OK) { 152 if (result == net::OK) {
153 ack_buffer_.push_back(std::move(write_buffer_.front())); 153 ack_buffer_.push_back(std::move(write_buffer_.front()));
154 write_buffer_.pop_front(); 154 write_buffer_.pop_front();
155 WriteNextMessageIfReady(); 155 WriteNextMessageIfReady();
156 } 156 }
157 } 157 }
158 158
159 } // namespace blimp 159 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/blimp_message_multiplexer.cc ('k') | blimp/net/blimp_message_thread_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698