diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 16:10:28 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 16:10:28 +0000 |
commit | 48f65dde6736a55e4ab588491fcc0ec1987d7f29 (patch) | |
tree | 00be2a51151ac379dcb93e5ac5407d9cf3d030ee /chrome/browser/tabs | |
parent | 3528285f8451893839ce1084111e533f74546a53 (diff) | |
download | chromium_src-48f65dde6736a55e4ab588491fcc0ec1987d7f29.zip chromium_src-48f65dde6736a55e4ab588491fcc0ec1987d7f29.tar.gz chromium_src-48f65dde6736a55e4ab588491fcc0ec1987d7f29.tar.bz2 |
Removes debugging code that proved unnecessary.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/552005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 22 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.h | 24 |
2 files changed, 1 insertions, 45 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index d143c55..783e27c 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -59,7 +59,6 @@ TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile) } TabStripModel::~TabStripModel() { - LogEvent(DELETE_MODEL); STLDeleteContainerPointers(contents_data_.begin(), contents_data_.end()); delete order_controller_; } @@ -94,7 +93,6 @@ void TabStripModel::InsertTabContentsAt(int index, TabContents* contents, bool foreground, bool inherit_group) { - LogEvent(INSERT); // In tab dragging situations, if the last tab in the window was detached // then the user aborted the drag, we will have the |closing_all_| member // set (see DetachTabContentsAt) which will mess with our mojo here. We need @@ -134,7 +132,6 @@ void TabStripModel::InsertTabContentsAt(int index, void TabStripModel::ReplaceNavigationControllerAt( int index, NavigationController* controller) { - LogEvent(REPLACE); // This appears to be OK with no flicker since no redraw event // occurs between the call to add an aditional tab and one to close // the previous tab. @@ -149,15 +146,12 @@ TabContents* TabStripModel::DetachTabContentsAt(int index) { return NULL; DCHECK(ContainsIndex(index)); - LogEvent(DETACH); TabContents* removed_contents = GetContentsAt(index); next_selected_index_ = order_controller_->DetermineNewSelectedIndex(index); delete contents_data_.at(index); contents_data_.erase(contents_data_.begin() + index); - if (contents_data_.empty()) { - LogEvent(DETACH_EMPTY); + if (contents_data_.empty()) closing_all_ = true; - } TabStripModelObservers::Iterator iter(observers_); while (TabStripModelObserver* obs = iter.GetNext()) { obs->TabDetachedAt(removed_contents, index); @@ -185,7 +179,6 @@ void TabStripModel::SelectTabContentsAt(int index, bool user_gesture) { void TabStripModel::MoveTabContentsAt(int index, int to_position, bool select_after_move) { - LogEvent(MOVE); MoveTabContentsAtImpl(index, to_position, select_after_move, true); } @@ -229,7 +222,6 @@ void TabStripModel::UpdateTabContentsStateAt(int index, } void TabStripModel::CloseAllTabs() { - LogEvent(CLOSE_ALL); // Set state so that observers can adjust their behavior to suit this // specific condition when CloseTabContentsAt causes a flurry of // Close/Detach/Select notifications to be sent. @@ -355,8 +347,6 @@ void TabStripModel::SetTabPinned(int index, bool pinned) { if (contents_data_[index]->pinned == pinned) return; - LogEvent(PIN); - int first_non_pinned_tab = IndexOfFirstNonPinnedTab(); contents_data_[index]->pinned = pinned; @@ -490,7 +480,6 @@ void TabStripModel::MoveTabPrevious() { Browser* TabStripModel::TearOffTabContents(TabContents* detached_contents, const gfx::Rect& window_bounds, const DockInfo& dock_info) { - LogEvent(TEAR); DCHECK(detached_contents); return delegate_->CreateNewStripWithContents(detached_contents, window_bounds, dock_info); @@ -626,7 +615,6 @@ void TabStripModel::Observe(NotificationType type, // here so we don't crash later. int index = GetIndexOfTabContents(Source<TabContents>(source).ptr()); if (index != TabStripModel::kNoTab) { - LogEvent(TAB_DESTROYED); // Note that we only detach the contents here, not close it - it's already // been closed. We just want to undo our bookkeeping. DetachTabContentsAt(index); @@ -645,8 +633,6 @@ bool TabStripModel::IsNewTabAtEndOfTabStrip(TabContents* contents) const { bool TabStripModel::InternalCloseTabs(std::vector<int> indices, bool create_historical_tabs) { - LogEvent(CLOSE); - bool retval = true; // We only try the fast shutdown path if the whole browser process is *not* @@ -782,9 +768,3 @@ bool TabStripModel::OpenerMatches(const TabContentsData* data, bool use_group) { return data->opener == opener || (use_group && data->group == opener); } - -void TabStripModel::LogEvent(Event type) { - char c = 'a' + (int)type; - tracker_.Append(std::string(&c, 1)); - tracker_.Append(IntToString(count())); -} diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 19ea875..fe94524 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -8,7 +8,6 @@ #include <vector> #include "base/observer_list.h" -#include "chrome/browser/state_tracker.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/page_transition_types.h" @@ -283,9 +282,6 @@ class TabStripModel : public NotificationObserver { return order_controller_; } - // Returns the StateTracker. This never returns null. - StateTracker* tracker() { return &tracker_; } - // Returns true if |observer| is in the list of observers. This is intended // for debugging. bool HasObserver(TabStripModelObserver* observer); @@ -553,24 +549,6 @@ class TabStripModel : public NotificationObserver { // be |opener|'s NavigationController. void SetOpenerForContents(TabContents* contents, TabContents* opener); - // In hopes of tracking a crash we're logging various events. These events - // are logged to tracker_ with the following characters. - enum Event { - INSERT = 0, // a - REPLACE, // b - DETACH, // c - DETACH_EMPTY, // d - MOVE, // e - CLOSE_ALL, // f - TEAR, // g - DELETE_MODEL, // h - CLOSE, // i - PIN, // j - TAB_DESTROYED // k - }; - - void LogEvent(Event type); - // Returns true if the tab represented by the specified data has an opener // that matches the specified one. If |use_group| is true, then this will // fall back to check the group relationship as well. @@ -668,8 +646,6 @@ class TabStripModel : public NotificationObserver { // A scoped container for notification registries. NotificationRegistrar registrar_; - StateTracker tracker_; - DISALLOW_COPY_AND_ASSIGN(TabStripModel); }; |