blob: 9331650cf4f0d7f1c2882b3ab787ce3bd5242ec9 [file] [log] [blame]
// 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.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package ukm;
// Source contains data related to a top-level navigation.
// Next tag: 16
message Source {
// The URL scheme, such as HTTP, HTTPS, CHROME_EXTENSION, etc.
enum UrlScheme {
UNSUPPORTED = 0;
HTTP = 1;
HTTPS = 2;
FTP = 3;
ABOUT = 4;
CHROME = 5;
CHROME_EXTENSION = 6;
APP = 7;
}
// An identifier for the source. This should be unique within a session.
optional int64 id = 1;
// The source id of the last committed non-same-document navigation for the
// tab this source is in. Should only be set for navigation sources. For
// backward compatibility, this field will never be set to the source id of a
// same-document source. In cases where the last committed navigation was a
// same-document navigation, previous_same_document_source_id will contain
// the source id of that previous same document navigation, while
// previous_source_id will contain the source id of the last committed
// non-same-document navigation. For example, if a user starts on page A (a
// non same document page load), then performs a same document navigation to
// B, then navigates to C (which could be either a same document or a non same
// document navigation), previous_source_id will reference A, and
// previous_same_document_source_id will reference B.
optional int64 previous_source_id = 11;
// The source id for the previous same document navigation, if the
// previously committed source was a same document navigation. If
// the previously committed source was not a same document
// navigation, this field will be unset.
optional int64 previous_same_document_source_id = 14;
// For sources representing the first navigation in a new tab, this id marks
// the source which opened the tab. Should only be set for the first
// navigation source in a tab.
optional int64 opener_source_id = 12;
// Holds data about a URL seen by the client.
message UrlInfo {
// The URL seen by the client.
optional string url = 1;
// Number of URLs seen for this source before the current URL.
// If unset, it’s equivalent to the count of the UrlInfo before it + 1,
// or 0 if it’s the first UrlInfo.
optional int32 previous_url_count = 2;
}
// Data about each URL associated with the source_id within the record's
// scope, in the order that the URLs were encountered. Data may include full
// or partial redirect chains for main frame navigations.
repeated UrlInfo urls = 8;
// Data about the URL of the Document, copied from the Source message whose
// id matched the navigation source id of the DocumentCreated event.
repeated UrlInfo resolved_urls = 15;
// Whether this source is for a same document navigation. Examples of same
// document navigations are fragment navigations, pushState/replaceState,
// and same page history navigation.
optional bool is_same_document_navigation = 13;
// The URL of the source, as recorded in history. If this URL has not been
// discovered by Google's crawler, it should not be recorded.
optional string url = 2;
// The origin of the URL (ex. "http://docs.google.com" if the URL is something
// like "http://docs.google.com/some_doc_hash"). This field is populated
// server-side and should never be filled in by clients.
reserved 5;
reserved "url_origin";
reserved 9;
reserved "url_scheme";
// The initial URL of the source. Set in cases where the source URL changed
// (e.g. it was redirected), otherwise unset. If this URL has not been
// discovered by Google's crawler, it should not be recorded.
optional string initial_url = 6;
// Flag indicating if the metric was collected while inside a "custom tab".
optional bool is_custom_tab = 7;
// Relative time of navigation for this Source, as seen by the client, and is
// set for sources of type ukm::SourceIdType::NAVIGATION_ID. Time of events
// related to this Source will generally be relative to this timestamp. The
// recorded navigation time is in TimeTicks, which is the relative time since
// the origin. The origin is platform-specific but is guaranteed to be
// monotonically increase within each session.
optional int64 navigation_time_msec = 3;
// Unique identifier (for a given client_id/session_id) for the tab this
// source is associated with. Should only be set for navigation sources.
optional int64 tab_id = 10;
// Time between navigation and the first contentful paint, in milliseconds.
// Deprecated. Use ukm::Entry instead.
optional int64 first_contentful_paint_msec = 4 [deprecated = true];
}