summaryrefslogtreecommitdiff
path: root/chromium/services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom
blob: 370f95f75d9801e6a91fc5d498d7d90b6ceb6d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module prefs.mojom;

import "mojo/common/values.mojom";

// A TrackedPreferenceValidationDelegate is notified of the results of each
// tracked preference validation event.
interface TrackedPreferenceValidationDelegate {
  enum ValueState {
    // The preference value corresponds to its stored hash.
    UNCHANGED,
    // The preference has been cleared since the last hash.
    CLEARED,
    // The preference value corresponds to its stored hash, but the hash was
    // calculated using a deprecated hash algorithm which is just as safe as
    // the current one.
    SECURE_LEGACY,
    // The preference value has been changed since the last hash.
    CHANGED,
    // No stored hash exists for the preference value.
    UNTRUSTED_UNKNOWN_VALUE,
    // No stored hash exists for the preference value, but the current set of
    // hashes stored is trusted and thus this value can safely be seeded. This
    // happens when all hashes are already properly seeded and a newly
    // tracked value needs to be seeded).
    TRUSTED_UNKNOWN_VALUE,
    // Null values are inherently trusted.
    TRUSTED_NULL_VALUE,
    // This transaction's store type is not supported.
    UNSUPPORTED,
  };

  // Notifies observes of the result (|value_state|) of checking the atomic
  // |value| (which may be null) at |pref_path|. |is_personal| indicates whether
  // or not the value may contain personal information.
  OnAtomicPreferenceValidation(
      string pref_path,
      mojo.common.mojom.Value? value,
      ValueState value_state,
      ValueState external_validation_value_state,
      bool is_personal);

  // Notifies observes of the result (|value_state|) of checking the split
  // value at |pref_path|. |is_personal| indicates whether or not the value may
  // contain personal information.
  OnSplitPreferenceValidation(
      string pref_path,
      array<string> invalid_keys,
      array<string> external_validation_invalid_keys,
      ValueState value_state,
      ValueState external_validation_value_state,
      bool is_personal);
};