summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-05 00:22:08 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-05 00:22:08 +0000
commit63d83101ded13501c9b38931503fd12e3aa01771 (patch)
tree5c4a2e164b6867db878a7015d03f1494ea940955
parent8a837bb40249dfd9f0a2736abdab4f64592c99db (diff)
downloadchromium_src-63d83101ded13501c9b38931503fd12e3aa01771.zip
chromium_src-63d83101ded13501c9b38931503fd12e3aa01771.tar.gz
chromium_src-63d83101ded13501c9b38931503fd12e3aa01771.tar.bz2
Added check for Chrome message loop in SSLSocketAdapter::BeginSSL().
BUG=none TEST=made sure this doesn't trigger with normal sync operations Review URL: http://codereview.chromium.org/523041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35496 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc b/chrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc
index 42f6eb8..6fc08b5 100755
--- a/chrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc
+++ b/chrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/sync/notifier/communicator/ssl_socket_adapter.h"
#include "base/compiler_specific.h"
+#include "base/message_loop.h"
#include "chrome/browser/net/url_request_context_getter.h"
#include "chrome/browser/profile.h"
#include "net/base/ssl_config_service.h"
@@ -80,6 +81,15 @@ int SSLSocketAdapter::StartSSL(const char* hostname, bool restartable) {
}
int SSLSocketAdapter::BeginSSL() {
+ if (!MessageLoop::current()) {
+ // Certificate verification is done via the Chrome message loop.
+ // Without this check, if we don't have a chrome message loop the
+ // SSL connection just hangs silently.
+ LOG(DFATAL) << "Chrome message loop (needed by SSL certificate "
+ << "verification) does not exist";
+ return net::ERR_UNEXPECTED;
+ }
+
// SSLConfigService is not thread-safe, and the default values for SSLConfig
// are correct for us, so we don't use the config service to initialize this
// object.