- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / history / in_memory_url_index_cache.proto
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
11 syntax = "proto2";
12
13 option optimize_for = LITE_RUNTIME;
14
15 package in_memory_url_index;
16
17 message 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       message VisitInfo {
59         required int64 visit_time = 1;
60         // Corresponds to content::PageTransition.
61         required uint64 transition_type = 2;
62       }
63       required int64 history_id = 1;
64       required int32 visit_count = 2;
65       required int32 typed_count = 3;
66       required int64 last_visit = 4;
67       required string url = 5;
68       optional string title = 6;
69       repeated VisitInfo visits = 7;
70     }
71
72     required uint32 item_count = 1;
73     repeated HistoryInfoMapEntry history_info_map_entry = 2;
74   }
75
76   message WordStartsMapItem {
77     message WordStartsMapEntry {
78       required int64 history_id = 1;
79       repeated int32 url_word_starts = 2 [packed=true];
80       repeated int32 title_word_starts = 3 [packed=true];
81     }
82
83     required uint32 item_count = 1;
84     repeated WordStartsMapEntry word_starts_map_entry = 2;
85   }
86
87   // The date that the cache was last rebuilt from history.  Note that
88   // this cache may include items that were visited after this date if
89   // the InMemoryURLIndex was updated on the fly.  This timestamp is meant
90   // to indicate the last date the index was rebuilt from the ground truth:
91   // the history database on disk.
92   required int64 last_rebuild_timestamp = 1;
93   // If there is no version we'll assume version 0.
94   optional int32 version = 2;
95   required int32 history_item_count = 3;
96
97   optional WordListItem word_list = 4;
98   optional WordMapItem word_map = 5;
99   optional CharWordMapItem char_word_map = 6;
100   optional WordIDHistoryMapItem word_id_history_map = 7;
101   optional HistoryInfoMapItem history_info_map = 8;
102   optional WordStartsMapItem word_starts_map = 9;
103 }