Chromium Code Reviews| Index: src/utils.h |
| =================================================================== |
| --- src/utils.h (revision 1718) |
| +++ src/utils.h (working copy) |
| @@ -406,6 +406,16 @@ |
| }; |
| +template <typename T> |
| +class ScopedVector : public Vector<T> { |
| + public: |
| + ScopedVector(int length) : Vector<T>(NewArray<T>(length), length) { } |
| + ~ScopedVector() { |
| + DeleteArray(this->start()); |
| + } |
| +}; |
| + |
| + |
| inline Vector<const char> CStrVector(const char* data) { |
| return Vector<const char>(data, strlen(data)); |
| } |