Tidy: file_storage snake case and interface naming convention
This commit is contained in:
parent
df1ebec737
commit
6a06a7108a
|
@ -45,7 +45,7 @@ var STATUS_FORWARDING = 0x5;
|
|||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {FileStorage=} storage
|
||||
* @param {FileStorageInterface=} storage
|
||||
* @param {{ last_qidnumber: number }=} qidcounter Another fs's qidcounter to synchronise with.
|
||||
*/
|
||||
function FS(storage, qidcounter) {
|
||||
|
|
|
@ -7,24 +7,24 @@ const INDEXEDDB_STORAGE_KEYPATH = "sha256sum";
|
|||
const INDEXEDDB_STORAGE_VALUEPATH = "data";
|
||||
|
||||
/** @interface */
|
||||
function FileStorage() {}
|
||||
function FileStorageInterface() {}
|
||||
|
||||
/**
|
||||
* @param {string} sha256sum
|
||||
* @return {!Promise<Uint8Array>}
|
||||
*/
|
||||
FileStorage.prototype.get = function(sha256sum) {};
|
||||
FileStorageInterface.prototype.get = function(sha256sum) {};
|
||||
|
||||
/**
|
||||
* @param {string} sha256sum
|
||||
* @param {!Uint8Array} data
|
||||
* @return {!Promise}
|
||||
*/
|
||||
FileStorage.prototype.set = function(sha256sum, buffer) {};
|
||||
FileStorageInterface.prototype.set = function(sha256sum, buffer) {};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {FileStorage}
|
||||
* @implements {FileStorageInterface}
|
||||
* @param {string=} baseurl
|
||||
*/
|
||||
function MemoryFileStorage(baseurl)
|
||||
|
@ -101,7 +101,7 @@ MemoryFileStorage.prototype.set = function(sha256sum, buffer)
|
|||
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {FileStorage}
|
||||
* @implements {FileStorageInterface}
|
||||
* @param {string=} baseurl
|
||||
*/
|
||||
function IndexedDBFileStorage(baseurl)
|
||||
|
|
|
@ -448,10 +448,10 @@ V86Starter.prototype.continue_init = function(emulator, options)
|
|||
var fs_url = options["filesystem"]["basefs"];
|
||||
var base_url = options["filesystem"]["baseurl"];
|
||||
|
||||
const fileStorage = typeof indexedDB === "undefined" ?
|
||||
const file_storage = typeof indexedDB === "undefined" ?
|
||||
new MemoryFileStorage(base_url) :
|
||||
new IndexedDBFileStorage(base_url);
|
||||
this.fs9p = new FS(fileStorage);
|
||||
this.fs9p = new FS(file_storage);
|
||||
settings.fs9p = this.fs9p;
|
||||
|
||||
if(fs_url)
|
||||
|
@ -1048,10 +1048,10 @@ V86Starter.prototype.serial0_send = function(data)
|
|||
*/
|
||||
V86Starter.prototype.mount_fs = function(path, baseurl, basefs, callback)
|
||||
{
|
||||
const fileStorage = typeof indexedDB === "undefined" ?
|
||||
const file_storage = typeof indexedDB === "undefined" ?
|
||||
new MemoryFileStorage(baseurl) :
|
||||
new IndexedDBFileStorage(baseurl);
|
||||
const newfs = new FS(fileStorage, this.fs9p.qidcounter);
|
||||
const newfs = new FS(file_storage, this.fs9p.qidcounter);
|
||||
const mount = () =>
|
||||
{
|
||||
const idx = this.fs9p.Mount(path, newfs);
|
||||
|
|
Loading…
Reference in a new issue