Remove MTContext [pdfium : main]

0 views
Skip to first unread message

Lei Zhang (Gerrit)

unread,
Feb 20, 2026, 2:13:03 PM (2 days ago) Feb 20
to Andy Phan, Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Andy Phan

Lei Zhang voted and added 1 comment

Votes added by Lei Zhang

Code-Review+1

1 comment

File core/fxcrt/fx_random.cpp
Line 84, Patchset 2 (Latest): mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}
Lei Zhang . unresolved

Move the init code into a separate function. Then initialize both member variables in the initializer list.

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Phan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I59b96501d60b7e86dd1c7d65271664c1a8866452
Gerrit-Change-Number: 143453
Gerrit-PatchSet: 2
Gerrit-Owner: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Andy Phan <andy...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Feb 2026 19:13:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Andy Phan (Gerrit)

unread,
Feb 20, 2026, 2:50:54 PM (2 days ago) Feb 20
to Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

Andy Phan added 1 comment

File core/fxcrt/fx_random.cpp
Line 84, Patchset 2: mt_[0] = seed;

for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}
Lei Zhang . unresolved

Move the init code into a separate function. Then initialize both member variables in the initializer list.

Andy Phan

Made Init(), but does `mt_` need to be the initializer list?

Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I59b96501d60b7e86dd1c7d65271664c1a8866452
Gerrit-Change-Number: 143453
Gerrit-PatchSet: 3
Gerrit-Owner: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Feb 2026 19:50:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Feb 20, 2026, 3:07:15 PM (2 days ago) Feb 20
to Andy Phan, Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Andy Phan

Lei Zhang voted and added 1 comment

Votes added by Lei Zhang

Code-Review+1

1 comment

File core/fxcrt/fx_random.cpp
Line 84, Patchset 2: mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}
Lei Zhang . unresolved

Move the init code into a separate function. Then initialize both member variables in the initializer list.

Andy Phan

Made Init(), but does `mt_` need to be the initializer list?

Lei Zhang

I was thinking Init() can be in the anonymous namespace and return `std::array<uint32_t, kN>`.

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Phan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I59b96501d60b7e86dd1c7d65271664c1a8866452
Gerrit-Change-Number: 143453
Gerrit-PatchSet: 3
Gerrit-Owner: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Andy Phan <andy...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Feb 2026 20:07:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
Comment-In-Reply-To: Andy Phan <andy...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Andy Phan (Gerrit)

unread,
Feb 20, 2026, 3:22:03 PM (2 days ago) Feb 20
to Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com

Andy Phan added 1 comment

File core/fxcrt/fx_random.cpp
Line 84, Patchset 2: mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}
Lei Zhang . resolved

Move the init code into a separate function. Then initialize both member variables in the initializer list.

Andy Phan

Made Init(), but does `mt_` need to be the initializer list?

Lei Zhang

I was thinking Init() can be in the anonymous namespace and return `std::array<uint32_t, kN>`.

Andy Phan

Done, although had to make kN public.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I59b96501d60b7e86dd1c7d65271664c1a8866452
    Gerrit-Change-Number: 143453
    Gerrit-PatchSet: 4
    Gerrit-Owner: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Fri, 20 Feb 2026 20:22:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    Feb 20, 2026, 5:09:46 PM (2 days ago) Feb 20
    to Andy Phan, Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
    Attention needed from Andy Phan

    Lei Zhang voted and added 1 comment

    Votes added by Lei Zhang

    Code-Review+1

    1 comment

    File core/fxcrt/fx_random.cpp
    Line 84, Patchset 2: mt_[0] = seed;
    for (uint32_t i = 1; i < kN; i++) {
    const uint32_t prev = mt_[i - 1];
    mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
    }
    Lei Zhang . resolved

    Move the init code into a separate function. Then initialize both member variables in the initializer list.

    Andy Phan

    Made Init(), but does `mt_` need to be the initializer list?

    Lei Zhang

    I was thinking Init() can be in the anonymous namespace and return `std::array<uint32_t, kN>`.

    Andy Phan

    Done, although had to make kN public.

    Lei Zhang

    Ack.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andy Phan
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I59b96501d60b7e86dd1c7d65271664c1a8866452
    Gerrit-Change-Number: 143453
    Gerrit-PatchSet: 4
    Gerrit-Owner: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: Andy Phan <andy...@chromium.org>
    Gerrit-Comment-Date: Fri, 20 Feb 2026 22:09:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Pdfium LUCI CQ (Gerrit)

    unread,
    Feb 20, 2026, 5:24:23 PM (2 days ago) Feb 20
    to Andy Phan, Lei Zhang, pdfium-...@googlegroups.com

    Pdfium LUCI CQ submitted the change

    Change information

    Commit message:
    Remove MTContext

    MTContext is only used as a member field for FX_Random, so just move the
    struct's fields to FX_Random.
    Change-Id: I59b96501d60b7e86dd1c7d65271664c1a8866452
    Commit-Queue: Andy Phan <andy...@chromium.org>
    Reviewed-by: Lei Zhang <the...@chromium.org>
    Files:
    • M core/fxcrt/fx_random.cpp
    • M core/fxcrt/fx_random.h
    Change size: M
    Delta: 2 files changed, 24 insertions(+), 28 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Lei Zhang
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I59b96501d60b7e86dd1c7d65271664c1a8866452
    Gerrit-Change-Number: 143453
    Gerrit-PatchSet: 5
    Gerrit-Owner: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages