• Charlie Hu's avatar
    Use array to represent internal feature state of document policy · ce5ba6cd
    Charlie Hu authored
    Previously, document policy class is designed to hold a field for each
    feature's policy value. Those fields are supposed to be generated from
    document_policy_features.json5. Such design minimizes both speed and
    memory overhead but adds complexity to the system by introducing code
    generation.
    
    This CL uses array to represent internal feature state, which still
    minimizes speed overhead as indexing into array is the same as indexing
    into memory, and adds very little memory overhead(Each PolicyValue
    instance contains extra information).
    
    Change-Id: I4bc5e9b4383c628018e2605ad896e31b17c9c0e9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003436
    Commit-Queue: Charlie Hu <chenleihu@google.com>
    Reviewed-by: default avatarIan Clelland <iclelland@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#732682}
    ce5ba6cd
document_policy.cc 10.4 KB