Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Issue 7244009: Helper functions for tracking stale TabContentsDelegate's. (Closed)

Created:
9 years, 6 months ago by cbentzel
Modified:
9 years, 6 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, Avi (use Gerrit), jam, brettw-cc_chromium.org
Visibility:
Public.

Description

Helper functions for tracking stale TabContentsDelegate's. BUG=85247 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=90359

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add base/logging #

Patch Set 3 : Style and destructor #

Total comments: 7

Patch Set 4 : Fixes #

Patch Set 5 : Another function reorder #

Patch Set 6 : reorder and compact set_delegate #

Patch Set 7 : Explicit constructor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -1 line) Patch
M content/browser/tab_contents/tab_contents.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/tab_contents/tab_contents.cc View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/tab_contents/tab_contents_delegate.h View 1 2 3 4 5 6 3 chunks +15 lines, -0 lines 0 comments Download
M content/browser/tab_contents/tab_contents_delegate.cc View 1 2 3 4 5 6 2 chunks +15 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
cbentzel
I'm wondering if we want something like this while tracking down crash causes.
9 years, 6 months ago (2011-06-23 18:15:22 UTC) #1
jam
I defer to Scott.
9 years, 6 months ago (2011-06-23 18:18:42 UTC) #2
sky
The bug is that TabContents delegate has been deleted. Unless I'm missing something I don't ...
9 years, 6 months ago (2011-06-23 18:20:08 UTC) #3
cbentzel
This will CHECK in the TabContentsDelegate destructor if any TabContents have it as the current ...
9 years, 6 months ago (2011-06-23 18:22:19 UTC) #4
cbentzel
For example, without your change I get base::debug::StackTrace::StackTrace() [0x7fb262a3cffe] logging::LogMessage::~LogMessage() [0x7fb262a6118e] TabContentsDelegate::~TabContentsDelegate() [0x7fb264ce3246] prerender::PrerenderContents::TabContentsDelegateImpl::~TabContentsDelegateImpl() [0x7fb263915734] ...
9 years, 6 months ago (2011-06-23 18:24:37 UTC) #5
sky
You're right, this is better. You need to Detach from ~TabContents too though. http://codereview.chromium.org/7244009/diff/1/content/browser/tab_contents/tab_contents_delegate.cc File ...
9 years, 6 months ago (2011-06-23 18:27:32 UTC) #6
tburkard
Yes I'm not sure of how people might use this... Might it be possible to ...
9 years, 6 months ago (2011-06-23 18:28:11 UTC) #7
cbentzel
Detaching in the destructor now. I'd normally change set_delegate to SetDelegate, but I wanted to ...
9 years, 6 months ago (2011-06-23 18:38:13 UTC) #8
sky
Not sure about test cases for TabContentsDelegate. There probably aren't, but feel free to add ...
9 years, 6 months ago (2011-06-23 18:51:27 UTC) #9
cbentzel
http://codereview.chromium.org/7244009/diff/2003/content/browser/tab_contents/tab_contents.cc File content/browser/tab_contents/tab_contents.cc (right): http://codereview.chromium.org/7244009/diff/2003/content/browser/tab_contents/tab_contents.cc#newcode222 content/browser/tab_contents/tab_contents.cc:222: set_delegate(NULL); On 2011/06/23 18:51:27, sky wrote: > You should ...
9 years, 6 months ago (2011-06-23 19:09:57 UTC) #10
sky
LGTM
9 years, 6 months ago (2011-06-23 19:44:47 UTC) #11
commit-bot: I haz the power
Change committed as 90359
9 years, 6 months ago (2011-06-24 11:43:33 UTC) #12
cbentzel
This triggered one ChromeOS stack trace on the main build bot, so I reverted for ...
9 years, 6 months ago (2011-06-24 12:13:02 UTC) #13
cbentzel
Also, instead of CHECK'ing that the set is empty, we could just go ahead and ...
9 years, 6 months ago (2011-06-24 12:17:14 UTC) #14
sky
I'm not opposed to set_delegate(NULL) in ~TabContentsDelegate. Other observers (TabContentsObserver for one) remove themselves in ...
9 years, 6 months ago (2011-06-24 15:37:37 UTC) #15
cbentzel
9 years, 6 months ago (2011-06-24 15:42:29 UTC) #16
Yeah, I agree. I will keep working on this in between memory sheriff
and meetings today.

On Fri, Jun 24, 2011 at 11:37 AM, Scott Violet <sky@chromium.org> wrote:
> I'm not opposed to set_delegate(NULL) in ~TabContentsDelegate. Other
> observers (TabContentsObserver for one) remove themselves in the
> destructor.
>
> Before we do that I would like to figure out who isn't probably
> cleaning up now. It may be indicative of another problem that we would
> be covering up.
>
>  -Scott
>
> On Fri, Jun 24, 2011 at 5:17 AM, Chris Bentzel <cbentzel@chromium.org> wrote:
>> Also, instead of CHECK'ing that the set is empty, we could just go
>> ahead and change the TabContentsDelegate destructor to
>> set_delegate(NULL) on any attached TabContents. Not sure if that's the
>> preferable approach - if it is, this is more of a permanent change
>> than what I have now to help catch violators.
>>
>> On Fri, Jun 24, 2011 at 8:12 AM, Chris Bentzel <cbentzel@chromium.org> wrote:
>>> This triggered one ChromeOS stack trace on the main build bot, so I
>>> reverted for now. I'll run ChromeOS tries next time I try to land
>>> this.
>>>
>>>        base::debug::StackTrace::StackTrace() [0x16027ae]
>>>        logging::LogMessage::~LogMessage() [0x1621b8e]
>>>        TabContentsDelegate::~TabContentsDelegate() [0x37b798e]
>>>        chromeos::(anonymous
>>> namespace)::EnrollmentDomView::~EnrollmentDomView() [0x90b2d2]
>>>        views::View::~View() [0x1c415ae]
>>>        chromeos::EnterpriseEnrollmentView::~EnterpriseEnrollmentView()
[0x90b6a6]
>>>        chromeos::ViewScreen<>::~ViewScreen() [0x90a635]
>>>        chromeos::EnterpriseEnrollmentScreen::~EnterpriseEnrollmentScreen()
[0x909127]
>>>        scoped_ptr<>::~scoped_ptr() [0x94ec59]
>>>        chromeos::WizardController::~WizardController() [0x94c878]
>>>        scoped_ptr<>::~scoped_ptr() [0x90873b]
>>>        chromeos::BaseLoginDisplayHost::~BaseLoginDisplayHost() [0x90720b]
>>>        chromeos::ViewsLoginDisplayHost::~ViewsLoginDisplayHost() [0x946283]
>>>        DeleteTask<>::Run() [0x530ac6]
>>>        (anonymous namespace)::TaskClosureAdapter::Run() [0x1623e09]
>>>        base::internal::Invoker1<>::DoInvoke() [0x16279ce]
>>>        base::Callback<>::Run() [0x11561e9]
>>>        MessageLoop::RunTask() [0x162679f]
>>>        MessageLoop::DeferOrRunPendingTask() [0x16268d5]
>>>        MessageLoop::DoWork() [0x16270eb]
>>>        base::MessagePumpForUI::HandleDispatch() [0x1684ddd]
>>>        (anonymous namespace)::WorkSourceDispatch() [0x168427b]
>>>        0x2b44c71728c2
>>>        0x2b44c7176748
>>>        0x2b44c71768fc
>>>        base::MessagePumpForUI::RunOnce() [0x1684bc9]
>>>        base::MessagePumpForUI::RunWithDispatcher() [0x1684a62]
>>>        MessageLoop::RunInternal() [0x1626563]
>>>        MessageLoop::RunHandler() [0x1626446]
>>>        MessageLoopForUI::Run() [0x1627786]
>>>        ui_test_utils::RunMessageLoop() [0x15bfead]
>>>        ui_test_utils::RegisterAndWait() [0x15c1675]
>>>        ui_test_utils::WaitForNotification() [0x15c15de]
>>>        chromeos::WizardInProcessBrowserTest::CleanUpOnMainThread()
[0x530875]
>>>        InProcessBrowserTest::RunTestOnMainThreadLoop() [0x15b728d]
>>>        DispatchToMethod<>() [0x15b7a65]
>>>        RunnableMethod<>::Run() [0x15b79a8]
>>>        BrowserMain() [0x39eb397]
>>>        InProcessBrowserTest::SetUp() [0x15b6a91]
>>>        testing::internal::HandleSehExceptionsInMethodIfSupported<>()
[0x19cea43]
>>>        testing::internal::HandleExceptionsInMethodIfSupported<>()
[0x19cbfae]
>>>        testing::Test::Run() [0x19c1289]
>>>        testing::TestInfo::Run() [0x19c1b02]
>>>        testing::TestCase::Run() [0x19c21f8]
>>>        testing::internal::UnitTestImpl::RunAllTests() [0x19c6fcf]
>>>        testing::internal::HandleSehExceptionsInMethodIfSupported<>()
[0x19cf88f]
>>>        testing::internal::HandleExceptionsInMethodIfSupported<>()
[0x19cc79f]
>>>        testing::UnitTest::Run() [0x19c5aec]
>>>        base::TestSuite::Run() [0x16969b7]
>>>        main [0x7b0387]
>>>        0x2b44ca9f9c4d
>>>        0x436789
>>>
>>>
>>> On Fri, Jun 24, 2011 at 7:43 AM,  <commit-bot@chromium.org> wrote:
>>>> Change committed as 90359
>>>>
>>>> http://codereview.chromium.org/7244009/
>>>>
>>>
>>
>

Powered by Google App Engine
This is Rietveld 408576698