Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: net/base/sdch_manager.h

Issue 20254: Fetch SDCH dictionary as soon as current URL fetch completes... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // Provides global database of differential decompression dictionaries for the 5 // Provides global database of differential decompression dictionaries for the
6 // SDCH filter (processes sdch enconded content). 6 // SDCH filter (processes sdch enconded content).
7 7
8 // Exactly one instance of SdchManager is built, and all references are made 8 // Exactly one instance of SdchManager is built, and all references are made
9 // into that collection. 9 // into that collection.
10 // 10 //
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 // Unit test only: Indicate what current blacklist increment is for a domain. 237 // Unit test only: Indicate what current blacklist increment is for a domain.
238 static int BlacklistDomainExponential(std::string domain); 238 static int BlacklistDomainExponential(std::string domain);
239 239
240 // Check to see if SDCH is enabled (globally), and the given URL is in a 240 // Check to see if SDCH is enabled (globally), and the given URL is in a
241 // supported domain (i.e., not blacklisted, and either the specific supported 241 // supported domain (i.e., not blacklisted, and either the specific supported
242 // domain, or all domains were assumed supported). If it is blacklist, reduce 242 // domain, or all domains were assumed supported). If it is blacklist, reduce
243 // by 1 the number of times it will be reported as blacklisted. 243 // by 1 the number of times it will be reported as blacklisted.
244 const bool IsInSupportedDomain(const GURL& url); 244 const bool IsInSupportedDomain(const GURL& url);
245 245
246 // Schedule the URL fetching to load a dictionary. This will generally return 246 // Schedule the URL fetching to load a dictionary. This will always return
247 // long before the dictionary is actually loaded and added. 247 // before the dictionary is actually loaded and added.
248 // After the implied task does completes, the dictionary will have been 248 // After the implied task does completes, the dictionary will have been
249 // cached in memory. 249 // cached in memory.
250 void FetchDictionary(const GURL& referring_url, const GURL& dictionary_url); 250 void FetchDictionary(const GURL& dictionary_url);
251 251
252 // Security test function used before initiating a fetch. 252 // Security test function used before initiating a FetchDictionary.
253 // Return true if fetch is legal. 253 // Return true if fetch is legal.
254 bool CanFetchDictionary(const GURL& referring_url, 254 bool CanFetchDictionary(const GURL& referring_url,
255 const GURL& dictionary_url) const; 255 const GURL& dictionary_url) const;
256 256
257 // Add an SDCH dictionary to our list of availible dictionaries. This addition 257 // Add an SDCH dictionary to our list of availible dictionaries. This addition
258 // will fail (return false) if addition is illegal (data in the dictionary is 258 // will fail (return false) if addition is illegal (data in the dictionary is
259 // not acceptable from the dictionary_url; dictionary already added, etc.). 259 // not acceptable from the dictionary_url; dictionary already added, etc.).
260 bool AddSdchDictionary(const std::string& dictionary_text, 260 bool AddSdchDictionary(const std::string& dictionary_text,
261 const GURL& dictionary_url); 261 const GURL& dictionary_url);
262 262
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 DomainCounter blacklisted_domains_; 312 DomainCounter blacklisted_domains_;
313 313
314 // Support exponential backoff in number of domain accesses before 314 // Support exponential backoff in number of domain accesses before
315 // blacklisting expires. 315 // blacklisting expires.
316 DomainCounter exponential_blacklist_count; 316 DomainCounter exponential_blacklist_count;
317 317
318 DISALLOW_COPY_AND_ASSIGN(SdchManager); 318 DISALLOW_COPY_AND_ASSIGN(SdchManager);
319 }; 319 };
320 320
321 #endif // NET_BASE_SDCH_MANAGER_H_ 321 #endif // NET_BASE_SDCH_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698