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

Unified Diff: base/containers/stack_container.h

Issue 2817223002: Remove base::StackString. (Closed)
Patch Set: No template Created 3 years, 8 months 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 | « no previous file | tools/gn/escape.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/stack_container.h
diff --git a/base/containers/stack_container.h b/base/containers/stack_container.h
index 9e0efc13b41f428aeedf94efb8ec0c6a3cfb13b1..5090aaff3eae78f4392fcdc6df5e3d6a88c2ced5 100644
--- a/base/containers/stack_container.h
+++ b/base/containers/stack_container.h
@@ -7,12 +7,10 @@
#include <stddef.h>
-#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/aligned_memory.h"
-#include "base/strings/string16.h"
#include "build/build_config.h"
namespace base {
@@ -133,6 +131,10 @@ class StackAllocator : public std::allocator<T> {
// stack capacity will transparently overflow onto the heap. The container must
// support reserve().
//
+// This will not work with std::string since some implementations allocate
+// more bytes than requested in calls to reserve(), forcing the allocation onto
+// the heap. http://crbug.com/709273
+//
// WATCH OUT: the ContainerType MUST use the proper StackAllocator for this
// type. This object is really intended to be used only internally. You'll want
// to use the wrappers below for different types.
@@ -182,46 +184,6 @@ class StackContainer {
DISALLOW_COPY_AND_ASSIGN(StackContainer);
};
-// StackString -----------------------------------------------------------------
-
-template<size_t stack_capacity>
-class StackString : public StackContainer<
- std::basic_string<char,
- std::char_traits<char>,
- StackAllocator<char, stack_capacity> >,
- stack_capacity> {
- public:
- StackString() : StackContainer<
- std::basic_string<char,
- std::char_traits<char>,
- StackAllocator<char, stack_capacity> >,
- stack_capacity>() {
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(StackString);
-};
-
-// StackStrin16 ----------------------------------------------------------------
-
-template<size_t stack_capacity>
-class StackString16 : public StackContainer<
- std::basic_string<char16,
- base::string16_char_traits,
- StackAllocator<char16, stack_capacity> >,
- stack_capacity> {
- public:
- StackString16() : StackContainer<
- std::basic_string<char16,
- base::string16_char_traits,
- StackAllocator<char16, stack_capacity> >,
- stack_capacity>() {
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(StackString16);
-};
-
// StackVector -----------------------------------------------------------------
// Example:
« no previous file with comments | « no previous file | tools/gn/escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698