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

Side by Side Diff: chrome/browser/net/nss_context_chromeos.cc

Issue 2922423002: Remove NSSCryptoModuleDelegate. (Closed)
Patch Set: Created 3 years, 6 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 | « chrome/browser/net/nss_context.h ('k') | chrome/browser/net/nss_context_linux.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/net/nss_context.h" 5 #include "chrome/browser/net/nss_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 base::Bind(&SetSystemSlot, base::Passed(&system_slot)); 111 base::Bind(&SetSystemSlot, base::Passed(&system_slot));
112 112
113 net::NSSCertDatabaseChromeOS* db = 113 net::NSSCertDatabaseChromeOS* db =
114 GetNSSCertDatabaseChromeOS(context, callback); 114 GetNSSCertDatabaseChromeOS(context, callback);
115 if (db) 115 if (db)
116 callback.Run(db); 116 callback.Run(db);
117 } 117 }
118 118
119 } // namespace 119 } // namespace
120 120
121 crypto::ScopedPK11Slot GetPublicNSSKeySlotForResourceContext(
122 content::ResourceContext* context) {
123 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
124 return crypto::GetPublicSlotForChromeOSUser(GetUsername(context));
125 }
126
127 crypto::ScopedPK11Slot GetPrivateNSSKeySlotForResourceContext(
128 content::ResourceContext* context,
129 const base::Callback<void(crypto::ScopedPK11Slot)>& callback) {
130 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
131 return crypto::GetPrivateSlotForChromeOSUser(GetUsername(context), callback);
132 }
133
134 net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext( 121 net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext(
135 content::ResourceContext* context, 122 content::ResourceContext* context,
136 const base::Callback<void(net::NSSCertDatabase*)>& callback) { 123 const base::Callback<void(net::NSSCertDatabase*)>& callback) {
137 return GetNSSCertDatabaseChromeOS( 124 return GetNSSCertDatabaseChromeOS(
138 context, base::Bind(&CallWithNSSCertDatabase, callback)); 125 context, base::Bind(&CallWithNSSCertDatabase, callback));
139 } 126 }
140 127
141 void EnableNSSSystemKeySlotForResourceContext( 128 void EnableNSSSystemKeySlotForResourceContext(
142 content::ResourceContext* context) { 129 content::ResourceContext* context) {
143 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 130 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
144 base::Callback<void(crypto::ScopedPK11Slot)> callback = 131 base::Callback<void(crypto::ScopedPK11Slot)> callback =
145 base::Bind(&SetSystemSlotOfDBForResourceContext, context); 132 base::Bind(&SetSystemSlotOfDBForResourceContext, context);
146 crypto::ScopedPK11Slot system_slot = crypto::GetSystemNSSKeySlot(callback); 133 crypto::ScopedPK11Slot system_slot = crypto::GetSystemNSSKeySlot(callback);
147 if (system_slot) 134 if (system_slot)
148 callback.Run(std::move(system_slot)); 135 callback.Run(std::move(system_slot));
149 } 136 }
OLDNEW
« no previous file with comments | « chrome/browser/net/nss_context.h ('k') | chrome/browser/net/nss_context_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698