1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// InMemoryURLIndex caching protocol buffers.
6//
7// At certain times during browser operation, the indexes from the
8// InMemoryURLIndex are written to a disk-based cache using the
9// following protobuf description.
10
11syntax = "proto2";
12
13option optimize_for = LITE_RUNTIME;
14
15package in_memory_url_index;
16
17message InMemoryURLIndexCacheItem {
18
19  message WordListItem {
20    required uint32 word_count = 1;
21    repeated string word = 2;
22  }
23
24  message WordMapItem {
25    message WordMapEntry {
26      required string word = 1;
27      required int32 word_id = 2;
28    }
29
30    required uint32 item_count = 1;
31    repeated WordMapEntry word_map_entry = 2;
32  }
33
34  message CharWordMapItem {
35    message CharWordMapEntry {
36      required uint32 item_count = 1;
37      required int32 char_16 = 2;
38      repeated int32 word_id = 3 [packed=true];
39    }
40
41    required uint32 item_count = 1;
42    repeated CharWordMapEntry char_word_map_entry = 2;
43  }
44
45  message WordIDHistoryMapItem {
46    message WordIDHistoryMapEntry {
47      required uint32 item_count = 1;
48      required int32 word_id = 2;
49      repeated int64 history_id = 3 [packed=true];
50    }
51
52    required uint32 item_count = 1;
53    repeated WordIDHistoryMapEntry word_id_history_map_entry = 2;
54  }
55
56  message HistoryInfoMapItem {
57    message HistoryInfoMapEntry {
58      required int64 history_id = 1;
59      required int32 visit_count = 2;
60      required int32 typed_count = 3;
61      required int64 last_visit = 4;
62      required string url = 5;
63      optional string title = 6;
64    }
65
66    required uint32 item_count = 1;
67    repeated HistoryInfoMapEntry history_info_map_entry = 2;
68  }
69
70  // The timestamp of the cache, used to validate against an
71  // accompanying transaction journal.
72  required int64 timestamp = 1;
73  required int32 history_item_count = 2;
74
75  optional WordListItem word_list = 3;
76  optional WordMapItem word_map = 4;
77  optional CharWordMapItem char_word_map = 5;
78  optional WordIDHistoryMapItem word_id_history_map = 6;
79  optional HistoryInfoMapItem history_info_map = 7;
80}
81