Bug 1432133 - P1 - Returning an error when FileInfo is missing as a short-term fix; r=asuth, data-review=chutten

Differential Revision: https://phabricator.services.mozilla.com/D16045

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Tung 2019-01-16 10:24:56 +00:00
Родитель fa4b84c9fe
Коммит 8b3ce8ef6b
2 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -33,6 +33,7 @@
#include "mozilla/SnappyUncompressInputStream.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/storage.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/dom/ContentParent.h"
@ -8329,6 +8330,17 @@ nsresult DeserializeStructuredCloneFile(FileManager* aFileManager,
RefPtr<FileInfo> fileInfo = aFileManager->GetFileInfo(id);
MOZ_ASSERT(fileInfo);
// XXX In bug 1432133, for some reasons FileInfo object cannot be got. This
// is just a short-term fix, and we are working on finding the real cause
// in bug 1519859.
if (!fileInfo) {
IDB_WARNING(
"Corrupt structured clone data detected in IndexedDB. Failing the "
"database request. Bug 1519859 will address this problem.");
Telemetry::ScalarAdd(Telemetry::ScalarID::IDB_FAILURE_FILEINFO_ERROR, 1);
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}
aFile->mFileInfo.swap(fileInfo);
aFile->mType = type;

Просмотреть файл

@ -2029,6 +2029,22 @@ idb.type:
- 'main'
- 'content'
# The following section is for tracking the number of failure for indexedDB.
idb.failure:
fileinfo_error:
bug_numbers:
- 1432133
description: >
Tracking the number of failure due to missing fileInfo while doing
structured clone.
expires: "70"
kind: uint
notification_emails:
- ttung@mozilla.com
release_channel_collection: opt-out
record_in_processes:
- 'main'
# The following section contains probes that record timestamps.
timestamps:
first_paint: