Changes

Jump to: navigation, search

Firefox OS/Cloud Storage

1 byte added, 06:40, 17 February 2016
Change the layout
* <b>No need to save the whole file in local.</b>
= Cloud Storage Support Framework =
[[File:Cloud Storage Support Framework.png|thumbnail|Framework|550px]]<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/>
= Usage Flow =
== Mounting a Cloud on FirefoxOS ==
[[File:Cloud Storage Support Mount Flow.png|thumbnail|Mount Flow|550px]]<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/>
# Cloud Storage addon registers the event listener on FileSystemProviderEvents.
# 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/>
// Code in Cloud Storage Addons
);
== Accessing Cloud through the Framework ==
[[File:Cloud Storage Support Read File Flow.png|thumbnail|Read File Flow|550px]]<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/>
33
edits

Navigation menu