OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // Calling this function will force internal segmented buffers to be merged | 54 // Calling this function will force internal segmented buffers to be merged |
55 // into a flat buffer. Use getSomeData() whenever possible for better | 55 // into a flat buffer. Use getSomeData() whenever possible for better |
56 // performance. | 56 // performance. |
57 const char* data() const; | 57 const char* data() const; |
58 | 58 |
59 unsigned size() const; | 59 unsigned size() const; |
60 | 60 |
61 bool isEmpty() const { return !size(); } | 61 bool isEmpty() const { return !size(); } |
62 | 62 |
63 void append(SharedBuffer*); | 63 void append(PassRefPtr<SharedBuffer>); |
64 void append(const char*, unsigned); | 64 void append(const char*, unsigned); |
65 void append(const Vector<char>&); | 65 void append(const Vector<char>&); |
66 | 66 |
67 void clear(); | 67 void clear(); |
68 | 68 |
69 PassRefPtr<SharedBuffer> copy() const; | 69 PassRefPtr<SharedBuffer> copy() const; |
70 | 70 |
71 // Return the number of consecutive bytes after "position". "data" | 71 // Return the number of consecutive bytes after "position". "data" |
72 // points to the first byte. | 72 // points to the first byte. |
73 // Return 0 when no more data left. | 73 // Return 0 when no more data left. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 void mergeSegmentsIntoBuffer() const; | 112 void mergeSegmentsIntoBuffer() const; |
113 | 113 |
114 unsigned m_size; | 114 unsigned m_size; |
115 mutable PurgeableVector m_buffer; | 115 mutable PurgeableVector m_buffer; |
116 mutable Vector<char*> m_segments; | 116 mutable Vector<char*> m_segments; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace WebCore | 119 } // namespace WebCore |
120 | 120 |
121 #endif // SharedBuffer_h | 121 #endif // SharedBuffer_h |
OLD | NEW |