Skip to content

Commit

Permalink
Bug 1620118 - Part 2: Add isDependent field to the third-party-module…
Browse files Browse the repository at this point in the history
…s ping. r=chutten

This patch adds an optional boolean field `isDependent`
to the third-party-modules ping whose value is copied
from `ProcessedModuleLoadEvent::mIsDependent`.

Differential Revision: https://phabricator.services.mozilla.com/D67883
  • Loading branch information
Toshihito Kikuchi committed May 4, 2020
1 parent d3f480b commit 8699684
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ were loaded into Firefox processes.
// The base address to which the loader mapped the module.
"baseAddress": <string formatted as "0x%x">,
// Index of the element in the modules array that contains details about the module that was loaded during this event.
"moduleIndex": <int>
"moduleIndex": <int>,
// True if the module is included in the executable's Import Directory Table.
"isDependent": <bool>
},
... Additional events (maximum 50)
],
Expand Down Expand Up @@ -117,10 +119,9 @@ Notes

Version History
~~~~~~~~~~~~~~~
- Firefox 71:
- Renamed from untrustedModules to third-party-modules with a revised schema (`bug 1542830 <https://bugzilla.mozilla.org/show_bug.cgi?id=1542830>`_).
- Firefox 70:
- Added ``%SystemRoot%`` as an exemption to path sanitization (`bug 1573275 <https://bugzilla.mozilla.org/show_bug.cgi?id=1573275>`_).
- Firefox 77: Added ``isDependent`` (`bug 1620118 <https://bugzilla.mozilla.org/show_bug.cgi?id=1620118>`_).
- Firefox 71: Renamed from untrustedModules to third-party-modules with a revised schema (`bug 1542830 <https://bugzilla.mozilla.org/show_bug.cgi?id=1542830>`_).
- Firefox 70: Added ``%SystemRoot%`` as an exemption to path sanitization (`bug 1573275 <https://bugzilla.mozilla.org/show_bug.cgi?id=1573275>`_).
- Firefox 66:
- Added Windows Side-by-side directory trust flag (`bug 1514694 <https://bugzilla.mozilla.org/show_bug.cgi?id=1514694>`_).
- Added module load times (``xulLoadDurationMS``, ``loadDurationMS``) and xul.dll trust flag (`bug 1518490 <https://bugzilla.mozilla.org/show_bug.cgi?id=1518490>`_).
Expand Down
7 changes: 7 additions & 0 deletions toolkit/components/telemetry/other/UntrustedModules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ static bool SerializeEvent(JSContext* aCx, JS::MutableHandleValue aElement,
return false;
}

JS::RootedValue jsIsDependent(aCx);
jsIsDependent.setBoolean(aEvent.mIsDependent);
if (!JS_DefineProperty(aCx, obj, "isDependent", jsIsDependent,
JSPROP_ENUMERATE)) {
return false;
}

aElement.setObject(*obj);

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ add_task(async function test_send_ping() {
Assert.ok(typeof event.moduleIndex == "number", "'moduleIndex' exists");
Assert.ok(event.moduleIndex >= 0, "'moduleIndex' is non-negative");

Assert.ok(typeof event.isDependent == "boolean", "'isDependent' exists");
Assert.ok(!event.isDependent, "'isDependent' is false");

let modRecord = found.payload.modules[event.moduleIndex];
Assert.ok(modRecord, "module record for this event exists");
Assert.ok(
Expand Down

0 comments on commit 8699684

Please sign in to comment.