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

Unified Diff: net/filter/sdch_filter.h

Issue 711753003: Pin dictionaries from being deleted while request is outstanding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated comments; fixed try job errors. Created 6 years, 1 month 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
Index: net/filter/sdch_filter.h
diff --git a/net/filter/sdch_filter.h b/net/filter/sdch_filter.h
index e9648b1fb3e136c2ac761c183034c16203da71cd..d02989419661c3e52d269fb21be4c5c17beb2480 100644
--- a/net/filter/sdch_filter.h
+++ b/net/filter/sdch_filter.h
@@ -89,10 +89,10 @@ class NET_EXPORT_PRIVATE SdchFilter : public Filter {
// attempted.
bool dictionary_hash_is_plausible_;
- // We hold an in-memory copy of the dictionary during the entire decoding, as
- // it is used directly by the VC-DIFF decoding system.
- // That char* data is part of the dictionary_ we hold a reference to.
- scoped_refptr<SdchManager::Dictionary> dictionary_;
+ // Validity of this pointer is guaranteed by either the FilterContext holding
+ // a containing SdchManager::DictionarySet, or this object holding a
+ // container in |unexpected_dictionary_handle_| below.
+ const SdchManager::Dictionary *dictionary_;
// We keep a copy of the URLRequestContext for use in the destructor, (at
// which point GetURLRequestContext() will likely return null because of
@@ -126,6 +126,11 @@ class NET_EXPORT_PRIVATE SdchFilter : public Filter {
// by checking within this mime type (we may do a meta-refresh via html).
std::string mime_type_;
+ // If the response was encoded with a dictionary different than those
+ // advertised (e.g. a cached response using an old dictionary), this
+ // variable preserves that dictionary from deletion during decoding.
+ scoped_ptr<SdchManager::DictionarySet> unexpected_dictionary_handle_;
+
DISALLOW_COPY_AND_ASSIGN(SdchFilter);
};

Powered by Google App Engine
This is Rietveld 408576698