|
|
@@ -1,9 +1,9 @@
|
|
|
|
|
|
import * as base from './base.js';
|
|
|
|
|
|
-const host = {};
|
|
|
+const browser = {};
|
|
|
|
|
|
-host.BrowserHost = class {
|
|
|
+browser.Host = class {
|
|
|
|
|
|
constructor() {
|
|
|
this._window = window;
|
|
|
@@ -431,7 +431,7 @@ host.BrowserHost = class {
|
|
|
stream = await this._request(url, null, null, progress);
|
|
|
}
|
|
|
}
|
|
|
- context = new host.BrowserHost.Context(this, url, identifier, name, stream);
|
|
|
+ context = new browser.Context(this, url, identifier, name, stream);
|
|
|
this._telemetry.set('session_engaged', 1);
|
|
|
} catch (error) {
|
|
|
await this._view.error(error, 'Model load request failed.');
|
|
|
@@ -443,7 +443,7 @@ host.BrowserHost = class {
|
|
|
|
|
|
async _open(file, files) {
|
|
|
this._view.show('welcome spinner');
|
|
|
- const context = new host.BrowserHost.BrowserFileContext(this, file, files);
|
|
|
+ const context = new browser.BrowserFileContext(this, file, files);
|
|
|
try {
|
|
|
await context.open();
|
|
|
await this._openContext(context);
|
|
|
@@ -475,7 +475,7 @@ host.BrowserHost = class {
|
|
|
const encoder = new TextEncoder();
|
|
|
const buffer = encoder.encode(file.content);
|
|
|
const stream = new base.BinaryStream(buffer);
|
|
|
- const context = new host.BrowserHost.Context(this, '', identifier, null, stream);
|
|
|
+ const context = new browser.Context(this, '', identifier, null, stream);
|
|
|
await this._openContext(context);
|
|
|
} catch (error) {
|
|
|
await this._view.error(error, 'Error while loading Gist.');
|
|
|
@@ -593,7 +593,7 @@ host.BrowserHost = class {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-host.BrowserHost.BrowserFileContext = class {
|
|
|
+browser.BrowserFileContext = class {
|
|
|
|
|
|
constructor(host, file, blobs) {
|
|
|
this._host = host;
|
|
|
@@ -640,7 +640,7 @@ host.BrowserHost.BrowserFileContext = class {
|
|
|
const slice = blob.slice(position, Math.min(position + size, blob.size));
|
|
|
reader.readAsArrayBuffer(slice);
|
|
|
} else {
|
|
|
- const stream = new host.BrowserHost.FileStream(chunks, size, 0, position);
|
|
|
+ const stream = new browser.FileStream(chunks, size, 0, position);
|
|
|
resolve(stream);
|
|
|
}
|
|
|
}
|
|
|
@@ -688,7 +688,7 @@ host.BrowserHost.BrowserFileContext = class {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-host.BrowserHost.FileStream = class {
|
|
|
+browser.FileStream = class {
|
|
|
|
|
|
constructor(chunks, size, start, length) {
|
|
|
this._chunks = chunks;
|
|
|
@@ -707,7 +707,7 @@ host.BrowserHost.FileStream = class {
|
|
|
}
|
|
|
|
|
|
stream(length) {
|
|
|
- const file = new host.BrowserHost.FileStream(this._chunks, this._size, this._start + this._position, length);
|
|
|
+ const file = new browser.FileStream(this._chunks, this._size, this._start + this._position, length);
|
|
|
this.skip(length);
|
|
|
return file;
|
|
|
}
|
|
|
@@ -795,7 +795,7 @@ host.BrowserHost.FileStream = class {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-host.BrowserHost.Context = class {
|
|
|
+browser.Context = class {
|
|
|
|
|
|
constructor(host, url, identifier, name, stream) {
|
|
|
this._host = host;
|
|
|
@@ -877,7 +877,7 @@ if (!('scrollBehavior' in window.document.documentElement.style)) {
|
|
|
}
|
|
|
|
|
|
if (typeof window !== 'undefined' && window.exports) {
|
|
|
- window.exports.browser = host;
|
|
|
+ window.exports.browser = browser;
|
|
|
}
|
|
|
|
|
|
-export const BrowserHost = host.BrowserHost;
|
|
|
+export const Host = browser.Host;
|