Closed
Bug 791084
Opened 13 years ago
Closed 13 years ago
Device Storage - Separate out different permissions based on storage type
Categories
(Core :: DOM: Device Interfaces, defect)
Core
DOM: Device Interfaces
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox18 | --- | fixed |
People
(Reporter: dougt, Assigned: dougt)
Details
Attachments
(1 file)
4.94 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
Separate out different permissions for different storage types. For example, if an application wants to access pictures, it should be able to just request pictures and not see videos.
I am planning to make the permissions look like:
device-storage:pictures
device-storage:music
device-storage:videos
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → doug.turner
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #661108 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 2•13 years ago
|
||
I also issued a pull request to fix up gaia.
Comment on attachment 661108 [details] [diff] [review]
patch v.1
Review of attachment 661108 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/devicestorage/nsDeviceStorage.cpp
@@ +173,5 @@
> + !aType.EqualsLiteral(DEVICESTORAGE_MUSIC)) {
> + // unknown type
> + return NS_ERROR_FAILURE;
> + }
> +
Nit: trailing whitespace
@@ +175,5 @@
> + return NS_ERROR_FAILURE;
> + }
> +
> + aPermissionResult.AssignLiteral("device-storage:");
> + aPermissionResult.Append(NS_ConvertUTF16toUTF8(aType));
You could use NS_LossyConvertUTF16toASCII here since you know it's actually ASCII.
@@ +975,5 @@
>
> NS_IMETHODIMP
> nsDOMDeviceStorageCursor::GetType(nsACString & aType)
> {
> + DeviceStorageTypeChecker* typeChecker = DeviceStorageTypeChecker::CreateOrGet();
No need for an instance here if the method is static. In the other 3 places too.
::: dom/devicestorage/nsDeviceStorage.h
@@ +54,5 @@
>
> bool Check(const nsAString& aType, nsIDOMBlob* aBlob);
> bool Check(const nsAString& aType, nsIFile* aFile);
>
> + nsresult GetPermissionForType(const nsAString& aType, nsACString& aPermissionResult);
This can be static
Attachment #661108 -
Flags: review?(bent.mozilla) → review+
Assignee | ||
Comment 4•13 years ago
|
||
fixed up. I left the Convert function as the string can come from content.
https://hg.mozilla.org/mozilla-central/rev/e5af3d785252
Comment 5•13 years ago
|
||
Push backed out for introducing new M2 orange in test_diskSpace.html & backout of the cset that landed it having conflicts.
Also, please do not push to mozilla-central unless you are going to watch/star your push (sheriffs are going to be getting more strict about tree rule violations; ie backout).
https://hg.mozilla.org/mozilla-central/rev/5faccd0b7618
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 6•13 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•