File: cache_storage.proto

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (87 lines) | stat: -rw-r--r-- 3,006 bytes parent folder | download | duplicates (4)
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
// Copyright 2014 The Chromium Authors
// 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 content.proto;

message CacheStorageIndex {
  // The Cache message represents stored caches, where cache names are
  // preserved as UTF16 strings to align with WebIDL DOMStrings. This ensures
  // compatibility with names that may contain invalid characters. While the
  // `name` field remains for backward compatibility, all new caches will use
  // `u16string_name` going forward. Older clients that read index files written
  // with UTF8 cache names will not break due to this approach.
  message Cache {
    // Maintained for backward compatibility, but no longer used for new caches.
    required string name = 1;
    optional string cache_dir = 2;
    optional int64 size = 3;
    optional string padding_key = 4 [deprecated = true];
    optional int64 padding = 5;
    optional int32 padding_version = 6;
    optional bytes u16string_name = 7;
  }
  repeated Cache cache = 1;
  optional string origin = 2 [deprecated = true];
  optional string storage_key = 3;
  // Note: The bucket ID is cached here for cases where we need it to
  // build a Cache Storage directory path when a QuotaManagerProxy
  // is not available, but otherwise it's safer to lookup the bucket
  // ID using the storage_key since the value stored here might not
  // always be reliable (for instance, if a crash occurred between the
  // time that a bucket was deleted and instances had their index files
  // deleted on disk).
  optional int64 bucket_id = 4;
  optional bool bucket_is_default = 5;
}

message CacheHeaderMap {
  required string name = 1;
  required string value = 2;
}

message CacheRequest {
  required string method = 1;
  repeated CacheHeaderMap headers = 2;
  optional string fragment = 3;
}

message CacheResponse {
  enum ResponseType {
    BASIC_TYPE = 0;
    CORS_TYPE = 1;
    DEFAULT_TYPE = 2;
    ERROR_TYPE = 3;
    OPAQUE_TYPE = 4;
    OPAQUE_REDIRECT_TYPE = 5;
  }

  required int32 status_code = 1;
  required string status_text = 2;
  required ResponseType response_type = 3;
  repeated CacheHeaderMap headers = 4;
  optional string url = 5 [deprecated = true];
  optional int64 response_time = 6;
  repeated string cors_exposed_header_names = 7;
  repeated string url_list = 8;
  optional bool loaded_with_credentials = 9 [deprecated = true];
  // Mapped to net::HttpResponseInfo::ConnectionInfo via static casting.
  optional int32 connection_info = 10;
  optional string alpn_negotiated_protocol = 11;
  optional bool was_fetched_via_spdy = 12;
  optional string mime_type = 13;
  optional string request_method = 14;
  optional int64 padding = 15;
  optional int64 side_data_padding = 16;
  optional bool request_include_credentials = 17;
}

message CacheMetadata {
  required CacheRequest request = 1;
  required CacheResponse response = 2;
  optional int64 entry_time = 3;
}