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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // repeat calling it until it returns 0. | 93 // repeat calling it until it returns 0. |
94 // Usage: | 94 // Usage: |
95 // const char* segment; | 95 // const char* segment; |
96 // unsigned pos = 0; | 96 // unsigned pos = 0; |
97 // while (unsigned length = sharedBuffer->getSomeData(segment, pos)) { | 97 // while (unsigned length = sharedBuffer->getSomeData(segment, pos)) { |
98 // // Use the data. for example: decoder->decode(segment, length); | 98 // // Use the data. for example: decoder->decode(segment, length); |
99 // pos += length; | 99 // pos += length; |
100 // } | 100 // } |
101 unsigned getSomeData(const char*& data, unsigned position = 0) const; | 101 unsigned getSomeData(const char*& data, unsigned position = 0) const; |
102 | 102 |
103 void reportMemoryUsage(MemoryObjectInfo*) const; | |
104 | |
105 void createPurgeableBuffer() const; | 103 void createPurgeableBuffer() const; |
106 | 104 |
107 void tryReplaceContentsWithPlatformBuffer(SharedBuffer*); | 105 void tryReplaceContentsWithPlatformBuffer(SharedBuffer*); |
108 | 106 |
109 private: | 107 private: |
110 SharedBuffer(); | 108 SharedBuffer(); |
111 explicit SharedBuffer(size_t); | 109 explicit SharedBuffer(size_t); |
112 SharedBuffer(const char*, int); | 110 SharedBuffer(const char*, int); |
113 SharedBuffer(const unsigned char*, int); | 111 SharedBuffer(const unsigned char*, int); |
114 | 112 |
(...skipping 16 matching lines...) Expand all Loading... |
131 explicit SharedBuffer(CFDataRef); | 129 explicit SharedBuffer(CFDataRef); |
132 RetainPtr<CFDataRef> m_cfData; | 130 RetainPtr<CFDataRef> m_cfData; |
133 #endif | 131 #endif |
134 }; | 132 }; |
135 | 133 |
136 PassRefPtr<SharedBuffer> utf8Buffer(const String&); | 134 PassRefPtr<SharedBuffer> utf8Buffer(const String&); |
137 | 135 |
138 } // namespace WebCore | 136 } // namespace WebCore |
139 | 137 |
140 #endif // SharedBuffer_h | 138 #endif // SharedBuffer_h |
OLD | NEW |