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

Unified Diff: crypto/openssl_util.h

Issue 11571059: Add net/android/keystore.h (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: git cl try Created 7 years, 10 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
Index: crypto/openssl_util.h
diff --git a/crypto/openssl_util.h b/crypto/openssl_util.h
index b390fe7aea0fe9e6f37715a6fc1c7773f37e5d7d..e8483c9633ed577eabe24aecb9aab6182b4fbbe5 100644
--- a/crypto/openssl_util.h
+++ b/crypto/openssl_util.h
@@ -11,7 +11,7 @@
namespace crypto {
-// A helper class that takes care of destroying OpenSSL objects when it goes out
+// A helper class that takes care of destroying OpenSSL objects when they go out
// of scope.
template <typename T, void (*destructor)(T*)>
class ScopedOpenSSL {
@@ -23,6 +23,11 @@ class ScopedOpenSSL {
}
T* get() const { return ptr_; }
+ T* release() {
+ T* ptr = ptr_;
+ ptr_ = NULL;
+ return ptr;
+ }
void reset(T* ptr) {
if (ptr != ptr_) {
if (ptr_) (*destructor)(ptr_);

Powered by Google App Engine
This is Rietveld 408576698