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

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

Issue 1823383002: blimp: Increase max payload size limit from 1MB to 5MB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment. Created 4 years, 9 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 | « no previous file | blimp/net/common.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/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 void BlimpMessageOutputBuffer::ProcessMessage( 60 void BlimpMessageOutputBuffer::ProcessMessage(
61 scoped_ptr<BlimpMessage> message, 61 scoped_ptr<BlimpMessage> message,
62 const net::CompletionCallback& callback) { 62 const net::CompletionCallback& callback) {
63 DVLOG(2) << "OutputBuffer::ProcessMessage " << *message; 63 DVLOG(2) << "OutputBuffer::ProcessMessage " << *message;
64 64
65 message->set_message_id(++prev_message_id_); 65 message->set_message_id(++prev_message_id_);
66 66
67 current_buffer_size_bytes_ += message->ByteSize(); 67 current_buffer_size_bytes_ += message->ByteSize();
68 DCHECK_GE(max_buffer_size_bytes_, current_buffer_size_bytes_); 68 if (max_buffer_size_bytes_ < current_buffer_size_bytes_)
69 DLOG(WARNING) << "Output Buffer Size exceeds " << max_buffer_size_bytes_
70 << "bytes. Current size: " << current_buffer_size_bytes_
71 << " bytes.";
69 72
70 write_buffer_.push_back( 73 write_buffer_.push_back(
71 make_scoped_ptr(new BufferEntry(std::move(message), callback))); 74 make_scoped_ptr(new BufferEntry(std::move(message), callback)));
72 75
73 // Write the message 76 // Write the message
74 if (write_buffer_.size() == 1 && output_processor_) { 77 if (write_buffer_.size() == 1 && output_processor_) {
75 WriteNextMessageIfReady(); 78 WriteNextMessageIfReady();
76 } 79 }
77 } 80 }
78 81
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 write_buffer_.pop_front(); 151 write_buffer_.pop_front();
149 WriteNextMessageIfReady(); 152 WriteNextMessageIfReady();
150 } else { 153 } else {
151 // An error occurred while writing to the network connection. 154 // An error occurred while writing to the network connection.
152 // Stop writing more messages until a new connection is established. 155 // Stop writing more messages until a new connection is established.
153 DLOG(WARNING) << "Write error (result=" << result << ")"; 156 DLOG(WARNING) << "Write error (result=" << result << ")";
154 } 157 }
155 } 158 }
156 159
157 } // namespace blimp 160 } // namespace blimp
OLDNEW
« no previous file with comments | « no previous file | blimp/net/common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698