summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/memory_watcher/call_stack.cc8
-rw-r--r--tools/memory_watcher/call_stack.h6
-rw-r--r--tools/memory_watcher/memory_hook.cc4
-rw-r--r--tools/memory_watcher/memory_watcher.cc8
-rw-r--r--tools/memory_watcher/memory_watcher.h4
5 files changed, 15 insertions, 15 deletions
diff --git a/tools/memory_watcher/call_stack.cc b/tools/memory_watcher/call_stack.cc
index 15ca917..93d941e 100644
--- a/tools/memory_watcher/call_stack.cc
+++ b/tools/memory_watcher/call_stack.cc
@@ -71,7 +71,7 @@ static void UltraSafeDebugBreak() {
// static
bool CallStack::LoadDbgHelp() {
if (!dbghelp_loaded_) {
- AutoLock Lock(dbghelp_lock_);
+ base::AutoLock Lock(dbghelp_lock_);
// Re-check if we've loaded successfully now that we have the lock.
if (dbghelp_loaded_)
@@ -289,7 +289,7 @@ void CallStack::ToString(PrivateAllocatorString* output) {
return;
}
- AutoLock lock(dbghelp_lock_);
+ base::AutoLock lock(dbghelp_lock_);
// Iterate through each frame in the call stack.
for (int32 index = 0; index < frame_count_; index++) {
@@ -379,7 +379,7 @@ AllocationStack* AllocationStack::freelist_ = NULL;
void* AllocationStack::operator new(size_t size) {
DCHECK(size == sizeof(AllocationStack));
{
- AutoLock lock(freelist_lock_);
+ base::AutoLock lock(freelist_lock_);
if (freelist_ != NULL) {
AllocationStack* stack = freelist_;
freelist_ = freelist_->next_;
@@ -392,7 +392,7 @@ void* AllocationStack::operator new(size_t size) {
void AllocationStack::operator delete(void* ptr) {
AllocationStack *stack = reinterpret_cast<AllocationStack*>(ptr);
- AutoLock lock(freelist_lock_);
+ base::AutoLock lock(freelist_lock_);
DCHECK(stack->next_ == NULL);
stack->next_ = freelist_;
freelist_ = stack;
diff --git a/tools/memory_watcher/call_stack.h b/tools/memory_watcher/call_stack.h
index 12a0114..941aad4 100644
--- a/tools/memory_watcher/call_stack.h
+++ b/tools/memory_watcher/call_stack.h
@@ -17,8 +17,8 @@
#include <map>
#include <string>
-#include "base/lock.h"
#include "base/logging.h"
+#include "base/synchronization/lock.h"
#include "tools/memory_watcher/memory_watcher.h"
// The CallStack Class
@@ -110,7 +110,7 @@ class CallStack {
// dbghelp_lock_ is used to serialize access across all calls to the DbgHelp
// library. This may be overly conservative (serializing them all together),
// but does guarantee correctness.
- static Lock dbghelp_lock_;
+ static base::Lock dbghelp_lock_;
// Record the fact that dbghelp has been loaded.
// Changes to this variable are protected by dbghelp_lock_.
@@ -160,7 +160,7 @@ class AllocationStack : public CallStack {
AllocationStack* next_; // Pointer used when on the freelist.
int32 size_; // Size of block allocated.
static AllocationStack* freelist_;
- static Lock freelist_lock_;
+ static base::Lock freelist_lock_;
DISALLOW_COPY_AND_ASSIGN(AllocationStack);
};
diff --git a/tools/memory_watcher/memory_hook.cc b/tools/memory_watcher/memory_hook.cc
index 2340d84..0c0a05d 100644
--- a/tools/memory_watcher/memory_hook.cc
+++ b/tools/memory_watcher/memory_hook.cc
@@ -290,7 +290,7 @@ static LPVOID WINAPI Perftools_MapViewOfFileEx(HANDLE hFileMappingObject,
dwFileOffsetHigh, dwFileOffsetLow,
dwNumberOfBytesToMap, lpBaseAddress);
{
- AutoLock lock(known_maps_lock);
+ base::AutoLock lock(known_maps_lock);
MEMORY_BASIC_INFORMATION info;
if (known_maps.find(result) == known_maps.end()) {
CHECK(VirtualQuery(result, &info, sizeof(info)));
@@ -326,7 +326,7 @@ static DWORD WINAPI Perftools_NtUnmapViewOfSection(HANDLE process,
// than calling UnmapViewOfFile. If we didn't trap this function,
// then we appear to have bogus leaks.
{
- AutoLock lock(known_maps_lock);
+ base::AutoLock lock(known_maps_lock);
MEMORY_BASIC_INFORMATION info;
CHECK(VirtualQuery(lpBaseAddress, &info, sizeof(info)));
if (known_maps.find(lpBaseAddress) != known_maps.end()) {
diff --git a/tools/memory_watcher/memory_watcher.cc b/tools/memory_watcher/memory_watcher.cc
index 5ff8dae..29053f0 100644
--- a/tools/memory_watcher/memory_watcher.cc
+++ b/tools/memory_watcher/memory_watcher.cc
@@ -8,10 +8,10 @@
#include "tools/memory_watcher/memory_watcher.h"
#include "base/file_util.h"
-#include "base/lock.h"
#include "base/logging.h"
#include "base/metrics/stats_counters.h"
#include "base/string_util.h"
+#include "base/synchronization/lock.h"
#include "base/utf_string_conversions.h"
#include "tools/memory_watcher/call_stack.h"
#include "tools/memory_watcher/preamble_patcher.h"
@@ -107,7 +107,7 @@ void MemoryWatcher::OnTrack(HANDLE heap, int32 id, int32 size) {
if (!stack->Valid()) return; // Recursion blocked generation of stack.
{
- AutoLock lock(block_map_lock_);
+ base::AutoLock lock(block_map_lock_);
// Ideally, we'd like to verify that the block being added
// here is not already in our list of tracked blocks. However,
@@ -151,7 +151,7 @@ void MemoryWatcher::OnUntrack(HANDLE heap, int32 id, int32 size) {
return;
{
- AutoLock lock(block_map_lock_);
+ base::AutoLock lock(block_map_lock_);
active_thread_id_ = GetCurrentThreadId();
// First, find the block in our block_map.
@@ -197,7 +197,7 @@ void MemoryWatcher::DumpLeaks() {
return;
Unhook();
- AutoLock lock(block_map_lock_);
+ base::AutoLock lock(block_map_lock_);
active_thread_id_ = GetCurrentThreadId();
OpenLogFile();
diff --git a/tools/memory_watcher/memory_watcher.h b/tools/memory_watcher/memory_watcher.h
index 8cee2b80..8f5f1c2 100644
--- a/tools/memory_watcher/memory_watcher.h
+++ b/tools/memory_watcher/memory_watcher.h
@@ -14,7 +14,7 @@
#include <map>
#include <functional>
-#include "base/lock.h"
+#include "base/synchronization/lock.h"
#include "tools/memory_watcher/memory_hook.h"
class CallStack;
@@ -76,7 +76,7 @@ class MemoryWatcher : MemoryObserver {
// a stack track. Used to avoid recursive tracking.
DWORD active_thread_id_;
- Lock block_map_lock_;
+ base::Lock block_map_lock_;
// The block_map provides quick lookups based on the allocation
// pointer. This is important for having fast round trips through
// malloc/free.