| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 syntax = "proto2"; | 5 syntax = "proto2"; |
| 6 | 6 |
| 7 option optimize_for = LITE_RUNTIME; | 7 option optimize_for = LITE_RUNTIME; |
| 8 | 8 |
| 9 package content; | 9 package content; |
| 10 | 10 |
| 11 message ServiceWorkerOriginTrialFeature { | 11 message ServiceWorkerOriginTrialFeature { |
| 12 required string name = 1; | 12 required string name = 1; |
| 13 repeated string tokens = 2; | 13 repeated string tokens = 2; |
| 14 } | 14 } |
| 15 | 15 |
| 16 message ServiceWorkerOriginTrialInfo { | 16 message ServiceWorkerOriginTrialInfo { |
| 17 repeated ServiceWorkerOriginTrialFeature features = 1; | 17 repeated ServiceWorkerOriginTrialFeature features = 1; |
| 18 } | 18 } |
| 19 | 19 |
| 20 message ServiceWorkerNavigationPreloadState { |
| 21 required bool enabled = 1; |
| 22 optional string header = 2; |
| 23 } |
| 24 |
| 20 message ServiceWorkerRegistrationData { | 25 message ServiceWorkerRegistrationData { |
| 21 required int64 registration_id = 1; | 26 required int64 registration_id = 1; |
| 22 required string scope_url = 2; | 27 required string scope_url = 2; |
| 23 required string script_url = 3; | 28 required string script_url = 3; |
| 24 | 29 |
| 25 // Versions are first stored once they successfully install and become the | 30 // Versions are first stored once they successfully install and become the |
| 26 // waiting version. Then they are updated when they transition to the active | 31 // waiting version. Then they are updated when they transition to the active |
| 27 // version. | 32 // version. |
| 28 required int64 version_id = 4; | 33 required int64 version_id = 4; |
| 29 | 34 |
| 30 required bool is_active = 5; | 35 required bool is_active = 5; |
| 31 required bool has_fetch_handler = 6; | 36 required bool has_fetch_handler = 6; |
| 32 | 37 |
| 33 // Serialized by Time::ToInternalValue(). | 38 // Serialized by Time::ToInternalValue(). |
| 34 required int64 last_update_check_time = 7; | 39 required int64 last_update_check_time = 7; |
| 35 | 40 |
| 36 optional uint64 resources_total_size_bytes = 8; | 41 optional uint64 resources_total_size_bytes = 8; |
| 37 | 42 |
| 38 repeated string foreign_fetch_scope = 9; | 43 repeated string foreign_fetch_scope = 9; |
| 39 repeated string foreign_fetch_origin = 10; | 44 repeated string foreign_fetch_origin = 10; |
| 40 | 45 |
| 41 // If the registration data was created by old Chrome (< M56), | 46 // If the registration data was created by old Chrome (< M56), |
| 42 // |origin_trial_tokens| is not set. In this case, we have to start the | 47 // |origin_trial_tokens| is not set. In this case, we have to start the |
| 43 // Service Worker and load the main script resource in ServiceWorkerStorage | 48 // Service Worker and load the main script resource in ServiceWorkerStorage |
| 44 // to check the HTTP header. | 49 // to check the HTTP header. |
| 45 optional ServiceWorkerOriginTrialInfo origin_trial_tokens = 11; | 50 optional ServiceWorkerOriginTrialInfo origin_trial_tokens = 11; |
| 51 |
| 52 optional ServiceWorkerNavigationPreloadState navigation_preload_state = 12; |
| 46 } | 53 } |
| 47 | 54 |
| 48 message ServiceWorkerResourceRecord { | 55 message ServiceWorkerResourceRecord { |
| 49 required int64 resource_id = 1; | 56 required int64 resource_id = 1; |
| 50 required string url = 2; | 57 required string url = 2; |
| 51 optional uint64 size_bytes = 3; | 58 optional uint64 size_bytes = 3; |
| 52 } | 59 } |
| OLD | NEW |