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

Side by Side Diff: net/url_request/sdch_dictionary_fetcher.h

Issue 2075033003: Make SdchDictionaryFetcher free more memory when done. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oops Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/url_request/sdch_dictionary_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // TODO(rdsmith): This class needs to delegate URLRequest::Delegate methods 5 // TODO(rdsmith): This class needs to delegate URLRequest::Delegate methods
6 // to the net/ embedder for correct implementation of authentication. 6 // to the net/ embedder for correct implementation of authentication.
7 // Specifically, this class needs the embedder to provide functionality 7 // Specifically, this class needs the embedder to provide functionality
8 // corresponding to 8 // corresponding to
9 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested}. 9 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested}.
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 // A queue of URLs that are being used to download dictionaries. 106 // A queue of URLs that are being used to download dictionaries.
107 std::unique_ptr<UniqueFetchQueue> fetch_queue_; 107 std::unique_ptr<UniqueFetchQueue> fetch_queue_;
108 108
109 // The request, buffer, and consumer supplied data used for getting 109 // The request, buffer, and consumer supplied data used for getting
110 // the current dictionary. All are null when a fetch is not in progress. 110 // the current dictionary. All are null when a fetch is not in progress.
111 std::unique_ptr<URLRequest> current_request_; 111 std::unique_ptr<URLRequest> current_request_;
112 scoped_refptr<IOBuffer> buffer_; 112 scoped_refptr<IOBuffer> buffer_;
113 OnDictionaryFetchedCallback current_callback_; 113 OnDictionaryFetchedCallback current_callback_;
114 114
115 // The currently accumulating dictionary. 115 // The currently accumulating dictionary. Stored as a unique_ptr so all memory
116 std::string dictionary_; 116 // it consumes can be easily freed, as it gets quite big, and
117 // std::string::clear() may not free memory.
118 std::unique_ptr<std::string> dictionary_;
117 119
118 // Store the URLRequestContext associated with the owning SdchManager for 120 // Store the URLRequestContext associated with the owning SdchManager for
119 // use while fetching. 121 // use while fetching.
120 URLRequestContext* const context_; 122 URLRequestContext* const context_;
121 123
122 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); 124 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher);
123 }; 125 };
124 126
125 } // namespace net 127 } // namespace net
126 128
127 #endif // NET_URL_REQUEST_SDCH_DICTIONARY_FETCHER_H_ 129 #endif // NET_URL_REQUEST_SDCH_DICTIONARY_FETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | net/url_request/sdch_dictionary_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698