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

Unified Diff: net/base/sdch_manager.h

Issue 321283002: Clear SDCH information on "Clear browsing data" path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/sdch_dictionary_fetcher.cc ('k') | net/base/sdch_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_manager.h
diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h
index c760313284e2ee396323d5de71262daf97aef330..37cac1b3790f2008c5fc11753281ed73b9721a90 100644
--- a/net/base/sdch_manager.h
+++ b/net/base/sdch_manager.h
@@ -49,6 +49,11 @@ class SdchFetcher {
// from a server. The callee is responsible for getting that dictionary_text,
// and then calling back to AddSdchDictionary() to the SdchManager instance.
virtual void Schedule(const GURL& dictionary_url) = 0;
+
+ // The Cancel() method is called to cancel all pending dictionary fetches.
+ // This is used for implementation of ClearData() below.
+ virtual void Cancel() = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(SdchFetcher);
};
@@ -234,6 +239,9 @@ class NET_EXPORT SdchManager : public NON_EXPORTED_BASE(base::NonThreadSafe) {
SdchManager();
~SdchManager();
+ // Clear data (for browser data removal).
+ void ClearData();
+
// Record stats on various errors.
static void SdchErrorRecovery(ProblemCodes problem);
@@ -304,12 +312,10 @@ class NET_EXPORT SdchManager : public NON_EXPORTED_BASE(base::NonThreadSafe) {
// to use to decompreses data that arrived as SDCH encoded content. Check to
// be sure the returned |dictionary| can be used for decoding content supplied
// in response to a request for |referring_url|.
- // Caller is responsible for AddRef()ing the dictionary, and Release()ing it
- // when done.
// Return null in |dictionary| if there is no matching legal dictionary.
void GetVcdiffDictionary(const std::string& server_hash,
const GURL& referring_url,
- Dictionary** dictionary);
+ scoped_refptr<Dictionary>* dictionary);
// Get list of available (pre-cached) dictionaries that we have already loaded
// into memory. The list is a comma separated list of (client) hashes per
@@ -335,7 +341,7 @@ class NET_EXPORT SdchManager : public NON_EXPORTED_BASE(base::NonThreadSafe) {
typedef std::set<std::string> ExperimentSet;
// A map of dictionaries info indexed by the hash that the server provides.
- typedef std::map<std::string, Dictionary*> DictionaryMap;
+ typedef std::map<std::string, scoped_refptr<Dictionary> > DictionaryMap;
// Support SDCH compression, by advertising in headers.
static bool g_sdch_enabled_;
@@ -358,7 +364,7 @@ class NET_EXPORT SdchManager : public NON_EXPORTED_BASE(base::NonThreadSafe) {
// Support exponential backoff in number of domain accesses before
// blacklisting expires.
- DomainCounter exponential_blacklist_count;
+ DomainCounter exponential_blacklist_count_;
// List of hostnames for which a latency experiment is allowed (because a
// round trip test has recently passed).
« no previous file with comments | « chrome/browser/net/sdch_dictionary_fetcher.cc ('k') | net/base/sdch_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698