Files
react-native-devtools-frontend/front_end/persistence/PlatformFileSystem.js
T
Simon Zünd b4c9ea79e7 Revert "Move ContentProvider.js and StaticContentProvider.js to text_utils."
This reverts commit ba56abb36c.

Reason for revert: Breaks two layout tests:
https://ci.chromium.org/p/devtools-frontend/builders/ci/DevTools%20Linux/739

The Try bot also caught this for this CL but was green for some reason.

Original change's description:
> Move ContentProvider.js and StaticContentProvider.js to text_utils.
> They used to live under common.
> 
> This is to avoid the dependency from common to text_utils caused by the method performSearchInContent
> 
> Bug: 1011811
> Change-Id: Ic6ccb32d8c18abda7b259ca14bafca4c7c2003ab
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2090785
> Commit-Queue: Jose Leal <joselea@microsoft.com>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=joselea@microsoft.com,tvanderlippe@chromium.org

Change-Id: Ie8c99b77123e916d9f0cde73339f9cac22fff3ef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1011811
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095308
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-03-10 06:29:38 +00:00

197 lines
3.5 KiB
JavaScript

// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as Common from '../common/common.js'; // eslint-disable-line no-unused-vars
export class PlatformFileSystem {
/**
* @param {string} path
* @param {string} type
*/
constructor(path, type) {
this._path = path;
this._type = type;
}
/**
* @param {string} path
* @return {!Promise<?{modificationTime: !Date, size: number}>}
*/
getMetadata(path) {
return Promise.resolve(/** @type ?{modificationTime: !Date, size: number} */ (null));
}
/**
* @return {!Array<string>}
*/
initialFilePaths() {
return [];
}
/**
* @return {!Array<string>}
*/
initialGitFolders() {
return [];
}
/**
* @return {string}
*/
path() {
return this._path;
}
/**
* @return {string}
*/
embedderPath() {
throw new Error('Not implemented');
}
/**
* @return {string}
*/
type() {
// TODO(kozyatinskiy): remove type, overrides should implement this interface.
return this._type;
}
/**
* @param {string} path
* @param {?string} name
* @return {!Promise<?string>}
*/
async createFile(path, name) {
return Promise.resolve(null);
}
/**
* @param {string} path
* @return {!Promise<boolean>}
*/
deleteFile(path) {
return Promise.resolve(false);
}
/**
* @param {string} path
* @return {!Promise<?Blob>}
*/
requestFileBlob(path) {
return Promise.resolve(/** @type {?Blob} */ (null));
}
/**
* @param {string} path
* @returns {!Promise<!Common.ContentProvider.DeferredContent>}
*/
async requestFileContent(path) {
return {error: ls`Unable to read files with this implementation.`, isEncoded: false};
}
/**
* @param {string} path
* @param {string} content
* @param {boolean} isBase64
*/
setFileContent(path, content, isBase64) {
throw new Error('Not implemented');
}
/**
* @param {string} path
* @param {string} newName
* @param {function(boolean, string=)} callback
*/
renameFile(path, newName, callback) {
callback(false);
}
/**
* @param {string} path
*/
addExcludedFolder(path) {
}
/**
* @param {string} path
*/
removeExcludedFolder(path) {
}
fileSystemRemoved() {
}
/**
* @param {string} folderPath
* @return {boolean}
*/
isFileExcluded(folderPath) {
return false;
}
/**
* @return {!Set<string>}
*/
excludedFolders() {
return new Set();
}
/**
* @param {string} query
* @param {!Common.Progress.Progress} progress
* @return {!Promise<!Array<string>>}
*/
searchInPath(query, progress) {
return Promise.resolve([]);
}
/**
* @param {!Common.Progress.Progress} progress
*/
indexContent(progress) {
setImmediate(() => progress.done());
}
/**
* @param {string} path
* @return {string}
*/
mimeFromPath(path) {
throw new Error('Not implemented');
}
/**
* @param {string} path
* @return {boolean}
*/
canExcludeFolder(path) {
return false;
}
/**
* @param {string} path
* @return {!Common.ResourceType.ResourceType}
*/
contentType(path) {
throw new Error('Not implemented');
}
/**
* @param {string} url
* @return {string}
*/
tooltipForURL(url) {
throw new Error('Not implemented');
}
/**
* @return {boolean}
*/
supportsAutomapping() {
throw new Error('Not implemented');
}
}