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

Unified Diff: runtime/bin/secure_socket.cc

Issue 11583026: Add automatic initialization of SecureSocket library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « runtime/bin/secure_socket.h ('k') | tests/standalone/io/https_client_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/secure_socket.cc
diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
index d270c4734e2c68d79446d2bd3c5ce6babf6ac58b..49248d379c88c2773cb81fd16965477d642af2de 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -264,6 +264,9 @@ static Dart_Handle X509FromCertificate(CERTCertificate* certificate) {
void SSLFilter::Init(Dart_Handle dart_this) {
+ if (!library_initialized_) {
+ InitializeLibrary(NULL, "", true, false);
+ }
string_start_ = ThrowIfError(
Dart_NewPersistentHandle(DartUtils::NewString("start")));
string_length_ = ThrowIfError(
@@ -320,7 +323,8 @@ void SSLFilter::RegisterBadCertificateCallback(Dart_Handle callback) {
void SSLFilter::InitializeLibrary(const char* certificate_database,
const char* password,
- bool use_builtin_root_certificates) {
+ bool use_builtin_root_certificates,
+ bool report_duplicate_initialization) {
MutexLocker locker(&mutex_);
if (!library_initialized_) {
library_initialized_ = true;
@@ -362,7 +366,8 @@ void SSLFilter::InitializeLibrary(const char* certificate_database,
ThrowPRException("Failed SSL_ConfigServerSessionIDCache call.");
}
- } else {
+ } else if (report_duplicate_initialization) {
+ mutex_.Unlock(); // MutexLocker destructor not called when throwing.
floitsch 2012/12/20 17:57:51 The ... is not called ...
ThrowException("Called SSLFilter::InitializeLibrary more than once");
}
}
« no previous file with comments | « runtime/bin/secure_socket.h ('k') | tests/standalone/io/https_client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698