Skip to content
Snippets Groups Projects
Commit 313c2029 authored by skerner@chromium.org's avatar skerner@chromium.org
Browse files

Revert 65349 - Update CertVerifier to watch for the origin loop's destruction, so that

it doesn't crash if the SSLClientSocket is leaked.

BUG=chromium-os:8179
TEST=None

Linux browser tests are consistently failing.  Example stack:

SSLUITest.TestDisplaysInsecureContentTwoTabs: 
[11279:11279:1107/212311:929558354690:WARNING:chrome/installer/util/master_preferences.cc(56)] Failed to read master prefs file. 
[11279:11279:1107/212311:929558354814:ERROR:chrome/installer/util/master_preferences.cc(137)] Failed to parse /mnt/data/build/slave/Linux_Builder__Views_dbg_/build/src/out/Debug/master_preferences
[11279:11279:1107/212311:929558672237:WARNING:views/widget/widget_gtk.cc(293)] compositing not supported; allowing anyway
LEAK: 4 WebCoreNode
[11279:11291:1107/212312:929559555051:FATAL:base/message_loop.cc(200)] Check failed: this == current(). 
Backtrace:
	base::debug::StackTrace::StackTrace() [0x124edb6]
	logging::LogMessage::~LogMessage() [0x126455b]
	MessageLoop::RemoveDestructionObserver() [0x126695d]
	net::CertVerifier::Request::Cancel() [0x1944eb5]
	net::CertVerifier::Request::~Request() [0x194505a]
	base::RefCountedThreadSafe<>::DeleteInternal() [0x194544c]
	base::DefaultRefCountedThreadSafeTraits<>::Destruct() [0x1945420]
	base::RefCountedThreadSafe<>::Release() [0x19452ec]
	RunnableMethodTraits<>::ReleaseCallee() [0x1945628]
	RunnableMethod<>::ReleaseCallee() [0x194559c]
	RunnableMethod<>::~RunnableMethod() [0x19454ce]
	(anonymous namespace)::WorkerThread::ThreadMain() [0x12c904f]
	ThreadFunc() [0x12860bf]
	start_thread [0x2afc1af6d9ca]
	0x2afc1d5156fd

[11279:11291:1107/212312:929559555051:FATAL:base/message_loop.cc(200)] Check failed: this == current(). 
Backtrace:
	base::debug::StackTrace::StackTrace() [0x124edb6]
	logging::LogMessage::~LogMessage() [0x126455b]
	MessageLoop::RemoveDestructionObserver() [0x126695d]
	net::CertVerifier::Request::Cancel() [0x1944eb5]
	net::CertVerifier::Request::~Request() [0x194505a]
	base::RefCountedThreadSafe<>::DeleteInternal() [0x194544c]
	base::DefaultRefCountedThreadSafeTraits<>::Destruct() [0x1945420]
	base::RefCountedThreadSafe<>::Release() [0x19452ec]
	RunnableMethodTraits<>::ReleaseCallee() [0x1945628]
	RunnableMethod<>::ReleaseCallee() [0x194559c]
	RunnableMethod<>::~RunnableMethod() [0x19454ce]
	(anonymous namespace)::WorkerThread::ThreadMain() [0x12c904f]
	ThreadFunc() [0x12860bf]
	start_thread [0x2afc1af6d9ca]
	0x2afc1d5156fd

Killed (timed out).

Review URL: http://codereview.chromium.org/4299001

TBR=zork@chromium.org
Review URL: http://codereview.chromium.org/4669003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65372 0039d316-1c4b-4281-b951-d872f2087c98
parent 645b929b
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,7 @@
namespace net {
class CertVerifier::Request :
public base::RefCountedThreadSafe<CertVerifier::Request>,
public MessageLoop::DestructionObserver {
public base::RefCountedThreadSafe<CertVerifier::Request> {
public:
Request(CertVerifier* verifier,
X509Certificate* cert,
......@@ -34,8 +33,6 @@ class CertVerifier::Request :
callback_(callback),
origin_loop_(MessageLoop::current()),
error_(OK) {
if (origin_loop_)
origin_loop_->AddDestructionObserver(this);
}
void DoVerify() {
......@@ -88,16 +85,6 @@ class CertVerifier::Request :
void Cancel() {
verifier_ = NULL;
AutoLock locked(origin_loop_lock_);
if (origin_loop_) {
origin_loop_->RemoveDestructionObserver(this);
origin_loop_ = NULL;
}
}
// MessageLoop::DestructionObserver override.
virtual void WillDestroyCurrentMessageLoop() {
LOG(ERROR) << "CertVerifier wasn't deleted before the thread was deleted.";
AutoLock locked(origin_loop_lock_);
origin_loop_ = NULL;
}
......@@ -105,9 +92,7 @@ class CertVerifier::Request :
private:
friend class base::RefCountedThreadSafe<CertVerifier::Request>;
~Request() {
Cancel();
}
~Request() {}
// Set on the origin thread, read on the worker thread.
scoped_refptr<X509Certificate> cert_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment