| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef MemoryInstrumentationString_h | 31 #ifndef MemoryInstrumentationString_h |
| 32 #define MemoryInstrumentationString_h | 32 #define MemoryInstrumentationString_h |
| 33 | 33 |
| 34 #include <wtf/MemoryInstrumentation.h> | 34 #include "wtf/MemoryInstrumentation.h" |
| 35 #include <wtf/text/AtomicString.h> | 35 #include "wtf/text/AtomicString.h" |
| 36 #include <wtf/text/CString.h> | 36 #include "wtf/text/CString.h" |
| 37 #include <wtf/text/StringBuilder.h> | 37 #include "wtf/text/StringBuilder.h" |
| 38 #include <wtf/text/WTFString.h> | 38 #include "wtf/text/WTFString.h" |
| 39 | 39 |
| 40 namespace WTF { | 40 namespace WTF { |
| 41 | 41 |
| 42 inline void reportMemoryUsage(const StringImpl* stringImpl, MemoryObjectInfo* me
moryObjectInfo) | 42 inline void reportMemoryUsage(const StringImpl* stringImpl, MemoryObjectInfo* me
moryObjectInfo) |
| 43 { | 43 { |
| 44 size_t selfSize = sizeof(StringImpl); | 44 size_t selfSize = sizeof(StringImpl); |
| 45 | 45 |
| 46 size_t length = stringImpl->length() + (stringImpl->hasTerminatingNullCharac
ter() ? 1 : 0); | 46 size_t length = stringImpl->length() + (stringImpl->hasTerminatingNullCharac
ter() ? 1 : 0); |
| 47 size_t bufferSize = length * (stringImpl->is8Bit() ? sizeof(LChar) : sizeof(
UChar)); | 47 size_t bufferSize = length * (stringImpl->is8Bit() ? sizeof(LChar) : sizeof(
UChar)); |
| 48 const void* buffer = stringImpl->is8Bit() ? static_cast<const void*>(stringI
mpl->characters8()) : static_cast<const void*>(stringImpl->characters16()); | 48 const void* buffer = stringImpl->is8Bit() ? static_cast<const void*>(stringI
mpl->characters8()) : static_cast<const void*>(stringImpl->characters16()); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 inline void reportMemoryUsage(const CString* cString, MemoryObjectInfo* memoryOb
jectInfo) | 92 inline void reportMemoryUsage(const CString* cString, MemoryObjectInfo* memoryOb
jectInfo) |
| 93 { | 93 { |
| 94 MemoryClassInfo info(memoryObjectInfo, cString); | 94 MemoryClassInfo info(memoryObjectInfo, cString); |
| 95 info.addMember(cString->buffer(), "buffer", RetainingPointer); | 95 info.addMember(cString->buffer(), "buffer", RetainingPointer); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } | 98 } |
| 99 | 99 |
| 100 #endif // !defined(MemoryInstrumentationVector_h) | 100 #endif // !defined(MemoryInstrumentationVector_h) |
| OLD | NEW |