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

Unified Diff: net/filter/sdch_filter.h

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « net/filter/mock_filter_context.cc ('k') | net/filter/sdch_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/filter/sdch_filter.h
diff --git a/net/filter/sdch_filter.h b/net/filter/sdch_filter.h
index bc7788c3b09b8aac656ac48335592760c41ec645..9541742bca84b873aa059a49b66178d0ffeb2829 100644
--- a/net/filter/sdch_filter.h
+++ b/net/filter/sdch_filter.h
@@ -43,7 +43,7 @@ class NET_EXPORT_PRIVATE SdchFilter : public Filter {
FilterStatus ReadFilteredData(char* dest_buffer, int* dest_len) override;
private:
- // Internal status. Once we enter an error state, we stop processing data.
+ // Internal status. Once we enter an error state, we stop processing data.
enum DecodingStatus {
DECODING_UNINITIALIZED,
WAITING_FOR_DICTIONARY_SELECTION,
@@ -87,19 +87,19 @@ class NET_EXPORT_PRIVATE SdchFilter : public Filter {
// After assembling an entire dictionary hash (the first 9 bytes of the
// sdch payload, we check to see if it is plausible, meaning it has a null
// termination, and has 8 characters that are possible in a net-safe base64
- // encoding. If the hash is not plausible, then the payload is probably not
+ // encoding. If the hash is not plausible, then the payload is probably not
// an SDCH encoded bundle, and various error recovery strategies can be
// 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
- // the disassociation of the URLRequest from the URLRequestJob). This is
+ // the disassociation of the URLRequest from the URLRequestJob). This is
// safe because the URLRequestJob (and any filters) are guaranteed to be
// deleted before the URLRequestContext is destroyed.
const URLRequestContext* const url_request_context_;
@@ -129,6 +129,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);
};
« no previous file with comments | « net/filter/mock_filter_context.cc ('k') | net/filter/sdch_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698