| // Copyright 2016 Google Inc. All Rights Reserved. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // File schema for "upgrade" save data. |
| // |
| // A platform migrating to Cobalt from a pre-existing HTML5 container may need |
| // to load save data in the legacy format into Cobalt. In this case, it is |
| // expected the platform implementation will return the legacy save data in the |
| // format described by this schema (JSON-encoded data prefixed by a fixed |
| // identifier), which will then be detected by Cobalt and upgraded to the |
| // current save data format. |
| |
| // The first 4 bytes of the data must be the ASCII characters: "UPG0". |
| // The remainder of the data must be JSON-encoded according to the schema below. |
| // For details of how the proto3 syntax used here maps to JSON, see: |
| // https://developers.google.com/protocol-buffers/docs/proto3#json |
| |
| syntax = "proto3"; |
| |
| message SaveData { |
| // Array (possibly empty) of Cookie objects, defined below. |
| repeated Cookie cookies = 1; |
| |
| // Array (possibly empty) of LocalStorageEntry objects, defined below. |
| repeated LocalStorageEntry local_storage_entries = 2; |
| |
| // A single cookie. |
| mesage Cookie { |
| // URL in canonical form, e.g. "https://www.youtube.com/". Must be provided |
| // or the cookie will be ignored. |
| string url = 1; |
| |
| // Application-defined key. Must be provided or the cookie will be ignored. |
| string name = 2; |
| |
| // Application-defined value, treated opaquely by Cobalt. Must be provided |
| // or the cookie will be ignored. |
| string value = 3; |
| |
| // Domain, e.g. ".youtube.com". Defaults to the domain of the "url" field. |
| string domain = 4; |
| |
| // Optional virtual path, defaults to "/". |
| string path = 5; |
| |
| // Microseconds since Windows epoch (1601-01-01 00:00:00 UTC), as ASCII |
| // decimal string. Defaults to now. |
| int64 creation = 6; |
| |
| // Microseconds since Windows epoch (1601-01-01 00:00:00 UTC), as ASCII |
| // decimal string. Defaults to maximum expiration period from now. |
| int64 expiration = 7; |
| |
| // Microseconds since Windows epoch (1601-01-01 00:00:00 UTC), as ASCII |
| // decimal string. Defaults to now. |
| int64 last_access = 8; |
| |
| // Whether this is an HTTP-only cookie. Defaults to false. |
| bool http_only = 9; |
| } |
| |
| // A single local storage entry. |
| message LocalStorageEntry { |
| // Application-defined key. Must be provided or the local storage entry will |
| // be ignored. |
| string key = 1; |
| |
| // Application-defined value, treated opaquely by Cobalt. Must be provided |
| // or the local storage entry will be ignored. |
| string value = 2; |
| } |
| } |