summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 02:37:45 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 02:37:45 +0000
commit47aef530fe0221533b954264831eebaa792764b6 (patch)
treeee411146635568c9d084ab4f0e30a52cb0561388 /base
parent198d0468712f48b7d02a5366cfa03989061ed147 (diff)
downloadchromium_src-47aef530fe0221533b954264831eebaa792764b6.zip
chromium_src-47aef530fe0221533b954264831eebaa792764b6.tar.gz
chromium_src-47aef530fe0221533b954264831eebaa792764b6.tar.bz2
Reland my ClientSocketPool refactor.
Fixed a bug where we were double compensating for active_socket_count in CancelRequest and OnIOComplete. Added ClientSocketPoolTest_TwoRequestsCancelOne to catch this. Triggered a DCHECK in debug mode before I removed the extra code in OnIOComplete. BUG=http://www.crbug.com/13289 Review URL: http://codereview.chromium.org/118172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/stl_util-inl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/stl_util-inl.h b/base/stl_util-inl.h
index 54b7b29..70fa69e 100644
--- a/base/stl_util-inl.h
+++ b/base/stl_util-inl.h
@@ -447,4 +447,11 @@ std::vector<T> SetToVector(const std::set<T>& values) {
return result;
}
+// Test to see if a set, map, hash_set or hash_map contains a particular key.
+// Returns true if the key is in the collection.
+template <typename Collection, typename Key>
+bool ContainsKey(const Collection& collection, const Key& key) {
+ return collection.find(key) != collection.end();
+}
+
#endif // BASE_STL_UTIL_INL_H_