blob: 3adc2c697f2b84c26283ac936783dfef762be601 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright (c) 2006-2008 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.
// This file provides support for basic in-memory tracing of short events. We
// keep a static circular buffer where we store the last traced events, so we
// can review the cache recent behavior should we need it.
#ifndef NET_DISK_CACHE_TRACE_H__
#define NET_DISK_CACHE_TRACE_H__
#include <string>
#include <vector>
#include "base/basictypes.h"
namespace disk_cache {
// Create and destroy the tracing buffer.
bool InitTrace(void);
void DestroyTrace(void);
// Simple class to handle the trace buffer lifetime.
class TraceObject {
public:
TraceObject() {
InitTrace();
}
~TraceObject() {
DestroyTrace();
}
private:
DISALLOW_EVIL_CONSTRUCTORS(TraceObject);
};
// Traces to the internal buffer.
void Trace(const char* format, ...);
} // namespace disk_cache
#endif // NET_DISK_CACHE_TRACE_H__
|