chromium/components/sync/protocol/bookmark_specifics.proto

// 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 bookmarks.

// 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/unique_position.proto";

// Corresponds to a single meta info key/value pair for a bookmark node.
message MetaInfo {
  optional string key = 1;
  optional string value = 2;
}

// Properties of bookmark sync objects.
message BookmarkSpecifics {
  // URL of the bookmarked page (unset for folders).
  optional string url = 1;
  // PNG-encoded content of the favicon image (in practice 16x16, as determined
  // by |kFaviconSize|). Empty if the bookmark has no favicon (which includes
  // bookmark folders).
  optional bytes favicon = 2;
  // Contains legacy title which is truncated and may contain escaped symbols.
  optional string legacy_canonicalized_title = 3;
  // Corresponds to BookmarkNode::date_added() represented as microseconds since
  // the Windows epoch.
  optional int64 creation_time_us = 4;
  // The URL of the favicon image encoded in field |favicon|. Note that there
  // are various cases where this URL may be missing (field unset or empty) even
  // if the |favicon| field (image content) is populated:
  // 1. WebUI pages such as "chrome://bookmarks/" are missing a favicon URL but
  //    they have a favicon.
  // 2. Data generated by ancient clients (prior to M25) may not contain the
  //    favicon URL.
  // 3. If the favicon URL is too large (determined by |kMaxFaviconUrlSize|) it
  //    may be omitted by clients to avoid running into the max-entity-size
  //    limit. Most notably, this includes URLs prefixed with the data: scheme
  //    that may encode the image content itself in the URL.
  optional string icon_url = 5;
  repeated MetaInfo meta_info = 6;
  reserved 7;
  reserved 8;
  reserved 9;
  // Introduced in M81, it represents a globally unique and immutable ID.
  //
  // If present, it must be the same as originator_client_item_id in lowercase,
  // unless originator client item ID is not a valid GUID. In such cases (which
  // is the case for bookmarks created before 2015), this GUID must match the
  // value inferred from the combination of originator cache GUID and
  // originator client item ID, see InferGuidForLegacyBookmark().
  //
  // If not present, the value can be safely inferred using the very same
  // methods listed above.
  optional string guid = 10;
  // Contains full title as is. |legacy_canonicalized_title| is a prefix of
  // |full_title| with escaped symbols.
  optional string full_title = 11;
  reserved 12;
  reserved 13;
  // Introduced in M94, represents the GUID (field |guid|) of the parent.
  optional string parent_guid = 14;

  // Introduced in M94, determines whether this entity represents a bookmark
  // folder. This field is redundant to the similar field in SyncEntity. If this
  // field in specifics is set, it takes precedence over the one in SyncEntity.
  enum Type {
    // |UNSPECIFIED| is relevant only for the case where the field is not set.
    // M94 and above should not use this value.
    UNSPECIFIED = 0;
    URL = 1;
    FOLDER = 2;
  }
  optional Type type = 15;

  // Introduced in M94, determines ordering among siblings. This field is
  // redundant to the similar field in SyncEntity. If this field in specifics is
  // set, it takes precedence over the one in SyncEntity.
  optional UniquePosition unique_position = 16;

  // Introduced in M106, corresponds to BookmarkNode::date_last_used()
  // represented as microseconds since the Windows epoch.
  optional int64 last_used_time_us = 17;
}