File: session_specifics.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (202 lines) | stat: -rw-r--r-- 8,904 bytes parent folder | download | duplicates (6)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Sync protocol datatype extension for sessions.

// If you change or add any fields in this file, update proto_visitors.h and
// potentially proto_enum_conversions.{h, cc}.

syntax = "proto2";

option java_multiple_files = true;
option java_package = "org.chromium.components.sync.protocol";

option optimize_for = LITE_RUNTIME;

package sync_pb;

import "components/sync/protocol/sync_enums.proto";

message SessionSpecifics {
  // Unique id for the client. M89 and higher use sync's cache GUID (client ID)
  // to populate this tag for *new* sessions.
  optional string session_tag = 1;
  optional SessionHeader header = 2;
  optional SessionTab tab = 3;

  // The local tab id used by sync. Unique across all nodes for that client.
  optional int32 tab_node_id = 4 [default = -1];
}

// Properties of session sync objects.
message SessionHeader {
  // The timestamp when this session was started, i.e. when the user signed in
  // or turned on the sessions data type. Introduced in M130, and not populated
  // for sessions created/started before that milestone.
  optional int64 session_start_time_unix_epoch_millis = 6;
  // Each session is composed of windows.
  repeated SessionWindow window = 2;
  // A non-unique but human-readable name to describe this client.
  optional string client_name = 3;
  // The form factor of device.
  optional SyncEnums.DeviceFormFactor device_form_factor = 5;

  // The type of device.
  // Mandatory until M115. Replaced by device_form_factor afterwards, but still
  // populated for backward compatibility.
  optional SyncEnums.DeviceType device_type = 4 [deprecated = true];
}

message SessionWindow {
  // Unique (to the owner) id for this window.
  optional int32 window_id = 1;
  // Index of the selected tab in tabs; -1 if no tab is selected.
  optional int32 selected_tab_index = 2 [default = -1];
  // Type of the window.
  optional SyncEnums.BrowserType browser_type = 3 [default = TYPE_TABBED];
  // The tabs that compose a window (correspond to tab id's).
  repeated int32 tab = 4;
}

message SessionTab {
  // Unique (to the owner) id for this tab.
  optional int32 tab_id = 1 [default = -1];
  // The unique id for the window this tab belongs to.
  optional int32 window_id = 2;
  // Visual index of the tab within its window. There may be gaps in these
  // values.
  optional int32 tab_visual_index = 3 [default = -1];
  // Identifies the index of the current navigation in navigations. For
  // example, if this is 2 it means the current navigation is navigations[2].
  optional int32 current_navigation_index = 4 [default = -1];
  // True if the tab is pinned.
  optional bool pinned = 5 [default = false];
  // If non-empty, this tab is an app tab and this is the id of the extension.
  optional string extension_app_id = 6;
  // Tabs are navigated, and the navigation data is here.
  repeated TabNavigation navigation = 7;

  optional SyncEnums.BrowserType browser_type = 13;

  // Timestamp for when this tab was last activated.
  // Corresponds to WebContents::GetLastActiveTime().
  optional int64 last_active_time_unix_epoch_millis = 14;

  // The favicon for the current url the tab is displaying. Either empty
  // or a valid PNG encoded favicon.
  optional bytes favicon = 8 [deprecated = true];
  // The type of favicon. For now only normal web favicons are supported.
  enum FaviconType { TYPE_WEB_FAVICON = 1; }
  optional FaviconType favicon_type = 9 [deprecated = true];
  // The url of the actual favicon (as opposed to the page using the favicon).
  optional string favicon_source = 11 [deprecated = true];
  // Ids of the currently assigned variations which should be sent to sync.
  repeated uint64 variation_id = 12 [deprecated = true];
}

message TabNavigation {
  // The page's URL as displayed to the user (which can be the actual page URL
  // or a virtual override). It can be empty or, in rare cases, an unsyncable
  // URL, so it is the receiver's responsibility to implement additional
  // filtering before displaying these URLs or tabs in the UI.
  optional string virtual_url = 2;
  // The referring URL, which can be empty.
  optional string referrer = 3;
  // The title of the page.
  optional string title = 4;
  // The core transition type.
  optional SyncEnums.PageTransition page_transition = 6 [default = LINK];
  // If this transition was triggered by a redirect, the redirect type.
  optional SyncEnums.PageTransitionRedirectType redirect_type = 7;
  // The unique navigation id (within this client).
  optional int32 unique_id = 8;
  // Timestamp for when this navigation last occurred (in client time).
  // If the user goes back/forward in history the timestamp may refresh.
  optional int64 timestamp_msec = 9;
  // User used the Forward or Back button to navigate among browsing history.
  optional bool navigation_forward_back = 10;
  // User used the address bar to trigger this navigation.
  optional bool navigation_from_address_bar = 11;
  // User is navigating to the home page.
  optional bool navigation_home_page = 12;
  // The id for this navigation, which is globally unique with high
  // probability.
  optional int64 global_id = 15;
  // The favicon url associated with this page.
  optional string favicon_url = 17;

  // The status code from the last navigation.
  optional int32 http_status_code = 20;

  // Correct referrer policy. Valid enums are defined in
  // third_party/WebKit/public/platform/WebReferrerPolicy.h.
  optional int32 correct_referrer_policy = 25 [default = 1];

  // Whether the Password Manager saw a password field on the page.
  optional SyncEnums.PasswordState password_state = 26;

  // The start/end of a redirect chain. Deprecated in M108 because they were
  // always set to false in practice, and don't make sense in the first place -
  // this message corresponds to a complete chain.
  optional bool navigation_chain_start = 13 [deprecated = true];
  optional bool navigation_chain_end = 14 [deprecated = true];
  // Search terms extracted from the URL. Deprecated in M64.
  optional string search_terms = 16 [deprecated = true];
  enum BlockedState {
    STATE_ALLOWED = 1;
    STATE_BLOCKED = 2;
  }
  // Whether access to the URL was allowed or blocked. Deprecated in M121
  // because it was unused.
  optional BlockedState blocked_state = 18
      [deprecated = true, default = STATE_ALLOWED];
  // Referrer policy. Old, broken value. Deprecated in M61.
  optional int32 obsolete_referrer_policy = 21 [deprecated = true];
  // True if created from restored navigation entry that hasn't been loaded.
  // Deprecated in M121 because it was unused.
  optional bool is_restored = 22 [deprecated = true];
  // The chain of redirections for this navigation, from the original URL
  // through the last URL that redirected. Deprecated in M121 because it was
  // unused.
  repeated NavigationRedirect navigation_redirect = 23 [deprecated = true];
  // The last URL traversed when different from the virtual_url. Deprecated in
  // M121 because it was unused.
  optional string last_navigation_redirect_url = 24 [deprecated = true];
  // The id for the task associated with this navigation, which is globally
  // unique with high probability. Deprecated in M121 because it was unused.
  optional int64 task_id = 27 [deprecated = true];
  // Task ids of all ancestor navigations, which can be from other tabs, from
  // root to parent. Deprecated in M121 because it was unused.
  repeated int64 ancestor_task_id = 28 [deprecated = true];
  // When a history entry is replaced (e.g. history.replaceState()), this
  // contained some information about the entry prior to being replaced.
  // Deprecated in M121 because it was unused.
  optional ReplacedNavigation replaced_navigation = 29 [deprecated = true];
  // The page language as determined by its textual content. An ISO 639 language
  // code (two letters, except for Chinese where a localization is necessary).
  // Deprecated in M121 because it was unused.
  optional string page_language = 30 [deprecated = true];

  reserved 1;
  reserved "index";
  reserved 5;
  reserved "state";
  reserved 19;
  reserved "content_pack_categories";
}

// Navigation information for a single redirection within a single navigation.
message NavigationRedirect {
  // A URL that redirected while navigating to the virtual_url.
  optional string url = 1;
}

// Subset of TabNavigation fields representing a navigation that was later
// replaced in history (e.g. history.replaceState()), which allows tracking
// information about the original navigation prior to the first replacement.
message ReplacedNavigation {
  optional string first_committed_url = 1;
  optional int64 first_timestamp_msec = 2;
  optional SyncEnums.PageTransition first_page_transition = 3;
}