summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 16:34:00 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 16:34:00 +0000
commit501dfc4cc7b3e9f40e4a1b589a7043b7503b38d0 (patch)
tree4c4eb92c138dc747515b376587a4e09b498c5cf3 /base
parent3c44df5b169f8e7617eeb02a167dced84a5c108a (diff)
downloadchromium_src-501dfc4cc7b3e9f40e4a1b589a7043b7503b38d0.zip
chromium_src-501dfc4cc7b3e9f40e4a1b589a7043b7503b38d0.tar.gz
chromium_src-501dfc4cc7b3e9f40e4a1b589a7043b7503b38d0.tar.bz2
Fix constness of StackTrace.
StackTrace's member functions should be const. BUG=none TEST=none Review URL: http://codereview.chromium.org/6831014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/debug/stack_trace.cc4
-rw-r--r--base/debug/stack_trace.h6
-rw-r--r--base/debug/stack_trace_posix.cc6
-rw-r--r--base/debug/stack_trace_win.cc4
4 files changed, 10 insertions, 10 deletions
diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
index 5be4c5c..7c44f7a 100644
--- a/base/debug/stack_trace.cc
+++ b/base/debug/stack_trace.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 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.
@@ -10,7 +10,7 @@ namespace debug {
StackTrace::~StackTrace() {
}
-const void *const *StackTrace::Addresses(size_t* count) {
+const void *const *StackTrace::Addresses(size_t* count) const {
*count = count_;
if (count_)
return trace_;
diff --git a/base/debug/stack_trace.h b/base/debug/stack_trace.h
index d8d792d..acc7223 100644
--- a/base/debug/stack_trace.h
+++ b/base/debug/stack_trace.h
@@ -39,13 +39,13 @@ class BASE_API StackTrace {
// Gets an array of instruction pointer values. |*count| will be set to the
// number of elements in the returned array.
- const void* const* Addresses(size_t* count);
+ const void* const* Addresses(size_t* count) const;
// Prints a backtrace to stderr
- void PrintBacktrace();
+ void PrintBacktrace() const;
// Resolves backtrace to symbols and write to stream.
- void OutputToStream(std::ostream* os);
+ void OutputToStream(std::ostream* os) const;
private:
// From http://msdn.microsoft.com/en-us/library/bb204633.aspx,
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index f1f5408..50ff113 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -105,7 +105,7 @@ void DemangleSymbols(std::string* text) {
// names and attach these. Otherwise just use raw addresses. Returns true
// if any symbol name is resolved. Returns false on error and *may* fill
// in |error_message| if an error message is available.
-bool GetBacktraceStrings(void **trace, int size,
+bool GetBacktraceStrings(void *const *trace, int size,
std::vector<std::string>* trace_strings,
std::string* error_message) {
bool symbolized = false;
@@ -161,7 +161,7 @@ StackTrace::StackTrace() {
count_ = std::max(backtrace(trace_, arraysize(trace_)), 0);
}
-void StackTrace::PrintBacktrace() {
+void StackTrace::PrintBacktrace() const {
#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
if (backtrace_symbols_fd == NULL)
return;
@@ -174,7 +174,7 @@ void StackTrace::PrintBacktrace() {
}
}
-void StackTrace::OutputToStream(std::ostream* os) {
+void StackTrace::OutputToStream(std::ostream* os) const {
#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
if (backtrace_symbols == NULL)
return;
diff --git a/base/debug/stack_trace_win.cc b/base/debug/stack_trace_win.cc
index f00017f..97376a2 100644
--- a/base/debug/stack_trace_win.cc
+++ b/base/debug/stack_trace_win.cc
@@ -174,11 +174,11 @@ StackTrace::StackTrace(EXCEPTION_POINTERS* exception_pointers) {
}
}
-void StackTrace::PrintBacktrace() {
+void StackTrace::PrintBacktrace() const {
OutputToStream(&std::cerr);
}
-void StackTrace::OutputToStream(std::ostream* os) {
+void StackTrace::OutputToStream(std::ostream* os) const {
SymbolContext* context = SymbolContext::GetInstance();
DWORD error = context->init_error();
if (error != ERROR_SUCCESS) {