Commit bb138d42 authored by hirono's avatar hirono Committed by Commit bot

Files.app: Fix DCHECK in FakeFileSystem.

Previous DCHECK uses IsUnderDriveMountPoint method which takes paths for
external file system. But the paths used in FakeFileSystem are drive paths that
are extracted from external file system paths. So it goes into infinity loop
during traversing parent directory when a path pointing the out of my drive
directory is given.

The CL removes the check, and add util::GetDriveMyDriveRootPath().IsParent(file_path) to
prevent the infinity loop.

BUG=None
TEST=None

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

Cr-Commit-Position: refs/heads/master@{#296644}
parent bb0a225b
...@@ -146,9 +146,6 @@ void FakeFileSystem::GetResourceEntry( ...@@ -146,9 +146,6 @@ void FakeFileSystem::GetResourceEntry(
const GetResourceEntryCallback& callback) { const GetResourceEntryCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Now, we only support files under my drive.
DCHECK(!util::IsUnderDriveMountPoint(file_path));
if (file_path == util::GetDriveMyDriveRootPath()) { if (file_path == util::GetDriveMyDriveRootPath()) {
// Specialized for the root entry. // Specialized for the root entry.
drive_service_->GetAboutResource( drive_service_->GetAboutResource(
...@@ -158,6 +155,8 @@ void FakeFileSystem::GetResourceEntry( ...@@ -158,6 +155,8 @@ void FakeFileSystem::GetResourceEntry(
return; return;
} }
// Now, we only support files under my drive.
DCHECK(util::GetDriveMyDriveRootPath().IsParent(file_path));
GetResourceEntry( GetResourceEntry(
file_path.DirName(), file_path.DirName(),
base::Bind( base::Bind(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment