// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_BLOCKLIST_OPT_OUT_BLOCKLIST_OPT_OUT_BLOCKLIST_DATA_H_ #define COMPONENTS_BLOCKLIST_OPT_OUT_BLOCKLIST_OPT_OUT_BLOCKLIST_DATA_H_ #include <stdint.h> #include <map> #include <memory> #include <set> #include <string> #include "base/time/time.h" #include "components/blocklist/opt_out_blocklist/opt_out_blocklist_item.h" namespace blocklist { // The various reasons the Blocklist may tell that the user is blocklisted. // This should remain synchronized with enums.xml enum class BlocklistReason { … }; // This class describes all of the data used to determine whether an action is // allowed based on four possible rules: Session: if the user has opted out // of j of the last k entries this session, the action will be blocklisted for a // set duration. Persistent: if the user has opted out of j of the last k // entries, the action will be blocklisted for a set duration. Host: if the user // has opted out of threshold of the last history entries for a specific host, // the action will be blocklisted for a set duration. Type: if the user has // opted out of j of the last k entries for a specific type, the action will be // blocklisted for a set duration. This is the in-memory version of the block // list policy. This object is moved from the embedder thread to a background // thread, It is not safe to access concurrently on two threads. class BlocklistData { … }; } // namespace blocklist #endif // COMPONENTS_BLOCKLIST_OPT_OUT_BLOCKLIST_OPT_OUT_BLOCKLIST_DATA_H_