@param {!./ampdoc-impl.AmpDoc} ampdoc
(ampdoc)
| 136 | class Cid { |
| 137 | /** @param {!./ampdoc-impl.AmpDoc} ampdoc */ |
| 138 | constructor(ampdoc) { |
| 139 | /** @const */ |
| 140 | this.ampdoc = ampdoc; |
| 141 | |
| 142 | /** |
| 143 | * Cached base cid once read from storage to avoid repeated |
| 144 | * reads. |
| 145 | * @private {?Promise<string>} |
| 146 | * @restricted |
| 147 | */ |
| 148 | this.baseCid_ = null; |
| 149 | |
| 150 | /** |
| 151 | * Cache to store external cids. Scope is used as the key and cookie value |
| 152 | * is the value. |
| 153 | * @private {!{[key: string]: !Promise<string>}} |
| 154 | * @restricted |
| 155 | */ |
| 156 | this.externalCidCache_ = Object.create(null); |
| 157 | |
| 158 | /** |
| 159 | * @private @const {!CacheCidApi} |
| 160 | */ |
| 161 | this.cacheCidApi_ = new CacheCidApi(ampdoc); |
| 162 | |
| 163 | /** |
| 164 | * @private {!ViewerCidApi} |
| 165 | */ |
| 166 | this.viewerCidApi_ = new ViewerCidApi(ampdoc); |
| 167 | |
| 168 | this.cidApi_ = new GoogleCidApi(ampdoc); |
| 169 | |
| 170 | /** @private {?{[key: string]: string}} */ |
| 171 | this.apiKeyMap_ = null; |
| 172 | } |
| 173 | |
| 174 | /** @override */ |
| 175 | get(getCidStruct, consent, opt_persistenceConsent) { |