Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/iterators/ExponentialAccumulator.h |
| diff --git a/third_party/WebKit/Source/core/editing/iterators/ExponentialAccumulator.h b/third_party/WebKit/Source/core/editing/iterators/ExponentialAccumulator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..800b30e05e5b24ad2d9005660a71f5f07c6f4560 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/editing/iterators/ExponentialAccumulator.h |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ExponentialAccumulator_h |
| +#define ExponentialAccumulator_h |
| + |
| +#include "core/CoreExport.h" |
|
yosin_UTC9
2016/02/15 05:58:30
nit: Since nothing to export, we don't need to inc
|
| + |
| +namespace blink { |
| + |
| +class ExponentialAccumulator { |
|
yosin_UTC9
2016/02/15 05:58:30
|ExponentialAccumulator| does accumulate nothing.
|
| + STACK_ALLOCATED(); |
| + WTF_MAKE_NONCOPYABLE(ExponentialAccumulator); |
| +public: |
| + ExponentialAccumulator() {} |
| + int size() const { return m_size; } |
| + int capacity() const { return m_capacity; } |
| + void reset() { m_size = 0; } |
| + void grow(int delta) { m_size += delta; m_capacity += delta; } |
|
yosin_UTC9
2016/02/15 05:58:30
nit: enlarge() is better name?
nit: Don't have two
|
| + |
| +private: |
| + int m_size = 0; |
| + int m_capacity = 1024; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // ExponentialAccumulator_h |