Firefox OS/Cloud Storage: Difference between revisions

Change the layout
(Change the picture size)
(Change the layout)
Line 21: Line 21:
* <b>No need to save the whole file in local.</b>
* <b>No need to save the whole file in local.</b>
= Cloud Storage Support Framework =
= Cloud Storage Support Framework =
[[File:Cloud Storage Support Framework.png|thumbnail|Framework|550px]]<br/>
[[File:Cloud Storage Support Framework.png|thumbnail|Framework|550px]]
The basic idea of this framework is mounting cloud storage as a FirefoxOS fake volume in FirefoxOS Volume System. By mounting cloud as a fake volume, FirefoxOS becomes a proxy for apps to access user's cloud, such that apps needn't know how to access cloud data in special way and maintain cloud by themselves. On the other hand, FirefoxOS can support streaming access to avoid downloading the whole file into local storage.<br/>
The basic idea of this framework is mounting cloud storage as a FirefoxOS fake volume in FirefoxOS Volume System. By mounting cloud as a fake volume, FirefoxOS becomes a proxy for apps to access user's cloud, such that apps needn't know how to access cloud data in special way and maintain cloud by themselves. On the other hand, FirefoxOS can support streaming access to avoid downloading the whole file into local storage.<br/>
Instead of accessing cloud directly in Gecko, we design FileSystemProvider API to provide apps/addons can create a virtual file system in Gaia, and accessing cloud in these apps/addons. According to this design, we can gain following benefits<br/>
Instead of accessing cloud directly in Gecko, we design FileSystemProvider API to provide apps/addons can create a virtual file system in Gaia, and accessing cloud in these apps/addons. According to this design, we can gain following benefits<br/>
Line 670: Line 670:
= Usage Flow =
= Usage Flow =
== Mounting a Cloud on FirefoxOS ==
== Mounting a Cloud on FirefoxOS ==
[[File:Cloud Storage Support Mount Flow.png|thumbnail|Mount Flow|550px]]<br/>
[[File:Cloud Storage Support Mount Flow.png|thumbnail|Mount Flow|550px]]
To mount a cloud on FirefoxOS, FileSystemProvider API providers methods and events for Cloud Storage Addons.<br/>
To mount a cloud on FirefoxOS, FileSystemProvider API providers methods and events for Cloud Storage Addons.<br/>
The picture shows the flow that Cloud Storage Addon mounts a cloud "MyCloud" on FirefoxOS through FileSystemProvider API.<br/>
The picture shows the flow that Cloud Storage Addon mounts a cloud "MyCloud" on FirefoxOS through FileSystemProvider API.<br/>
# Cloud Storage addon registers the event listener on FileSystemProviderEvents.
# Cloud Storage addon registers the event listener on FileSystemProviderEvents.
# Call FileSystemProvider.mount() method with parameters to request Volume System to create a fake volume.
# Call FileSystemProvider.mount() method with parameters to request Volume System to create a fake volume.
<br/><br/><br/>
Following is an example code to mount a cloud "MyCloud"<br/>
Following is an example code to mount a cloud "MyCloud"<br/>
   // Code in Cloud Storage Addons
   // Code in Cloud Storage Addons
Line 706: Line 707:
                             );
                             );
== Accessing Cloud through the Framework ==
== Accessing Cloud through the Framework ==
[[File:Cloud Storage Support Read File Flow.png|thumbnail|Read File Flow|550px]]<br/>
[[File:Cloud Storage Support Read File Flow.png|thumbnail|Read File Flow|550px]]
To access a mounted cloud, app can reuse DeviceStorage and File APIs, just like they access local storage.<br/>
To access a mounted cloud, app can reuse DeviceStorage and File APIs, just like they access local storage.<br/>
The picture shows the flow how Gallery app read the "test.jpg" on cloud "MyCloud".<br/>
The picture shows the flow how Gallery app read the "test.jpg" on cloud "MyCloud".<br/>
33

edits