Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1266)

Unified Diff: third_party/WebKit/Source/wtf/Vector.h

Issue 1524813002: NOT FOR COMMIT: Copying the path command data directly into the path byte stream buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathByteStreamBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/Vector.h
diff --git a/third_party/WebKit/Source/wtf/Vector.h b/third_party/WebKit/Source/wtf/Vector.h
index b2f2954352d50616b92000f0d3159109b7dd6f35..423cb3a4b4dd6e491f099779ddd8105f4c44a575 100644
--- a/third_party/WebKit/Source/wtf/Vector.h
+++ b/third_party/WebKit/Source/wtf/Vector.h
@@ -748,6 +748,7 @@ public:
template <typename U> void append(const U&);
template <typename U> void uncheckedAppend(const U& val);
template <typename U, size_t otherCapacity, typename V> void appendVector(const Vector<U, otherCapacity, V>&);
+ T* appendUninitialized(size_t);
template <typename U> void insert(size_t position, const U*, size_t);
template <typename U> void insert(size_t position, const U&);
@@ -1194,6 +1195,22 @@ inline void Vector<T, inlineCapacity, Allocator>::appendVector(const Vector<U, o
}
template <typename T, size_t inlineCapacity, typename Allocator>
+T* Vector<T, inlineCapacity, Allocator>::appendUninitialized(size_t dataSize)
+{
+ ASSERT(Allocator::isAllocationAllowed());
+ size_t newSize = m_size + dataSize;
+ if (newSize > capacity()) {
+ expandCapacity(newSize);
+ ASSERT(begin());
+ }
+ RELEASE_ASSERT(newSize >= m_size);
+ T* dest = end();
+ ANNOTATE_CHANGE_SIZE(begin(), capacity(), m_size, newSize);
+ m_size = newSize;
+ return dest;
+}
+
+template <typename T, size_t inlineCapacity, typename Allocator>
template <typename U>
void Vector<T, inlineCapacity, Allocator>::insert(size_t position, const U* data, size_t dataSize)
{
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathByteStreamBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698