| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Creates a new ArrayBuffer object with copy of bytes in this object | 55 // Creates a new ArrayBuffer object with copy of bytes in this object |
| 56 // ranging from |begin| upto but not including |end|. | 56 // ranging from |begin| upto but not including |end|. |
| 57 inline PassRefPtr<ArrayBuffer> slice(int begin, int end) const; | 57 inline PassRefPtr<ArrayBuffer> slice(int begin, int end) const; |
| 58 inline PassRefPtr<ArrayBuffer> slice(int begin) const; | 58 inline PassRefPtr<ArrayBuffer> slice(int begin) const; |
| 59 | 59 |
| 60 void addView(ArrayBufferView*); | 60 void addView(ArrayBufferView*); |
| 61 void removeView(ArrayBufferView*); | 61 void removeView(ArrayBufferView*); |
| 62 | 62 |
| 63 bool transfer(ArrayBufferContents&); | 63 bool transfer(ArrayBufferContents&); |
| 64 bool isNeutered() { return m_isNeutered; } | 64 bool isNeutered() { return m_isNeutered; } |
| 65 bool isShared() { return m_contents.shared(); } |
| 65 | 66 |
| 66 void setDeallocationObserver(ArrayBufferDeallocationObserver* observer) { m_
contents.setDeallocationObserver(observer); } | 67 void setDeallocationObserver(ArrayBufferDeallocationObserver* observer) { m_
contents.setDeallocationObserver(observer); } |
| 67 | 68 |
| 68 ~ArrayBuffer() { } | 69 ~ArrayBuffer() { } |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize, ArrayBufferContents::InitializationPolicy); | 72 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize, ArrayBufferContents::InitializationPolicy); |
| 72 | 73 |
| 73 inline ArrayBuffer(ArrayBufferContents&); | 74 inline ArrayBuffer(ArrayBufferContents&); |
| 74 inline PassRefPtr<ArrayBuffer> sliceImpl(unsigned begin, unsigned end) const
; | 75 inline PassRefPtr<ArrayBuffer> sliceImpl(unsigned begin, unsigned end) const
; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 if (index < 0) | 172 if (index < 0) |
| 172 index = currentLength + index; | 173 index = currentLength + index; |
| 173 return clampValue(index, 0, currentLength); | 174 return clampValue(index, 0, currentLength); |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace WTF | 177 } // namespace WTF |
| 177 | 178 |
| 178 using WTF::ArrayBuffer; | 179 using WTF::ArrayBuffer; |
| 179 | 180 |
| 180 #endif // ArrayBuffer_h | 181 #endif // ArrayBuffer_h |
| OLD | NEW |