зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1620630 - The OS.File worker should record markers indicating which operation it is performing on which file, r=Yoric.
Differential Revision: https://phabricator.services.mozilla.com/D65747 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ca323d4349
Коммит
2c3a1ae0be
|
@ -192,7 +192,11 @@ add_task(async function test_delete_removes_local_file() {
|
|||
downloader.delete(RECORD);
|
||||
|
||||
Assert.ok(!(await OS.File.exists(localFilePath)));
|
||||
Assert.ok(!(await OS.File.exists(downloader.baseFolder)));
|
||||
Assert.ok(
|
||||
!(await OS.File.exists(
|
||||
OS.Path.join(OS.Constants.Path.localProfileDir, ...downloader.folders)
|
||||
))
|
||||
);
|
||||
});
|
||||
add_task(clear_state);
|
||||
|
||||
|
|
|
@ -29,7 +29,23 @@ if (this.Components) {
|
|||
|
||||
let worker = new PromiseWorker.AbstractWorker();
|
||||
worker.dispatch = function(method, args = []) {
|
||||
return Agent[method](...args);
|
||||
let prefix = "OS.File " + method;
|
||||
performance.mark(prefix + "-start");
|
||||
try {
|
||||
return Agent[method](...args);
|
||||
} finally {
|
||||
let name = prefix;
|
||||
if (args.length && args[0] instanceof Object && args[0].string) {
|
||||
// Including the path in the marker name here means it will be part of
|
||||
// profiles. It's fine to include personally identifiable information
|
||||
// in profiles, because when a profile is captured only the user will
|
||||
// see it, and before uploading it a sanitization step will be offered.
|
||||
// The 'OS.File ' prefix will help the profiler know that these marker
|
||||
// names should be sanitized.
|
||||
name += " — " + args[0].string;
|
||||
}
|
||||
performance.measure(name, prefix + "-start");
|
||||
}
|
||||
};
|
||||
worker.log = LOG;
|
||||
worker.postMessage = function(message, ...transfers) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче