From: DongHyun Song Date: Wed, 7 Jul 2021 08:47:14 +0000 (+0900) Subject: Support setVirtualPath for thread-model wrt-service X-Git-Tag: submit/tizen/20210708.092104~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4870490975f9cbfa3eb16cc892f3593cb74b6668;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git Support setVirtualPath for thread-model wrt-service thread-model wrt-service runs all service application on worker thread as daemon process. For the virtual path resolving, it cannot get service application's path. i.e. /home/owner/apps_rw/{service_app_pkgid}/data, becuase wrt-service is org.tizen.chromium-efl package. Thus, setting virtual path will be set by wrt-service framework before each node worker thread started. - node worker has own V8 context Change-Id: I8dd5e524584ebe71416c86c1e8648a2c4cfc4b94 Signed-off-by: DongHyun Song --- diff --git a/src/filesystem/js/common.js b/src/filesystem/js/common.js index 8ba82079..03691fe3 100644 --- a/src/filesystem/js/common.js +++ b/src/filesystem/js/common.js @@ -138,6 +138,12 @@ var commonFS_ = (function() { cacheReady = true; } + function setVirtualPath(name, path, type, state) { + initCache(); + cacheVirtualToReal[name] = { path: path, label: name, type: type, state: state }; + console.log('name : ' + name + ', setVirtualPath : ' + cacheVirtualToReal[name]); + } + function mergeMultipleSlashes(str) { var retStr = str.replace(/(^(file\:\/\/\/)|^(file\:\/\/)|\/)\/{0,}/g, '$1'); return retStr; @@ -445,6 +451,7 @@ var commonFS_ = (function() { f_isCorrectRelativePath: f_isCorrectRelativePath, getStorage: getStorage, getAllStorages: getAllStorages, - mergeMultipleSlashes: mergeMultipleSlashes + mergeMultipleSlashes: mergeMultipleSlashes, + setVirtualPath : setVirtualPath }; })(); diff --git a/src/filesystem/js/file_system_manager.js b/src/filesystem/js/file_system_manager.js index 9651bd1e..36f74ac0 100644 --- a/src/filesystem/js/file_system_manager.js +++ b/src/filesystem/js/file_system_manager.js @@ -851,4 +851,8 @@ FileSystemManager.prototype.removeStorageStateChangeListener = function() { removeStorageStateChangeListener.apply(this, arguments); }; +FileSystemManager.prototype.setVirtualPath = function(name, path, type, state) { + commonFS_.setVirtualPath(name, path, type, state); +}; + exports = new FileSystemManager();