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

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

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/cert/multi_threaded_cert_verifier.cc ('k') | net/cert/x509_certificate_net_log_param.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/nss_cert_database.h" 5 #include "net/cert/nss_cert_database.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <certdb.h> 8 #include <certdb.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <pk11pub.h> 10 #include <pk11pub.h>
11 #include <secmod.h> 11 #include <secmod.h>
12 #include <utility>
12 13
13 #include "base/bind.h" 14 #include "base/bind.h"
14 #include "base/callback.h" 15 #include "base/callback.h"
15 #include "base/logging.h" 16 #include "base/logging.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
18 #include "base/observer_list_threadsafe.h" 19 #include "base/observer_list_threadsafe.h"
19 #include "base/task_runner.h" 20 #include "base/task_runner.h"
20 #include "base/task_runner_util.h" 21 #include "base/task_runner_util.h"
21 #include "base/threading/worker_pool.h" 22 #include "base/threading/worker_pool.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 75
75 NSSCertDatabase::ImportCertFailure::ImportCertFailure( 76 NSSCertDatabase::ImportCertFailure::ImportCertFailure(
76 const scoped_refptr<X509Certificate>& cert, 77 const scoped_refptr<X509Certificate>& cert,
77 int err) 78 int err)
78 : certificate(cert), net_error(err) {} 79 : certificate(cert), net_error(err) {}
79 80
80 NSSCertDatabase::ImportCertFailure::~ImportCertFailure() {} 81 NSSCertDatabase::ImportCertFailure::~ImportCertFailure() {}
81 82
82 NSSCertDatabase::NSSCertDatabase(crypto::ScopedPK11Slot public_slot, 83 NSSCertDatabase::NSSCertDatabase(crypto::ScopedPK11Slot public_slot,
83 crypto::ScopedPK11Slot private_slot) 84 crypto::ScopedPK11Slot private_slot)
84 : public_slot_(public_slot.Pass()), 85 : public_slot_(std::move(public_slot)),
85 private_slot_(private_slot.Pass()), 86 private_slot_(std::move(private_slot)),
86 observer_list_(new base::ObserverListThreadSafe<Observer>), 87 observer_list_(new base::ObserverListThreadSafe<Observer>),
87 weak_factory_(this) { 88 weak_factory_(this) {
88 CHECK(public_slot_); 89 CHECK(public_slot_);
89 90
90 // This also makes sure that NSS has been initialized. 91 // This also makes sure that NSS has been initialized.
91 CertDatabase* cert_db = CertDatabase::GetInstance(); 92 CertDatabase* cert_db = CertDatabase::GetInstance();
92 cert_notification_forwarder_.reset(new CertNotificationForwarder(cert_db)); 93 cert_notification_forwarder_.reset(new CertNotificationForwarder(cert_db));
93 AddObserver(cert_notification_forwarder_.get()); 94 AddObserver(cert_notification_forwarder_.get());
94 95
95 psm::EnsurePKCS12Init(); 96 psm::EnsurePKCS12Init();
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 } else { 485 } else {
485 if (SEC_DeletePermCertificate(cert->os_cert_handle())) { 486 if (SEC_DeletePermCertificate(cert->os_cert_handle())) {
486 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError(); 487 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError();
487 return false; 488 return false;
488 } 489 }
489 } 490 }
490 return true; 491 return true;
491 } 492 }
492 493
493 } // namespace net 494 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/multi_threaded_cert_verifier.cc ('k') | net/cert/x509_certificate_net_log_param.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698