summaryrefslogtreecommitdiffstats
path: root/components/omnibox/browser/in_memory_url_index_cache.proto
blob: df2de1b43166224e755a5627f66b76859b3cc6ea (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright (c) 2011 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.
//
// InMemoryURLIndex caching protocol buffers.
//
// At certain times during browser operation, the indexes from the
// InMemoryURLIndex are written to a disk-based cache using the
// following protobuf description.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package in_memory_url_index;

message InMemoryURLIndexCacheItem {

  message WordListItem {
    required uint32 word_count = 1;
    repeated string word = 2;
  }

  message WordMapItem {
    message WordMapEntry {
      required string word = 1;
      required int32 word_id = 2;
    }

    required uint32 item_count = 1;
    repeated WordMapEntry word_map_entry = 2;
  }

  message CharWordMapItem {
    message CharWordMapEntry {
      required uint32 item_count = 1;
      required int32 char_16 = 2;
      repeated int32 word_id = 3 [packed=true];
    }

    required uint32 item_count = 1;
    repeated CharWordMapEntry char_word_map_entry = 2;
  }

  message WordIDHistoryMapItem {
    message WordIDHistoryMapEntry {
      required uint32 item_count = 1;
      required int32 word_id = 2;
      repeated int64 history_id = 3 [packed=true];
    }

    required uint32 item_count = 1;
    repeated WordIDHistoryMapEntry word_id_history_map_entry = 2;
  }

  message HistoryInfoMapItem {
    message HistoryInfoMapEntry {
      message VisitInfo {
        required int64 visit_time = 1;
        // Corresponds to ui::PageTransition.
        required uint64 transition_type = 2;
      }
      required int64 history_id = 1;
      required int32 visit_count = 2;
      required int32 typed_count = 3;
      required int64 last_visit = 4;
      required string url = 5;
      optional string title = 6;
      repeated VisitInfo visits = 7;
    }

    required uint32 item_count = 1;
    repeated HistoryInfoMapEntry history_info_map_entry = 2;
  }

  message WordStartsMapItem {
    message WordStartsMapEntry {
      required int64 history_id = 1;
      repeated int32 url_word_starts = 2 [packed=true];
      repeated int32 title_word_starts = 3 [packed=true];
    }

    required uint32 item_count = 1;
    repeated WordStartsMapEntry word_starts_map_entry = 2;
  }

  // The date that the cache was last rebuilt from history.  Note that
  // this cache may include items that were visited after this date if
  // the InMemoryURLIndex was updated on the fly.  This timestamp is meant
  // to indicate the last date the index was rebuilt from the ground truth:
  // the history database on disk.
  required int64 last_rebuild_timestamp = 1;
  // If there is no version we'll assume version 0.
  optional int32 version = 2;
  required int32 history_item_count = 3;

  optional WordListItem word_list = 4;
  optional WordMapItem word_map = 5;
  optional CharWordMapItem char_word_map = 6;
  optional WordIDHistoryMapItem word_id_history_map = 7;
  optional HistoryInfoMapItem history_info_map = 8;
  optional WordStartsMapItem word_starts_map = 9;
}