OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // ranging from |begin| upto but not including |end|. | 58 // ranging from |begin| upto but not including |end|. |
59 inline PassRefPtr<ArrayBuffer> slice(int begin, int end) const; | 59 inline PassRefPtr<ArrayBuffer> slice(int begin, int end) const; |
60 inline PassRefPtr<ArrayBuffer> slice(int begin) const; | 60 inline PassRefPtr<ArrayBuffer> slice(int begin) const; |
61 | 61 |
62 void addView(ArrayBufferView*); | 62 void addView(ArrayBufferView*); |
63 void removeView(ArrayBufferView*); | 63 void removeView(ArrayBufferView*); |
64 | 64 |
65 bool transfer(ArrayBufferContents&); | 65 bool transfer(ArrayBufferContents&); |
66 bool isNeutered() { return m_isNeutered; } | 66 bool isNeutered() { return m_isNeutered; } |
67 | 67 |
68 void setDeallocationObserver(ArrayBufferDeallocationObserver& observer) | |
69 { | |
70 m_contents.setDeallocationObserver(observer); | |
71 } | |
72 void setDeallocationObserverWithoutAllocationNotification(ArrayBufferDealloc
ationObserver& observer) | |
73 { | |
74 m_contents.setDeallocationObserverWithoutAllocationNotification(observer
); | |
75 } | |
76 | |
77 ~ArrayBuffer() { } | 68 ~ArrayBuffer() { } |
78 | 69 |
79 protected: | 70 protected: |
80 inline explicit ArrayBuffer(ArrayBufferContents&); | 71 inline explicit ArrayBuffer(ArrayBufferContents&); |
81 | 72 |
82 private: | 73 private: |
83 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize, ArrayBufferContents::InitializationPolicy); | 74 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize, ArrayBufferContents::InitializationPolicy); |
84 static inline PassRefPtr<ArrayBuffer> createOrNull(unsigned numElements, uns
igned elementByteSize, ArrayBufferContents::InitializationPolicy); | 75 static inline PassRefPtr<ArrayBuffer> createOrNull(unsigned numElements, uns
igned elementByteSize, ArrayBufferContents::InitializationPolicy); |
85 | 76 |
86 inline PassRefPtr<ArrayBuffer> sliceImpl(unsigned begin, unsigned end) const
; | 77 inline PassRefPtr<ArrayBuffer> sliceImpl(unsigned begin, unsigned end) const
; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 if (index < 0) | 185 if (index < 0) |
195 index = currentLength + index; | 186 index = currentLength + index; |
196 return clampValue(index, 0, currentLength); | 187 return clampValue(index, 0, currentLength); |
197 } | 188 } |
198 | 189 |
199 } // namespace WTF | 190 } // namespace WTF |
200 | 191 |
201 using WTF::ArrayBuffer; | 192 using WTF::ArrayBuffer; |
202 | 193 |
203 #endif // ArrayBuffer_h | 194 #endif // ArrayBuffer_h |
OLD | NEW |