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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 IsolatedContext::GetInstance()->RegisterFileSystemForPath( | 175 IsolatedContext::GetInstance()->RegisterFileSystemForPath( |
176 fileapi::kFileSystemTypeIsolated, path, ®ister_name); | 176 fileapi::kFileSystemTypeIsolated, path, ®ister_name); |
177 CHECK(!fsid.empty()); | 177 CHECK(!fsid.empty()); |
178 return fsid; | 178 return fsid; |
179 } | 179 } |
180 | 180 |
181 void MediaFileSystemRegistry::RevokeMediaFileSystem(const FilePath& path) { | 181 void MediaFileSystemRegistry::RevokeMediaFileSystem(const FilePath& path) { |
182 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 182 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
183 | 183 |
184 IsolatedContext* isolated_context = IsolatedContext::GetInstance(); | 184 IsolatedContext* isolated_context = IsolatedContext::GetInstance(); |
| 185 isolated_context->RevokeFileSystemByPath(path); |
| 186 |
185 for (ChildIdToMediaFSMap::iterator child_it = media_fs_map_.begin(); | 187 for (ChildIdToMediaFSMap::iterator child_it = media_fs_map_.begin(); |
186 child_it != media_fs_map_.end(); | 188 child_it != media_fs_map_.end(); |
187 ++child_it) { | 189 ++child_it) { |
188 MediaPathToFSIDMap& child_map = child_it->second; | 190 MediaPathToFSIDMap& child_map = child_it->second; |
189 MediaPathToFSIDMap::iterator media_path_it = child_map.find(path); | 191 MediaPathToFSIDMap::iterator media_path_it = child_map.find(path); |
190 if (media_path_it == child_map.end()) | 192 if (media_path_it == child_map.end()) |
191 continue; | 193 continue; |
192 isolated_context->RevokeFileSystem(media_path_it->second); | |
193 child_map.erase(media_path_it); | 194 child_map.erase(media_path_it); |
194 } | 195 } |
195 } | 196 } |
196 | 197 |
197 } // namespace chrome | 198 } // namespace chrome |
OLD | NEW |