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

Side by Side Diff: third_party/protobuf/src/google/protobuf/extension_set.cc

Issue 6737030: third_party/protobuf: update to upstream r371 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved. 2 // Copyright 2008 Google Inc. All rights reserved.
3 // http://code.google.com/p/protobuf/ 3 // http://code.google.com/p/protobuf/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 GOOGLE_DCHECK(!iter->second.is_repeated); 179 GOOGLE_DCHECK(!iter->second.is_repeated);
180 return !iter->second.is_cleared; 180 return !iter->second.is_cleared;
181 } 181 }
182 182
183 int ExtensionSet::ExtensionSize(int number) const { 183 int ExtensionSet::ExtensionSize(int number) const {
184 map<int, Extension>::const_iterator iter = extensions_.find(number); 184 map<int, Extension>::const_iterator iter = extensions_.find(number);
185 if (iter == extensions_.end()) return false; 185 if (iter == extensions_.end()) return false;
186 return iter->second.GetSize(); 186 return iter->second.GetSize();
187 } 187 }
188 188
189 FieldType ExtensionSet::ExtensionType(int number) const {
190 map<int, Extension>::const_iterator iter = extensions_.find(number);
191 if (iter == extensions_.end()) {
192 GOOGLE_LOG(DFATAL) << "Don't lookup extension types if they aren't present ( 1). ";
193 return 0;
194 }
195 if (iter->second.is_cleared) {
196 GOOGLE_LOG(DFATAL) << "Don't lookup extension types if they aren't present ( 2). ";
197 }
198 return iter->second.type;
199 }
200
189 void ExtensionSet::ClearExtension(int number) { 201 void ExtensionSet::ClearExtension(int number) {
190 map<int, Extension>::iterator iter = extensions_.find(number); 202 map<int, Extension>::iterator iter = extensions_.find(number);
191 if (iter == extensions_.end()) return; 203 if (iter == extensions_.end()) return;
192 iter->second.Clear(); 204 iter->second.Clear();
193 } 205 }
194 206
195 // =================================================================== 207 // ===================================================================
196 // Field accessors 208 // Field accessors
197 209
198 namespace { 210 namespace {
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 } 1457 }
1446 } 1458 }
1447 } 1459 }
1448 1460
1449 // Defined in extension_set_heavy.cc. 1461 // Defined in extension_set_heavy.cc.
1450 // int ExtensionSet::Extension::SpaceUsedExcludingSelf() const 1462 // int ExtensionSet::Extension::SpaceUsedExcludingSelf() const
1451 1463
1452 } // namespace internal 1464 } // namespace internal
1453 } // namespace protobuf 1465 } // namespace protobuf
1454 } // namespace google 1466 } // namespace google
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698