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

Unified Diff: net/url_request/sdch_dictionary_fetcher.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/sdch_dictionary_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/sdch_dictionary_fetcher.cc
diff --git a/net/url_request/sdch_dictionary_fetcher.cc b/net/url_request/sdch_dictionary_fetcher.cc
index a3d35655deb9bffbc9cf814110863ac937158b68..8d90f5f0ea2c433697b65cb4b860c757ff0ef5eb 100644
--- a/net/url_request/sdch_dictionary_fetcher.cc
+++ b/net/url_request/sdch_dictionary_fetcher.cc
@@ -225,7 +225,7 @@ void SdchDictionaryFetcher::ResetRequest() {
current_request_.reset();
buffer_ = nullptr;
current_callback_.Reset();
- dictionary_.clear();
+ dictionary_.reset();
return;
}
@@ -286,6 +286,7 @@ int SdchDictionaryFetcher::DoSendRequest(int rv) {
current_request_->SetLoadFlags(load_flags);
buffer_ = new IOBuffer(kBufferSize);
+ dictionary_.reset(new std::string());
current_callback_ = info.callback;
current_request_->Start();
@@ -350,7 +351,7 @@ int SdchDictionaryFetcher::DoReadBodyComplete(int rv) {
// Data; append to the dictionary and look for more data.
if (rv > 0) {
- dictionary_.append(buffer_->data(), rv);
+ dictionary_->append(buffer_->data(), rv);
next_state_ = STATE_READ_BODY;
return OK;
}
@@ -365,7 +366,7 @@ int SdchDictionaryFetcher::DoCompleteRequest(int rv) {
// If the dictionary was successfully fetched, add it to the manager.
if (rv == OK) {
- current_callback_.Run(dictionary_, current_request_->url(),
+ current_callback_.Run(*dictionary_, current_request_->url(),
current_request_->net_log(),
current_request_->was_cached());
}
« no previous file with comments | « net/url_request/sdch_dictionary_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698