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

Side by Side Diff: tools/gn/value.h

Issue 2825853002: Improvements to uses of base::SmallMap (Closed)
Patch Set: Review comments 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 unified diff | Download patch
« no previous file with comments | « storage/browser/blob/blob_memory_controller.cc ('k') | ui/latency/latency_info.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 TOOLS_GN_VALUE_H_ 5 #ifndef TOOLS_GN_VALUE_H_
6 #define TOOLS_GN_VALUE_H_ 6 #define TOOLS_GN_VALUE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // false and sets the error. 113 // false and sets the error.
114 bool VerifyTypeIs(Type t, Err* err) const; 114 bool VerifyTypeIs(Type t, Err* err) const;
115 115
116 // Compares values. Only the "value" is compared, not the origin. 116 // Compares values. Only the "value" is compared, not the origin.
117 bool operator==(const Value& other) const; 117 bool operator==(const Value& other) const;
118 bool operator!=(const Value& other) const; 118 bool operator!=(const Value& other) const;
119 119
120 private: 120 private:
121 // This are a lot of objects associated with every Value that need 121 // This are a lot of objects associated with every Value that need
122 // initialization and tear down every time. It might be more efficient to 122 // initialization and tear down every time. It might be more efficient to
123 // create a union of ManualConstructor objects (see SmallMap) and only 123 // create a union of ManualConstructor objects (see small_map) and only
124 // use the one we care about. 124 // use the one we care about.
125 Type type_; 125 Type type_;
126 std::string string_value_; 126 std::string string_value_;
127 bool boolean_value_; 127 bool boolean_value_;
128 int64_t int_value_; 128 int64_t int_value_;
129 std::vector<Value> list_value_; 129 std::vector<Value> list_value_;
130 std::unique_ptr<Scope> scope_value_; 130 std::unique_ptr<Scope> scope_value_;
131 131
132 const ParseNode* origin_; 132 const ParseNode* origin_;
133 }; 133 };
134 134
135 #endif // TOOLS_GN_VALUE_H_ 135 #endif // TOOLS_GN_VALUE_H_
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_memory_controller.cc ('k') | ui/latency/latency_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698