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

Side by Side Diff: net/spdy/spdy_prefixed_buffer_reader.h

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SPDY_PREFIXED_BUFFER_READER_H_ 5 #ifndef NET_SPDY_SPDY_PREFIXED_BUFFER_READER_H_
6 #define NET_SPDY_SPDY_PREFIXED_BUFFER_READER_H_ 6 #define NET_SPDY_SPDY_PREFIXED_BUFFER_READER_H_
7 7
8 #include "net/base/net_export.h" 8 #include "net/base/net_export.h"
9 #include "net/spdy/spdy_pinnable_buffer_piece.h" 9 #include "net/spdy/spdy_pinnable_buffer_piece.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 // Reader class which simplifies reading contiguously from 13 // Reader class which simplifies reading contiguously from
14 // from a disjoint buffer prefix & suffix. 14 // from a disjoint buffer prefix & suffix.
15 class NET_EXPORT_PRIVATE SpdyPrefixedBufferReader { 15 class NET_EXPORT_PRIVATE SpdyPrefixedBufferReader {
16 public: 16 public:
17 SpdyPrefixedBufferReader(const char* prefix, size_t prefix_length, 17 SpdyPrefixedBufferReader(const char* prefix,
18 const char* suffix, size_t suffix_length); 18 size_t prefix_length,
19 const char* suffix,
20 size_t suffix_length);
19 21
20 // Returns number of bytes available to be read. 22 // Returns number of bytes available to be read.
21 size_t Available(); 23 size_t Available();
22 24
23 // Reads |count| bytes, copying into |*out|. Returns true on success, 25 // Reads |count| bytes, copying into |*out|. Returns true on success,
24 // false if not enough bytes were available. 26 // false if not enough bytes were available.
25 bool ReadN(size_t count, char* out); 27 bool ReadN(size_t count, char* out);
26 28
27 // Reads |count| bytes, returned in |*out|. Returns true on success, 29 // Reads |count| bytes, returned in |*out|. Returns true on success,
28 // false if not enough bytes were available. 30 // false if not enough bytes were available.
29 bool ReadN(size_t count, SpdyPinnableBufferPiece* out); 31 bool ReadN(size_t count, SpdyPinnableBufferPiece* out);
30 32
31 private: 33 private:
32 const char* prefix_; 34 const char* prefix_;
33 const char* suffix_; 35 const char* suffix_;
34 36
35 size_t prefix_length_; 37 size_t prefix_length_;
36 size_t suffix_length_; 38 size_t suffix_length_;
37 }; 39 };
38 40
39 } // namespace net 41 } // namespace net
40 42
41 #endif // NET_SPDY_SPDY_PREFIXED_BUFFER_READER_H_ 43 #endif // NET_SPDY_SPDY_PREFIXED_BUFFER_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698