Fix data race in DirectoryLister on cancellation.
commit91a663efe84356bd28f5192bed8bb1636ac05788
authormmenke <mmenke@chromium.org>
Thu, 4 Dec 2014 22:49:06 +0000 (4 14:49 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 4 Dec 2014 22:49:27 +0000 (4 22:49 +0000)
tree7a3316d50af79a1399f287b92c070c07bdf26330
parent91edc8762a49835456306b6055397c30ff368b9e
Fix data race in DirectoryLister on cancellation.

The class tracked cancellation by overwriting a variable on one thread
that would then be used on the other thread to prevent a callback on the
first thread, which isn't threadsafe.  Switched to using weak ptrs.

Includes some cleanup, and expands test coverage.

BUG=436211

Review URL: https://codereview.chromium.org/777033003

Cr-Commit-Position: refs/heads/master@{#306918}
net/base/directory_lister.cc
net/base/directory_lister.h
net/base/directory_lister_unittest.cc