OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // MediaFileSystemRegistry implementation. | 5 // MediaFileSystemRegistry implementation. |
6 | 6 |
7 #include "chrome/browser/media_gallery/media_file_system_registry.h" | 7 #include "chrome/browser/media_gallery/media_file_system_registry.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 IsolatedContext::GetInstance()->RegisterFileSystemForPath( | 179 IsolatedContext::GetInstance()->RegisterFileSystemForPath( |
180 fileapi::kFileSystemTypeIsolated, path, ®ister_name); | 180 fileapi::kFileSystemTypeIsolated, path, ®ister_name); |
181 CHECK(!fsid.empty()); | 181 CHECK(!fsid.empty()); |
182 return fsid; | 182 return fsid; |
183 } | 183 } |
184 | 184 |
185 void MediaFileSystemRegistry::RevokeMediaFileSystem(const FilePath& path) { | 185 void MediaFileSystemRegistry::RevokeMediaFileSystem(const FilePath& path) { |
186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
187 | 187 |
188 IsolatedContext* isolated_context = IsolatedContext::GetInstance(); | 188 IsolatedContext* isolated_context = IsolatedContext::GetInstance(); |
| 189 isolated_context->RevokeFileSystemByPath(path); |
| 190 |
189 for (ChildIdToMediaFSMap::iterator child_it = media_fs_map_.begin(); | 191 for (ChildIdToMediaFSMap::iterator child_it = media_fs_map_.begin(); |
190 child_it != media_fs_map_.end(); | 192 child_it != media_fs_map_.end(); |
191 ++child_it) { | 193 ++child_it) { |
192 MediaPathToFSIDMap& child_map = child_it->second; | 194 MediaPathToFSIDMap& child_map = child_it->second; |
193 MediaPathToFSIDMap::iterator media_path_it = child_map.find(path); | 195 MediaPathToFSIDMap::iterator media_path_it = child_map.find(path); |
194 if (media_path_it == child_map.end()) | 196 if (media_path_it == child_map.end()) |
195 continue; | 197 continue; |
196 isolated_context->RevokeFileSystem(media_path_it->second); | |
197 child_map.erase(media_path_it); | 198 child_map.erase(media_path_it); |
198 } | 199 } |
199 } | 200 } |
200 | 201 |
201 } // namespace chrome | 202 } // namespace chrome |
OLD | NEW |