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

Side by Side Diff: net/base/test_root_certs.cc

Issue 9192024: Add a convenience typedef LazyInstance<T>::Leaky to avoid repeating T. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_util.cc ('k') | net/base/x509_certificate.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/test_root_certs.h" 5 #include "net/base/test_root_certs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "net/base/x509_certificate.h" 12 #include "net/base/x509_certificate.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 namespace { 16 namespace {
17 17
18 bool g_has_instance = false; 18 bool g_has_instance = false;
19 19
20 base::LazyInstance<TestRootCerts, 20 base::LazyInstance<TestRootCerts>::Leaky
21 base::LeakyLazyInstanceTraits<TestRootCerts> >
22 g_test_root_certs = LAZY_INSTANCE_INITIALIZER; 21 g_test_root_certs = LAZY_INSTANCE_INITIALIZER;
23 22
24 CertificateList LoadCertificates(const FilePath& filename) { 23 CertificateList LoadCertificates(const FilePath& filename) {
25 std::string raw_cert; 24 std::string raw_cert;
26 if (!file_util::ReadFileToString(filename, &raw_cert)) { 25 if (!file_util::ReadFileToString(filename, &raw_cert)) {
27 LOG(ERROR) << "Can't load certificate " << filename.value(); 26 LOG(ERROR) << "Can't load certificate " << filename.value();
28 return CertificateList(); 27 return CertificateList();
29 } 28 }
30 29
31 return X509Certificate::CreateCertificateListFromBytes( 30 return X509Certificate::CreateCertificateListFromBytes(
(...skipping 18 matching lines...) Expand all
50 49
51 return Add(root_certs.front()); 50 return Add(root_certs.front());
52 } 51 }
53 52
54 TestRootCerts::TestRootCerts() { 53 TestRootCerts::TestRootCerts() {
55 Init(); 54 Init();
56 g_has_instance = true; 55 g_has_instance = true;
57 } 56 }
58 57
59 } // namespace net 58 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util.cc ('k') | net/base/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698