Bug 1698129 - Rename the profiler browsingContextID outputs to tabID and bump the profile version r=gerald

Lastly, we are changing the parts that requires a version bump and bumping the
profiler version in the end. This will require a PR in the front-end for a
version upgrader and changes related to the renaming.

Differential Revision: https://phabricator.services.mozilla.com/D109282
This commit is contained in:
Nazım Can Altınova 2021-03-25 12:52:11 +00:00
Родитель 4356d88793
Коммит 7039884fe6
7 изменённых файлов: 17 добавлений и 18 удалений

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

@ -34,7 +34,7 @@ void PageInformation::StreamJSON(SpliceableJSONWriter& aWriter) const {
// Window IDs are created using `nsContentUtils::GenerateProcessSpecificId`,
// which is specifically designed to only use 53 of the 64 bits to be lossless
// when passed into and out of JS as a double.
aWriter.DoubleProperty("browsingContextID", TabID());
aWriter.DoubleProperty("tabID", TabID());
aWriter.DoubleProperty("innerWindowID", InnerWindowID());
aWriter.StringProperty("url", Url());
aWriter.DoubleProperty("embedderInnerWindowID", EmbedderInnerWindowID());

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

@ -1851,7 +1851,7 @@ static void StreamMetaJSCustomObject(PSLockRef aLock,
bool aIsShuttingDown) {
MOZ_RELEASE_ASSERT(CorePS::Exists() && ActivePS::Exists(aLock));
aWriter.IntProperty("version", 19);
aWriter.IntProperty("version", 23);
// The "startTime" field holds the number of milliseconds since midnight
// January 1, 1970 GMT. This grotty code computes (Now - (Now -

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

@ -28,7 +28,7 @@ void PageInformation::StreamJSON(SpliceableJSONWriter& aWriter) const {
// which is specifically designed to only use 53 of the 64 bits to be lossless
// when passed into and out of JS as a double.
aWriter.StartObjectElement();
aWriter.DoubleProperty("browsingContextID", TabID());
aWriter.DoubleProperty("tabID", TabID());
aWriter.DoubleProperty("innerWindowID", InnerWindowID());
aWriter.StringProperty("url", Url());
aWriter.DoubleProperty("embedderInnerWindowID", EmbedderInnerWindowID());

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

@ -1028,8 +1028,7 @@ class ActivePS {
// being created using `nsContentUtils::GenerateProcessSpecificId`, which
// is specifically designed to only use 53 of the 64 bits to be lossless
// when passed into and out of JS as a double.
aWriter.DoubleProperty("activeBrowsingContextID",
sInstance->mActiveTabID);
aWriter.DoubleProperty("activeTabID", sInstance->mActiveTabID);
}
aWriter.EndObject();
}
@ -2538,7 +2537,7 @@ static void StreamMetaJSCustomObject(
const PreRecordedMetaInformation& aPreRecordedMetaInformation) {
MOZ_RELEASE_ASSERT(CorePS::Exists() && ActivePS::Exists(aLock));
aWriter.IntProperty("version", 22);
aWriter.IntProperty("version", 23);
// The "startTime" field holds the number of milliseconds since midnight
// January 1, 1970 GMT. This grotty code computes (Now - (Now -

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

@ -61,8 +61,8 @@ add_task(async function test_profile_multi_frame_page_info() {
// Parent page
if (page.url == url) {
Assert.equal(page.url, url);
Assert.equal(typeof page.browsingContextID, "number");
Assert.equal(page.browsingContextID, activeTabID);
Assert.equal(typeof page.tabID, "number");
Assert.equal(page.tabID, activeTabID);
Assert.equal(typeof page.innerWindowID, "number");
// Top level document will have no embedder.
Assert.equal(page.embedderInnerWindowID, 0);
@ -78,8 +78,8 @@ add_task(async function test_profile_multi_frame_page_info() {
// Child page (iframe)
if (page.url == BASE_URL + "single_frame.html") {
Assert.equal(page.url, BASE_URL + "single_frame.html");
Assert.equal(typeof page.browsingContextID, "number");
Assert.equal(page.browsingContextID, activeTabID);
Assert.equal(typeof page.tabID, "number");
Assert.equal(page.tabID, activeTabID);
Assert.equal(typeof page.innerWindowID, "number");
Assert.equal(typeof page.embedderInnerWindowID, "number");
Assert.notEqual(typeof parentPage, "undefined");

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

@ -58,8 +58,8 @@ add_task(async function test_profile_single_frame_page_info() {
for (const page of contentProcess.pages) {
if (page.url == url) {
Assert.equal(page.url, url);
Assert.equal(typeof page.browsingContextID, "number");
Assert.equal(page.browsingContextID, activeTabID);
Assert.equal(typeof page.tabID, "number");
Assert.equal(page.tabID, activeTabID);
Assert.equal(typeof page.innerWindowID, "number");
// Top level document will have no embedder.
Assert.equal(page.embedderInnerWindowID, 0);

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

@ -23,13 +23,13 @@ function run_test() {
const interval = 1;
const threads = ["GeckoMain"];
const features = ["js", "leaf", "threads"];
const activeBrowsingContextID = 123;
const activeTabID = 123;
Services.profiler.StartProfiler(
entries,
interval,
features,
threads,
activeBrowsingContextID
activeTabID
);
info("Generate the activeConfiguration.");
@ -38,7 +38,7 @@ function run_test() {
interval,
threads,
features,
activeBrowsingContextID,
activeTabID,
// The buffer is created as a power of two that can fit all of the entires
// into it. If the ratio of entries to buffer size ever changes, this setting
// will need to be updated.
@ -65,7 +65,7 @@ function run_test() {
const interval = 0.5;
const threads = ["GeckoMain", "DOM Worker"];
const features = ["threads"];
const activeBrowsingContextID = 111;
const activeTabID = 111;
const duration = 20;
info("Restart the profiler with a new configuration.");
@ -74,7 +74,7 @@ function run_test() {
interval,
features,
threads,
activeBrowsingContextID,
activeTabID,
// Also start it with duration, this property is optional.
duration
);
@ -85,7 +85,7 @@ function run_test() {
interval,
threads,
features,
activeBrowsingContextID,
activeTabID,
duration,
// The buffer is created as a power of two that can fit all of the entires
// into it. If the ratio of entries to buffer size ever changes, this setting