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

Unified Diff: content/child/resource_dispatcher_unittest.cc

Issue 2318303002: Remove stl_util's STLDeleteContainerPairSecondPointers. (Closed)
Patch Set: fix Created 4 years, 3 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/renderer_host/media/video_capture_host_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_dispatcher_unittest.cc
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
index c63692e1acb157c1530be5645ed9faf1a834862d..a2e457edfc159b77211a719662e9c2e40176a779 100644
--- a/content/child/resource_dispatcher_unittest.cc
+++ b/content/child/resource_dispatcher_unittest.cc
@@ -20,7 +20,6 @@
#include "base/message_loop/message_loop.h"
#include "base/process/process_handle.h"
#include "base/run_loop.h"
-#include "base/stl_util.h"
#include "content/child/request_extra_data.h"
#include "content/common/appcache_interfaces.h"
#include "content/common/resource_messages.h"
@@ -149,8 +148,7 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
}
~ResourceDispatcherTest() override {
- base::STLDeleteContainerPairSecondPointers(shared_memory_map_.begin(),
- shared_memory_map_.end());
+ shared_memory_map_.clear();
dispatcher_.reset();
base::RunLoop().RunUntilIdle();
}
@@ -264,7 +262,7 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
void NotifySetDataBuffer(int request_id, size_t buffer_size) {
base::SharedMemory* shared_memory = new base::SharedMemory();
ASSERT_FALSE(shared_memory_map_[request_id]);
- shared_memory_map_[request_id] = shared_memory;
+ shared_memory_map_[request_id] = base::WrapUnique(shared_memory);
EXPECT_TRUE(shared_memory->CreateAndMapAnonymous(buffer_size));
base::SharedMemoryHandle duplicate_handle;
@@ -343,7 +341,7 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
private:
// Map of request IDs to shared memory.
- std::map<int, base::SharedMemory*> shared_memory_map_;
+ std::map<int, std::unique_ptr<base::SharedMemory>> shared_memory_map_;
std::vector<IPC::Message> message_queue_;
base::MessageLoop message_loop_;
« no previous file with comments | « content/browser/renderer_host/media/video_capture_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698