drive: Fix a DCHECK failure at shutdown after Drive is disabled (issue 11269034)

2 views
Skip to first unread message

sat...@chromium.org

unread,
Oct 25, 2012, 3:50:40 AM10/25/12
to hash...@chromium.org, chromium...@chromium.org, nkostyl...@chromium.org, a...@chromium.org, rginda...@chromium.org, oshima...@chromium.org, chromium-a...@chromium.org, stevenj...@chromium.org, davemoo...@chromium.org
Reviewers: hashimoto,

Description:
drive: Fix a DCHECK failure at shutdown after Drive is disabled

This happens as ShutdownOnUIThread(), which sets profile_ to NULL,
can be called before DispatchMountCompletedEvent() at shutdown.

BUG=157611
TEST=DCHECK failure disappers. See the bug for the repro steps


Please review this at http://codereview.chromium.org/11269034/

SVN Base: svn://svn.chromium.org/chrome/trunk/src

Affected files:
M chrome/browser/chromeos/extensions/file_browser_event_router.cc


Index: chrome/browser/chromeos/extensions/file_browser_event_router.cc
diff --git
a/chrome/browser/chromeos/extensions/file_browser_event_router.cc
b/chrome/browser/chromeos/extensions/file_browser_event_router.cc
index
715ad8aa4c9afec8abba5c2232d05ffb1b47faa7..61bfd77776a57ac6ed2912a0d2231f30ef6295a1
100644
--- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc
@@ -558,7 +558,12 @@ void
FileBrowserEventRouter::DispatchMountCompletedEvent(
DiskMountManager::MountEvent event,
chromeos::MountError error_code,
const DiskMountManager::MountPointInfo& mount_info) {
- if (!profile_ || mount_info.mount_type == chromeos::MOUNT_TYPE_INVALID) {
+ // profile_ is NULL if ShutdownOnUIThread() is called earlier. This can
+ // happen at shutdown.
+ if (!profile_)
+ return;
+
+ if (mount_info.mount_type == chromeos::MOUNT_TYPE_INVALID) {
NOTREACHED();
return;
}


hash...@chromium.org

unread,
Oct 25, 2012, 4:12:10 AM10/25/12
to sat...@chromium.org, chromium...@chromium.org, nkostyl...@chromium.org, a...@chromium.org, rginda...@chromium.org, oshima...@chromium.org, chromium-a...@chromium.org, stevenj...@chromium.org, davemoo...@chromium.org

commi...@chromium.org

unread,
Oct 25, 2012, 4:44:43 AM10/25/12
to sat...@chromium.org, hash...@chromium.org, chromium...@chromium.org, nkostyl...@chromium.org, a...@chromium.org, rginda...@chromium.org, oshima...@chromium.org, chromium-a...@chromium.org, stevenj...@chromium.org, davemoo...@chromium.org

commi...@chromium.org

unread,
Oct 25, 2012, 5:42:59 AM10/25/12
to sat...@chromium.org, hash...@chromium.org, chromium...@chromium.org, nkostyl...@chromium.org, a...@chromium.org, rginda...@chromium.org, oshima...@chromium.org, chromium-a...@chromium.org, stevenj...@chromium.org, davemoo...@chromium.org
Retried try job too often for step(s) unit_tests

https://chromiumcodereview.appspot.com/11269034/
Reply all
Reply to author
Forward
0 new messages