Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/media_gallery/media_file_system_registry.h

Issue 10781014: Isolated FS for media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 registers pictures directories and media devices as 5 // MediaFileSystemRegistry registers pictures directories and media devices as
6 // File API filesystems and keeps track of the path to filesystem ID mappings. 6 // File API filesystems and keeps track of the path to filesystem ID mappings.
7 7
8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ 8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_
9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ 9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 private: 65 private:
66 friend struct base::DefaultLazyInstanceTraits<MediaFileSystemRegistry>; 66 friend struct base::DefaultLazyInstanceTraits<MediaFileSystemRegistry>;
67 67
68 // Mapping of media directories to filesystem IDs. 68 // Mapping of media directories to filesystem IDs.
69 typedef std::map<FilePath, std::string> MediaPathToFSIDMap; 69 typedef std::map<FilePath, std::string> MediaPathToFSIDMap;
70 70
71 // Mapping of RPH to MediaPathToFSIDMaps. 71 // Mapping of RPH to MediaPathToFSIDMaps.
72 typedef std::map<const content::RenderProcessHost*, 72 typedef std::map<const content::RenderProcessHost*,
73 MediaPathToFSIDMap> ChildIdToMediaFSMap; 73 MediaPathToFSIDMap> ChildIdToMediaFSMap;
74 74
75 // Mapping of device id to mount path. 75 // Mapping of device id to media device info.
76 typedef std::map<std::string, FilePath> DeviceIdToMediaPathMap; 76 typedef std::map<std::string, base::SystemMonitor::MediaDeviceInfo>
77 DeviceIdToInfoMap;
77 78
78 // Obtain an instance of this class via GetInstance(). 79 // Obtain an instance of this class via GetInstance().
79 MediaFileSystemRegistry(); 80 MediaFileSystemRegistry();
80 virtual ~MediaFileSystemRegistry(); 81 virtual ~MediaFileSystemRegistry();
81 82
82 // Helper functions to register / unregister listening for renderer process 83 // Helper functions to register / unregister listening for renderer process
83 // closed / terminiated notifications. 84 // closed / terminiated notifications.
84 void RegisterForRPHGoneNotifications(const content::RenderProcessHost* rph); 85 void RegisterForRPHGoneNotifications(const content::RenderProcessHost* rph);
85 void UnregisterForRPHGoneNotifications(const content::RenderProcessHost* rph); 86 void UnregisterForRPHGoneNotifications(const content::RenderProcessHost* rph);
86 87
87 // Registers a path as a media file system and return the filesystem id. 88 // Registers a path as a media file system and return the filesystem id.
88 std::string RegisterPathAsFileSystem(const FilePath& path); 89 std::string RegisterPathAsFileSystem(
Lei Zhang 2012/08/01 03:06:30 Can we do (type, path) instead? Same order as stru
kmadhusu 2012/08/01 23:39:35 Done.
90 const FilePath& path,
91 const base::SystemMonitor::MediaDeviceType& type);
89 92
90 // Revoke a media file system with a given |path|. 93 // Revoke a media file system with a given |path|.
91 void RevokeMediaFileSystem(const FilePath& path); 94 void RevokeMediaFileSystem(const FilePath& path);
92 95
93 // Only accessed on the UI thread. 96 // Only accessed on the UI thread.
94 ChildIdToMediaFSMap media_fs_map_; 97 ChildIdToMediaFSMap media_fs_map_;
95 98
96 // Only accessed on the UI thread. 99 // Only accessed on the UI thread.
97 DeviceIdToMediaPathMap device_id_map_; 100 DeviceIdToInfoMap device_id_map_;
98 101
99 // Is only used on the UI thread. 102 // Is only used on the UI thread.
100 content::NotificationRegistrar registrar_; 103 content::NotificationRegistrar registrar_;
101 104
102 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); 105 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry);
103 }; 106 };
104 107
105 } // namespace chrome 108 } // namespace chrome
106 109
107 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ 110 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698