chromium/chrome/browser/ash/app_list/search/util/mrfu_cache.proto

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package app_list;

// The storage proto for the MrfuCache class, see its header comment for more
// information.
message MrfuCacheProto {
  // Versioning information that can be used to discard or migrate on-disk
  // state if an incompatible change is made to the MRFU cache's algorithm.
  optional int32 version = 1;

  message Score {
    optional float score = 1 [default = 0.0];
    optional int64 last_update_count = 2 [default = 0];
  }
  map<string, Score> items = 2;

  // The total number of updates by the MRFU cache.
  optional int64 update_count = 3 [default = 0];

  // The sum of all scores in |items|.
  optional float total_score = 4 [default = 0.0];
}