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

Unified Diff: content/browser/appcache/appcache_storage.cc

Issue 2249473002: Remove use of stl_util's STLDeleteContainerPairSecondPointers from content/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 | « content/browser/appcache/appcache_storage.h ('k') | content/browser/child_process_security_policy_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/appcache_storage.cc
diff --git a/content/browser/appcache/appcache_storage.cc b/content/browser/appcache/appcache_storage.cc
index d5bec16a5efb4900e213a4a6d2eb92ef0f072b16..0299ddc1792fa3dd78317a2f1e82109f0d3b61a8 100644
--- a/content/browser/appcache/appcache_storage.cc
+++ b/content/browser/appcache/appcache_storage.cc
@@ -6,7 +6,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "content/browser/appcache/appcache_response.h"
#include "content/browser/appcache/appcache_service_impl.h"
#include "storage/browser/quota/quota_client.h"
@@ -23,7 +23,6 @@ AppCacheStorage::AppCacheStorage(AppCacheServiceImpl* service)
}
AppCacheStorage::~AppCacheStorage() {
- base::STLDeleteValues(&pending_info_loads_);
DCHECK(delegate_references_.empty());
}
@@ -47,8 +46,7 @@ AppCacheStorage::ResponseInfoLoadTask::ResponseInfoLoadTask(
manifest_url_(manifest_url),
response_id_(response_id),
info_buffer_(new HttpResponseInfoIOBuffer) {
- storage_->pending_info_loads_.insert(
- PendingResponseInfoLoads::value_type(response_id, this));
+ storage_->pending_info_loads_[response_id] = base::WrapUnique(this);
}
AppCacheStorage::ResponseInfoLoadTask::~ResponseInfoLoadTask() {
@@ -64,7 +62,10 @@ void AppCacheStorage::ResponseInfoLoadTask::StartIfNeeded() {
}
void AppCacheStorage::ResponseInfoLoadTask::OnReadComplete(int result) {
+ std::unique_ptr<ResponseInfoLoadTask> this_wrapper(
+ std::move(storage_->pending_info_loads_[response_id_]));
storage_->pending_info_loads_.erase(response_id_);
+
scoped_refptr<AppCacheResponseInfo> info;
if (result >= 0) {
info = new AppCacheResponseInfo(storage_, manifest_url_,
@@ -73,7 +74,8 @@ void AppCacheStorage::ResponseInfoLoadTask::OnReadComplete(int result) {
info_buffer_->response_data_size);
}
FOR_EACH_DELEGATE(delegates_, OnResponseInfoLoaded(info.get(), response_id_));
- delete this;
+
+ // returning deletes this
}
void AppCacheStorage::LoadResponseInfo(const GURL& manifest_url,
« no previous file with comments | « content/browser/appcache/appcache_storage.h ('k') | content/browser/child_process_security_policy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698