| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "net/disk_cache/trace.h" | 5 #include "net/disk_cache/trace.h" | 
| 6 | 6 | 
| 7 #include <stdio.h> | 7 #include <stdio.h> | 
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) | 
| 9 #include <windows.h> | 9 #include <windows.h> | 
| 10 #endif | 10 #endif | 
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 114   char line[kEntrySize + 2]; | 114   char line[kEntrySize + 2]; | 
| 115 | 115 | 
| 116 #if defined(OS_WIN) | 116 #if defined(OS_WIN) | 
| 117   vsprintf_s(line, format, ap); | 117   vsprintf_s(line, format, ap); | 
| 118 #else | 118 #else | 
| 119   vsnprintf(line, kEntrySize, format, ap); | 119   vsnprintf(line, kEntrySize, format, ap); | 
| 120 #endif | 120 #endif | 
| 121 | 121 | 
| 122 #if defined(DISK_CACHE_TRACE_TO_LOG) | 122 #if defined(DISK_CACHE_TRACE_TO_LOG) | 
| 123   line[kEntrySize] = '\0'; | 123   line[kEntrySize] = '\0'; | 
| 124   LOG(INFO) << line; | 124   VLOG(0) << line; | 
| 125 #endif | 125 #endif | 
| 126 | 126 | 
| 127   va_end(ap); | 127   va_end(ap); | 
| 128 | 128 | 
| 129   { | 129   { | 
| 130     base::AutoLock lock(s_lock.Get()); | 130     base::AutoLock lock(s_lock.Get()); | 
| 131     if (!s_trace_buffer || !s_trace_enabled) | 131     if (!s_trace_buffer || !s_trace_enabled) | 
| 132       return; | 132       return; | 
| 133 | 133 | 
| 134     memcpy(s_trace_buffer->buffer[s_trace_buffer->current], line, kEntrySize); | 134     memcpy(s_trace_buffer->buffer[s_trace_buffer->current], line, kEntrySize); | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 183 void DestroyTrace(void) { | 183 void DestroyTrace(void) { | 
| 184   s_trace_object = NULL; | 184   s_trace_object = NULL; | 
| 185 } | 185 } | 
| 186 | 186 | 
| 187 void Trace(const char* format, ...) { | 187 void Trace(const char* format, ...) { | 
| 188 } | 188 } | 
| 189 | 189 | 
| 190 #endif  // ENABLE_TRACING | 190 #endif  // ENABLE_TRACING | 
| 191 | 191 | 
| 192 }  // namespace disk_cache | 192 }  // namespace disk_cache | 
| OLD | NEW | 
|---|