diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 18:37:14 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 18:37:14 +0000 |
commit | a1660b5032541493766509f4e2835abc81541564 (patch) | |
tree | 57ba63a53bebc724d487abfcfdc6248665c1c8df /chrome/browser/state_tracker.cc | |
parent | 36f7e7bbb4ff17d46b2a2ed68c28301aad0eaebe (diff) | |
download | chromium_src-a1660b5032541493766509f4e2835abc81541564.zip chromium_src-a1660b5032541493766509f4e2835abc81541564.tar.gz chromium_src-a1660b5032541493766509f4e2835abc81541564.tar.bz2 |
Adds more debugging code in hopes of figuring out why on dragging the
tab strip model is empty, but not the tab strip. The latest crash data
indicates the tab strip is not closing all.
BUG=24132
TEST=none
Review URL: http://codereview.chromium.org/375017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/state_tracker.cc')
-rw-r--r-- | chrome/browser/state_tracker.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/state_tracker.cc b/chrome/browser/state_tracker.cc new file mode 100644 index 0000000..03af631 --- /dev/null +++ b/chrome/browser/state_tracker.cc @@ -0,0 +1,35 @@ +// Copyright (c) 2009 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. + +#include "chrome/browser/state_tracker.h" + +// Number of characters the buffer contains. +static const size_t kSize = 256; + +StateTracker::StateTracker() + : index_(0), + content_(new char[kSize]) { + for (size_t i = 0; i < kSize; ++i) + content_[i] = '\0'; +} + +void StateTracker::Append(const std::string& text) { + if (text.size() >= kSize) { + NOTREACHED(); + return; + } + for (size_t i = 0; i < text.size(); ++i) { + content_[index_] = text[i]; + index_ = (index_ + 1) % kSize; + } + content_[index_] = '!'; +} + +void StateTracker::Crash() { + volatile char state[kSize]; + for (size_t i = 0; i < kSize; ++i) + state[i] = content_[i]; + + CHECK(false); +} |