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

Side by Side Diff: net/spdy/core/array_output_buffer.h

Issue 2926553004: Remove trailing semicolon at the end of a method definition (Closed)
Patch Set: rebase Created 3 years, 6 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 | « net/quic/test_tools/simulator/quic_endpoint.h ('k') | net/tools/quic/end_to_end_test.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef NET_SPDY_CORE_ARRAY_OUTPUT_BUFFER_H_ 5 #ifndef NET_SPDY_CORE_ARRAY_OUTPUT_BUFFER_H_
6 #define NET_SPDY_CORE_ARRAY_OUTPUT_BUFFER_H_ 6 #define NET_SPDY_CORE_ARRAY_OUTPUT_BUFFER_H_
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include "net/spdy/core/zero_copy_output_buffer.h" 9 #include "net/spdy/core/zero_copy_output_buffer.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 class ArrayOutputBuffer : public ZeroCopyOutputBuffer { 13 class ArrayOutputBuffer : public ZeroCopyOutputBuffer {
14 public: 14 public:
15 // |buffer| is pointed to the output to write to, and |size| is the capacity 15 // |buffer| is pointed to the output to write to, and |size| is the capacity
16 // of the output. 16 // of the output.
17 ArrayOutputBuffer(char* buffer, int64_t size) 17 ArrayOutputBuffer(char* buffer, int64_t size)
18 : current_(buffer), begin_(buffer), capacity_(size) {} 18 : current_(buffer), begin_(buffer), capacity_(size) {}
19 ~ArrayOutputBuffer() override{}; 19 ~ArrayOutputBuffer() override {}
20 20
21 ArrayOutputBuffer(const ArrayOutputBuffer&) = delete; 21 ArrayOutputBuffer(const ArrayOutputBuffer&) = delete;
22 ArrayOutputBuffer& operator=(const ArrayOutputBuffer&) = delete; 22 ArrayOutputBuffer& operator=(const ArrayOutputBuffer&) = delete;
23 23
24 void Next(char** data, int* size) override; 24 void Next(char** data, int* size) override;
25 void AdvanceWritePtr(int64_t count) override; 25 void AdvanceWritePtr(int64_t count) override;
26 uint64_t BytesFree() const override; 26 uint64_t BytesFree() const override;
27 27
28 size_t Size() const { return current_ - begin_; } 28 size_t Size() const { return current_ - begin_; }
29 char* Begin() const { return begin_; } 29 char* Begin() const { return begin_; }
30 30
31 // Resets the buffer to its original state. 31 // Resets the buffer to its original state.
32 void Reset() { 32 void Reset() {
33 capacity_ += Size(); 33 capacity_ += Size();
34 current_ = begin_; 34 current_ = begin_;
35 } 35 }
36 36
37 37
38 private: 38 private:
39 char* current_ = nullptr; 39 char* current_ = nullptr;
40 char* begin_ = nullptr; 40 char* begin_ = nullptr;
41 int64_t capacity_ = 0; 41 int64_t capacity_ = 0;
42 }; 42 };
43 43
44 } // namespace net 44 } // namespace net
45 45
46 #endif // NET_SPDY_CORE_ARRAY_OUTPUT_BUFFER_H_ 46 #endif // NET_SPDY_CORE_ARRAY_OUTPUT_BUFFER_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/simulator/quic_endpoint.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698