diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-10 11:13:29 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-10 11:13:29 +0000 |
commit | a72724762650fed4e22a3e4df754a3e0ed6b9ecf (patch) | |
tree | 1e778133a9eba827c7ba0e3cb85b74beaba5e4b8 /chrome/browser/media_gallery | |
parent | 0909220f66fc4ca6a3a107dfe6f589972e965c7a (diff) | |
download | chromium_src-a72724762650fed4e22a3e4df754a3e0ed6b9ecf.zip chromium_src-a72724762650fed4e22a3e4df754a3e0ed6b9ecf.tar.gz chromium_src-a72724762650fed4e22a3e4df754a3e0ed6b9ecf.tar.bz2 |
Make isolated file system works for a device root (e.g. X:\\)
* directory drag-and-drop should work for a USB drive etc
* Media device intent should work on Windows
BUG=134828,135010
TEST=manually tested
TEST=IsolatedContext\*
Review URL: https://chromiumcodereview.appspot.com/10713007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145862 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/media_gallery')
-rw-r--r-- | chrome/browser/media_gallery/media_file_system_registry.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome/browser/media_gallery/media_file_system_registry.cc b/chrome/browser/media_gallery/media_file_system_registry.cc index 28877f8..bde66ca 100644 --- a/chrome/browser/media_gallery/media_file_system_registry.cc +++ b/chrome/browser/media_gallery/media_file_system_registry.cc @@ -140,15 +140,13 @@ std::string MediaFileSystemRegistry::RegisterPathAsFileSystem( // Sanity checks for |path|. CHECK(path.IsAbsolute()); CHECK(!path.ReferencesParent()); - // Make sure |path| does not refer to '/' on Unix. - // TODO(thestig) Check how BaseName() works for say, 'C:\' on Windows. - CHECK(!path.BaseName().IsAbsolute()); - CHECK(!path.BaseName().empty()); - std::set<FilePath> fileset; - fileset.insert(path); + // The directory name is not exposed to the js layer and we simply use + // a fixed name (as we only register a single directory per file system). + std::string register_name("_"); const std::string fsid = - IsolatedContext::GetInstance()->RegisterIsolatedFileSystem(fileset); + IsolatedContext::GetInstance()->RegisterFileSystemForFile( + path, ®ister_name); CHECK(!fsid.empty()); return fsid; } @@ -164,7 +162,7 @@ void MediaFileSystemRegistry::RevokeMediaFileSystem(const FilePath& path) { MediaPathToFSIDMap::iterator media_path_it = child_map.find(path); if (media_path_it == child_map.end()) continue; - isolated_context->RevokeIsolatedFileSystem(media_path_it->second); + isolated_context->RevokeFileSystem(media_path_it->second); child_map.erase(media_path_it); } } |