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

Side by Side Diff: base/containers/stack_container.h

Issue 16745002: Use a direct include of strings headers in base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/containers/hash_tables.h ('k') | base/debug/crash_logging.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_CONTAINERS_STACK_CONTAINER_H_ 5 #ifndef BASE_CONTAINERS_STACK_CONTAINER_H_
6 #define BASE_CONTAINERS_STACK_CONTAINER_H_ 6 #define BASE_CONTAINERS_STACK_CONTAINER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/aligned_memory.h"
13 #include "base/strings/string16.h"
12 #include "build/build_config.h" 14 #include "build/build_config.h"
13 #include "base/memory/aligned_memory.h"
14 #include "base/string16.h"
15 15
16 namespace base { 16 namespace base {
17 17
18 // This allocator can be used with STL containers to provide a stack buffer 18 // This allocator can be used with STL containers to provide a stack buffer
19 // from which to allocate memory and overflows onto the heap. This stack buffer 19 // from which to allocate memory and overflows onto the heap. This stack buffer
20 // would be allocated on the stack and allows us to avoid heap operations in 20 // would be allocated on the stack and allows us to avoid heap operations in
21 // some situations. 21 // some situations.
22 // 22 //
23 // STL likes to make copies of allocators, so the allocator itself can't hold 23 // STL likes to make copies of allocators, so the allocator itself can't hold
24 // the data. Instead, we make the creator responsible for creating a 24 // the data. Instead, we make the creator responsible for creating a
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // operator-> (using "->at()" does exception stuff we don't want). 249 // operator-> (using "->at()" does exception stuff we don't want).
250 T& operator[](size_t i) { return this->container().operator[](i); } 250 T& operator[](size_t i) { return this->container().operator[](i); }
251 const T& operator[](size_t i) const { 251 const T& operator[](size_t i) const {
252 return this->container().operator[](i); 252 return this->container().operator[](i);
253 } 253 }
254 }; 254 };
255 255
256 } // namespace base 256 } // namespace base
257 257
258 #endif // BASE_CONTAINERS_STACK_CONTAINER_H_ 258 #endif // BASE_CONTAINERS_STACK_CONTAINER_H_
OLDNEW
« no previous file with comments | « base/containers/hash_tables.h ('k') | base/debug/crash_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698