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

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

Issue 2874002: Change the Windows CertDatabase behaviour to match Mac and NSS behaviour, whe... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « net/base/keygen_handler.h ('k') | net/base/keygen_handler_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/base/keygen_handler.h"
6
7 #include "base/logging.h"
8
9 namespace net {
10
11 KeygenHandler::Cache* KeygenHandler::Cache::GetInstance() {
12 return Singleton<Cache>::get();
13 }
14
15 void KeygenHandler::Cache::Insert(const std::string& public_key_info,
16 const KeyLocation& location) {
17 AutoLock lock(lock_);
18
19 DCHECK(!public_key_info.empty()) << "Only insert valid public key structures";
20 cache_[public_key_info] = location;
21 }
22
23 bool KeygenHandler::Cache::Find(const std::string& public_key_info,
24 KeyLocation* location) {
25 AutoLock lock(lock_);
26
27 KeyLocationMap::iterator iter = cache_.find(public_key_info);
28
29 if (iter == cache_.end())
30 return false;
31
32 *location = iter->second;
33 return true;
34 }
35
36 } // namespace net
OLDNEW
« no previous file with comments | « net/base/keygen_handler.h ('k') | net/base/keygen_handler_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698