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

Side by Side Diff: net/cert/crl_set_storage.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply fixups Created 5 years, 11 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 | « net/base/prioritized_dispatcher_unittest.cc ('k') | net/cookies/cookie_monster.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "net/cert/crl_set_storage.h" 5 #include "net/cert/crl_set_storage.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 // static 290 // static
291 bool CRLSetStorage::Parse(base::StringPiece data, 291 bool CRLSetStorage::Parse(base::StringPiece data,
292 scoped_refptr<CRLSet>* out_crl_set) { 292 scoped_refptr<CRLSet>* out_crl_set) {
293 TRACE_EVENT0("CRLSet", "Parse"); 293 TRACE_EVENT0("CRLSet", "Parse");
294 // Other parts of Chrome assume that we're little endian, so we don't lose 294 // Other parts of Chrome assume that we're little endian, so we don't lose
295 // anything by doing this. 295 // anything by doing this.
296 #if defined(__BYTE_ORDER) 296 #if defined(__BYTE_ORDER)
297 // Linux check 297 // Linux check
298 COMPILE_ASSERT(__BYTE_ORDER == __LITTLE_ENDIAN, assumes_little_endian); 298 static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
299 #elif defined(__BIG_ENDIAN__) 299 #elif defined(__BIG_ENDIAN__)
300 // Mac check 300 // Mac check
301 #error assumes little endian 301 #error assumes little endian
302 #endif 302 #endif
303 303
304 scoped_ptr<base::DictionaryValue> header_dict(ReadHeader(&data)); 304 scoped_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
305 if (!header_dict.get()) 305 if (!header_dict.get())
306 return false; 306 return false;
307 307
308 std::string contents; 308 std::string contents;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 memcpy(out + off, j->data(), j->size()); 542 memcpy(out + off, j->data(), j->size());
543 off += j->size(); 543 off += j->size();
544 } 544 }
545 } 545 }
546 546
547 CHECK_EQ(off, len); 547 CHECK_EQ(off, len);
548 return ret; 548 return ret;
549 } 549 }
550 550
551 } // namespace net 551 } // namespace net
OLDNEW
« no previous file with comments | « net/base/prioritized_dispatcher_unittest.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698