OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // Initialize a Pickle object with the specified header size in bytes, which | 108 // Initialize a Pickle object with the specified header size in bytes, which |
109 // must be greater-than-or-equal-to sizeof(Pickle::Header). The header size | 109 // must be greater-than-or-equal-to sizeof(Pickle::Header). The header size |
110 // will be rounded up to ensure that the header size is 32bit-aligned. | 110 // will be rounded up to ensure that the header size is 32bit-aligned. |
111 explicit Pickle(int header_size); | 111 explicit Pickle(int header_size); |
112 | 112 |
113 // Initializes a Pickle from a const block of data. The data is not copied; | 113 // Initializes a Pickle from a const block of data. The data is not copied; |
114 // instead the data is merely referenced by this Pickle. Only const methods | 114 // instead the data is merely referenced by this Pickle. Only const methods |
115 // should be used on the Pickle when initialized this way. The header | 115 // should be used on the Pickle when initialized this way. The header |
116 // padding size is deduced from the data length. | 116 // padding size is deduced from the data length. |
117 Pickle(const char* data, size_t data_len); | 117 Pickle(const char* data, int data_len); |
118 | 118 |
119 // Initializes a Pickle as a deep copy of another Pickle. | 119 // Initializes a Pickle as a deep copy of another Pickle. |
120 Pickle(const Pickle& other); | 120 Pickle(const Pickle& other); |
121 | 121 |
122 // Note: There are no virtual methods in this class. This destructor is | 122 // Note: There are no virtual methods in this class. This destructor is |
123 // virtual as an element of defensive coding. Other classes have derived from | 123 // virtual as an element of defensive coding. Other classes have derived from |
124 // this class, and there is a *chance* that they will cast into this base | 124 // this class, and there is a *chance* that they will cast into this base |
125 // class before destruction. At least one such class does have a virtual | 125 // class before destruction. At least one such class does have a virtual |
126 // destructor, suggesting at least some need to call more derived destructors. | 126 // destructor, suggesting at least some need to call more derived destructors. |
127 virtual ~Pickle(); | 127 virtual ~Pickle(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 339 } |
340 inline void WriteBytesCommon(const void* data, size_t length); | 340 inline void WriteBytesCommon(const void* data, size_t length); |
341 | 341 |
342 FRIEND_TEST_ALL_PREFIXES(PickleTest, Resize); | 342 FRIEND_TEST_ALL_PREFIXES(PickleTest, Resize); |
343 FRIEND_TEST_ALL_PREFIXES(PickleTest, FindNext); | 343 FRIEND_TEST_ALL_PREFIXES(PickleTest, FindNext); |
344 FRIEND_TEST_ALL_PREFIXES(PickleTest, FindNextWithIncompleteHeader); | 344 FRIEND_TEST_ALL_PREFIXES(PickleTest, FindNextWithIncompleteHeader); |
345 FRIEND_TEST_ALL_PREFIXES(PickleTest, FindNextOverflow); | 345 FRIEND_TEST_ALL_PREFIXES(PickleTest, FindNextOverflow); |
346 }; | 346 }; |
347 | 347 |
348 #endif // BASE_PICKLE_H__ | 348 #endif // BASE_PICKLE_H__ |
OLD | NEW |