summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_pool_base.h
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 21:52:15 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 21:52:15 +0000
commit96b939a7b319b4e925ed847cb5cbbcc921872f41 (patch)
tree822e5570f23fd9aae4ad532017603a64d13738ed /net/socket/client_socket_pool_base.h
parent9db08db3002dd85167577fabeee0cbe9d8361bed (diff)
downloadchromium_src-96b939a7b319b4e925ed847cb5cbbcc921872f41.zip
chromium_src-96b939a7b319b4e925ed847cb5cbbcc921872f41.tar.gz
chromium_src-96b939a7b319b4e925ed847cb5cbbcc921872f41.tar.bz2
Revert 117772 - Add instrumentation to help track down a use-after-free.
This instrumentation checks to see if a deleted ClientSocketPoolBaseHelper::Group is being re-used. If it catches a use-after-free of this class then it will save the callstack where the deletion occurred into the mini-dump, for manual inspection by bug investigator. BUG=109876 Review URL: http://codereview.chromium.org/9207014 TBR=eroman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9226030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool_base.h')
-rw-r--r--net/socket/client_socket_pool_base.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 869870d..0cca6f4a 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -31,7 +31,6 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/debug/stack_trace.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -413,7 +412,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
// uses it. Returns true on success. Otherwise, returns false.
bool TryToUsePreconnectConnectJob();
- void AddJob(ConnectJob* job);
+ void AddJob(ConnectJob* job) { jobs_.insert(job); }
void RemoveJob(ConnectJob* job) { jobs_.erase(job); }
void RemoveAllJobs();
@@ -428,34 +427,17 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
std::list<IdleSocket>* mutable_idle_sockets() { return &idle_sockets_; }
private:
- enum MagicToken {
- TOKEN_ALIVE = 0xCA11AB1E,
- TOKEN_DEAD = 0xB100D1ED,
- };
-
// Called when the backup socket timer fires.
void OnBackupSocketTimerFired(
std::string group_name,
ClientSocketPoolBaseHelper* pool);
- // Crash if |this| is an invalid object (for instance if it was deleted).
- // This code is being used to help track down http://crbug.com/109876.
- void CheckAlive();
-
std::list<IdleSocket> idle_sockets_;
std::set<ConnectJob*> jobs_;
RequestQueue pending_requests_;
int active_socket_count_; // number of active sockets used by clients
// A factory to pin the backup_job tasks.
base::WeakPtrFactory<Group> weak_factory_;
-
- // Special value used to verify that |this| is not garbage memory.
- MagicToken liveness_token_;
-
- // This corresponds with the callstack where |this| was deleted from. If
- // the object was not deleted, then this corresponds with the allocation
- // callstack.
- base::debug::StackTrace destruction_callstack_;
};
typedef std::map<std::string, Group*> GroupMap;