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

Unified Diff: net/base/keygen_handler.cc

Issue 843005: Adds support for the <keygen> element to Windows, matching support present on... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Fixing remaining issues Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/keygen_handler.h ('k') | net/base/keygen_handler_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/keygen_handler.cc
===================================================================
--- net/base/keygen_handler.cc (revision 0)
+++ net/base/keygen_handler.cc (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/keygen_handler.h"
+
+#include "base/logging.h"
+
+namespace net {
+
+KeygenHandler::Cache* KeygenHandler::Cache::GetInstance() {
+ return Singleton<Cache>::get();
+}
+
+void KeygenHandler::Cache::Insert(const std::string& public_key_info,
+ const KeyLocation& location) {
+ AutoLock lock(lock_);
+
+ DCHECK(!public_key_info.empty()) << "Only insert valid public key structures";
+ cache_[public_key_info] = location;
+}
+
+bool KeygenHandler::Cache::Find(const std::string& public_key_info,
+ KeyLocation* location) {
+ AutoLock lock(lock_);
+
+ KeyLocationMap::iterator iter = cache_.find(public_key_info);
+
+ if (iter == cache_.end())
+ return false;
+
+ *location = iter->second;
+ return true;
+}
+
+} // namespace net
Property changes on: net\base\keygen_handler.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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