Skip to content

Commit

Permalink
Rename scuo- to s14e-
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 11, 2024
1 parent 9c35ffe commit 461810d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/js/cachestorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import lz4Codec from './lz4.js';
import webext from './webext.js';
import µb from './background.js';
import { ubolog } from './console.js';
import * as scuo from './scuo-serializer.js';
import * as s14e from './s14e-serializer.js';

/******************************************************************************/

Expand Down Expand Up @@ -74,7 +74,7 @@ const cacheStorage = (( ) => {

const compress = async (bin, key, data) => {
const µbhs = µb.hiddenSettings;
const after = await scuo.serializeAsync(data, {
const after = await s14e.serializeAsync(data, {
compress: µbhs.cacheStorageCompression,
compressThreshold: µbhs.cacheStorageCompressionThreshold,
multithreaded: µbhs.cacheStorageMultithread,
Expand All @@ -84,10 +84,10 @@ const cacheStorage = (( ) => {

const decompress = async (bin, key) => {
const data = bin[key];
if ( scuo.isSerialized(data) === false ) { return; }
if ( s14e.isSerialized(data) === false ) { return; }
const µbhs = µb.hiddenSettings;
const isLarge = data.length >= µbhs.cacheStorageCompressionThreshold;
bin[key] = await scuo.deserializeAsync(data, {
bin[key] = await s14e.deserializeAsync(data, {
multithreaded: isLarge && µbhs.cacheStorageMultithread || 1,
});
};
Expand Down
8 changes: 4 additions & 4 deletions src/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { dnrRulesetFromRawLists } from './static-dnr-filtering.js';
import { i18n$ } from './i18n.js';
import { redirectEngine } from './redirect-engine.js';
import * as sfp from './static-filtering-parser.js';
import * as scuo from './scuo-serializer.js';
import * as s14e from './s14e-serializer.js';

import {
permanentFirewall,
Expand Down Expand Up @@ -947,8 +947,8 @@ const onMessage = function(request, sender, callback) {

case 'cloudPull':
request.decode = encoded => {
if ( scuo.isSerialized(encoded) ) {
return scuo.deserializeAsync(encoded, { thread: true });
if ( s14e.isSerialized(encoded) ) {
return s14e.deserializeAsync(encoded, { thread: true });
}
// Legacy decoding: needs to be kept around for the foreseeable future.
return lz4Codec.decode(encoded, fromBase64);
Expand All @@ -963,7 +963,7 @@ const onMessage = function(request, sender, callback) {
compress: µb.hiddenSettings.cloudStorageCompression,
thread: true,
};
return scuo.serializeAsync(data, options);
return s14e.serializeAsync(data, options);
};
return vAPI.cloud.push(request).then(result => {
callback(result);
Expand Down
2 changes: 1 addition & 1 deletion src/js/scuo-serializer.js → src/js/s14e-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ class Thread {
this.workerPromise = new Promise(resolve => {
let worker = null;
try {
worker = new Worker('js/scuo-serializer.js', { type: 'module' });
worker = new Worker('js/s14e-serializer.js', { type: 'module' });
worker.onmessage = ev => {
const msg = ev.data;
if ( isInstanceOf(msg, 'Object') === false ) { return; }
Expand Down

0 comments on commit 461810d

Please sign in to comment.