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

Side by Side Diff: net/tools/balsa/simple_buffer.cc

Issue 25085002: Break out balsa and epoll_server from net/tools/flip_server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « net/tools/balsa/simple_buffer.h ('k') | net/tools/balsa/split.h » ('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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "net/tools/flip_server/simple_buffer.h" 5 #include "net/tools/balsa/simple_buffer.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 // Some of the following member functions are marked inlined, even though they 8 // Some of the following member functions are marked inlined, even though they
9 // are virtual. This may seem counter-intuitive, since virtual functions are 9 // are virtual. This may seem counter-intuitive, since virtual functions are
10 // generally not eligible for inlining. Profiling results indicate that these 10 // generally not eligible for inlining. Profiling results indicate that these
11 // large amount of runtime is spent on virtual function dispatch on these 11 // large amount of runtime is spent on virtual function dispatch on these
12 // simple functions. They are virtual because of the interface this class 12 // simple functions. They are virtual because of the interface this class
13 // inherits from. However, it is very unlikely that anyone will sub-class 13 // inherits from. However, it is very unlikely that anyone will sub-class
14 // SimpleBuffer and change their implementation. To get rid of this baggage, 14 // SimpleBuffer and change their implementation. To get rid of this baggage,
15 // internal implementation (e.g., Write) explicitly use SimpleBuffer:: to 15 // internal implementation (e.g., Write) explicitly use SimpleBuffer:: to
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // amount of data specified here is expected to 199 // amount of data specified here is expected to
200 // already be resident (as if it was Written) 200 // already be resident (as if it was Written)
201 inline void SimpleBuffer::AdvanceWritablePtr(int amount_to_advance) { 201 inline void SimpleBuffer::AdvanceWritablePtr(int amount_to_advance) {
202 write_idx_ += amount_to_advance; 202 write_idx_ += amount_to_advance;
203 if (write_idx_ > storage_size_) { 203 if (write_idx_ > storage_size_) {
204 write_idx_ = storage_size_; 204 write_idx_ = storage_size_;
205 } 205 }
206 } 206 }
207 207
208 } // namespace net 208 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/balsa/simple_buffer.h ('k') | net/tools/balsa/split.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698