| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |