Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 BASE_PICKLE_H__ | 5 #ifndef BASE_PICKLE_H__ |
| 6 #define BASE_PICKLE_H__ | 6 #define BASE_PICKLE_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 // what value types to read and in what order to read them as the Pickle does | 24 // what value types to read and in what order to read them as the Pickle does |
| 25 // not keep track of the type of data written to it. | 25 // not keep track of the type of data written to it. |
| 26 // | 26 // |
| 27 // The Pickle's data has a header which contains the size of the Pickle's | 27 // The Pickle's data has a header which contains the size of the Pickle's |
| 28 // payload. It can optionally support additional space in the header. That | 28 // payload. It can optionally support additional space in the header. That |
| 29 // space is controlled by the header_size parameter passed to the Pickle | 29 // space is controlled by the header_size parameter passed to the Pickle |
| 30 // constructor. | 30 // constructor. |
| 31 // | 31 // |
| 32 class Pickle { | 32 class Pickle { |
| 33 public: | 33 public: |
| 34 ~Pickle(); | 34 virtual ~Pickle(); |
|
wtc
2011/09/21 23:37:04
jar: I was wondering why the Pickle class has a vi
| |
| 35 | 35 |
| 36 // Initialize a Pickle object using the default header size. | 36 // Initialize a Pickle object using the default header size. |
| 37 Pickle(); | 37 Pickle(); |
| 38 | 38 |
| 39 // Initialize a Pickle object with the specified header size in bytes, which | 39 // Initialize a Pickle object with the specified header size in bytes, which |
| 40 // must be greater-than-or-equal-to sizeof(Pickle::Header). The header size | 40 // must be greater-than-or-equal-to sizeof(Pickle::Header). The header size |
| 41 // will be rounded up to ensure that the header size is 32bit-aligned. | 41 // will be rounded up to ensure that the header size is 32bit-aligned. |
| 42 explicit Pickle(int header_size); | 42 explicit Pickle(int header_size); |
| 43 | 43 |
| 44 // Initializes a Pickle from a const block of data. The data is not copied; | 44 // Initializes a Pickle from a const block of data. The data is not copied; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 // Allocation size of payload (or -1 if allocation is const). | 230 // Allocation size of payload (or -1 if allocation is const). |
| 231 size_t capacity_; | 231 size_t capacity_; |
| 232 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. | 232 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. |
| 233 | 233 |
| 234 FRIEND_TEST(PickleTest, Resize); | 234 FRIEND_TEST(PickleTest, Resize); |
| 235 FRIEND_TEST(PickleTest, FindNext); | 235 FRIEND_TEST(PickleTest, FindNext); |
| 236 FRIEND_TEST(PickleTest, IteratorHasRoom); | 236 FRIEND_TEST(PickleTest, IteratorHasRoom); |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 #endif // BASE_PICKLE_H__ | 239 #endif // BASE_PICKLE_H__ |
| OLD | NEW |