Guarantee validity of VolumeInfo via WeakPtr.
commit0ac319f1f2cf7846540cd9510fe09f807ab2fec7
authormtomasz <mtomasz@chromium.org>
Mon, 30 Mar 2015 07:19:38 +0000 (30 00:19 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 30 Mar 2015 07:20:12 +0000 (30 07:20 +0000)
tree12f0a6f693eb9c8f16ca8481bdf5ddff50afffd1
parentc78545dbec6276a41f922d0f11c908fcd0d5789a
Guarantee validity of VolumeInfo via WeakPtr.

Previously, when performing an asynchronous operation, we could end up on doing
the first part and the second part on different volumes if the volume id stayed
the same.

This CL introduces a Volume class which is returned as WeakPtr<Volume>, which
is invalidated when a volume is ejected. So, if a device is ejected and
then another one inserted (with the same volume id), the WeakPtr will be
invalidated, and such earlier mentioned async operation would be able to
abort.

TEST=unit_tests: *VolumeManager*
BUG=None

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

Cr-Commit-Position: refs/heads/master@{#322749}
18 files changed:
chrome/browser/chromeos/extensions/file_manager/device_event_router.cc
chrome/browser/chromeos/extensions/file_manager/device_event_router.h
chrome/browser/chromeos/extensions/file_manager/device_event_router_unittest.cc
chrome/browser/chromeos/extensions/file_manager/event_router.cc
chrome/browser/chromeos/extensions/file_manager/event_router.h
chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc
chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc
chrome/browser/chromeos/extensions/file_manager/private_api_util.cc
chrome/browser/chromeos/extensions/file_manager/private_api_util.h
chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
chrome/browser/chromeos/file_manager/volume_manager.cc
chrome/browser/chromeos/file_manager/volume_manager.h
chrome/browser/chromeos/file_manager/volume_manager_observer.h
chrome/browser/chromeos/file_manager/volume_manager_unittest.cc
chrome/browser/extensions/api/file_system/file_system_api.cc
chrome/browser/extensions/api/file_system/file_system_api.h