summaryrefslogtreecommitdiffstats
path: root/base/debug_util_posix.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-02 00:27:48 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-02 00:27:48 +0000
commita49437de9e757ffaf4e74f82686ee37b73950c6a (patch)
tree617e093be408d370fe19ad48c750dd2286bba5b5 /base/debug_util_posix.cc
parentb7d155f67aad56a2bab35339456fa10d1a2de13e (diff)
downloadchromium_src-a49437de9e757ffaf4e74f82686ee37b73950c6a.zip
chromium_src-a49437de9e757ffaf4e74f82686ee37b73950c6a.tar.gz
chromium_src-a49437de9e757ffaf4e74f82686ee37b73950c6a.tar.bz2
[GTK] delay reference count check in OwnedWidgetGtk
It's a common problem that a GtkWidget will be referenced by an event that's currently on the callstack. These ref holders ignore the "destroy" signal, so when we go to destroy the owned widget, the refcount == 1 DCHECK fails. This change delays that DCHECK until the current stack has unwound, so we don't have to keep running into this. BUG=none TEST=in debug builds, Escape in a constrained window doesn't DCHECK, dragging a tab doesn't cause a DCHECK, pressing the custom frame [x] in lucid doesn't DCHECK; in general, no additional DCHECKs Review URL: http://codereview.chromium.org/3416032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug_util_posix.cc')
-rw-r--r--base/debug_util_posix.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/debug_util_posix.cc b/base/debug_util_posix.cc
index 7d7aca4..7e74aef 100644
--- a/base/debug_util_posix.cc
+++ b/base/debug_util_posix.cc
@@ -312,3 +312,12 @@ void StackTrace::OutputToStream(std::ostream* os) {
(*os) << "\t" << trace_strings[i] << "\n";
}
}
+
+std::string StackTrace::AsString() {
+ std::vector<std::string> trace_strings;
+ std::string output;
+ GetBacktraceStrings(trace_, count_, &trace_strings, NULL);
+ for (size_t i = 0; i < trace_strings.size(); ++i)
+ output += "\t" + trace_strings[i] + "\n";
+ return output;
+}