0

Add a DCHECK to ECSignatureCreator::SetFactoryForTesting to help avoid use-after-free problems.

Review URL: https://chromiumcodereview.appspot.com/10828118

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149506 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
rch@chromium.org
2012-08-01 22:02:33 +00:00
parent 6d5237734c
commit 34b1289eb3

@ -4,6 +4,7 @@
#include "crypto/ec_signature_creator.h"
#include "base/logging.h"
#include "crypto/ec_signature_creator_impl.h"
namespace crypto {
@ -24,6 +25,9 @@ ECSignatureCreator* ECSignatureCreator::Create(ECPrivateKey* key) {
// static
void ECSignatureCreator::SetFactoryForTesting(
ECSignatureCreatorFactory* factory) {
// We should always clear the factory after each test to avoid
// use-after-free problems.
DCHECK(!g_factory_ || !factory);
g_factory_ = factory;
}