|
|
DescriptionReplace deprecated base::NonThreadSafe in chrome/browser/profiles.
Note to crash team: This CL is a refactor and has no intended behavior change.
This change was scripted by https://crbug.com/676387#c8.
Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request.
And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37.
BUG=676387
This CL was uploaded by git cl split.
R=bauerb@chromium.org
TBR=sorin, pauljensen
Review-Url: https://codereview.chromium.org/2907253003
Cr-Commit-Position: refs/heads/master@{#476684}
Committed: https://chromium.googlesource.com/chromium/src/+/99ff1d83a3574b1b689ad35d7a14688eee88f97a
Patch Set 1 #
Total comments: 2
Patch Set 2 : DCHECK_CURRENTLY_ON(UI) #Patch Set 3 : TestBrowserThreadBundle as first member in fixtures using TestingProfileManager #Patch Set 4 : more TestBrowserThreadBundle re-ordering #Patch Set 5 : back to ThreadChecker #Patch Set 6 : Android crashes?? Revert improvement to chrome_network_delegate_unittest.cc... #
Messages
Total messages: 61 (40 generated)
The CQ bit was checked by gab@chromium.org to run a CQ dry run
Hi, this is an automated change made by https://crbug.com/676387#c8 and sharded across directories for OWNERS. No human has looked at this specific output yet, see cl description for things to watch for. If it LGTY, please CQ. If it didn't pass CQ dry-run it may be a simple patch failure or an IWYU failure from having this being a partial CL... please review anyways and a human will look at the failure (and ping for re-review if anything major is required..). It is known to compile all targets on Windows at r474679... manual tweaks will likely be required to smoothen things off, bear with me! Thanks! Gab
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2907253003/diff/1/chrome/browser/profiles/pro... File chrome/browser/profiles/profile_manager.h (right): https://codereview.chromium.org/2907253003/diff/1/chrome/browser/profiles/pro... chrome/browser/profiles/profile_manager.h:429: SEQUENCE_CHECKER(sequence_checker_); I would get rid of this completely in favor of DCHECK_CURRENTLY_ON(BrowserThread::UI) (which is already used in some places anyway).
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles in favor of SequenceChecker. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Note-worthy for the reviewer: * SequenceChecker enforces thread-safety but not thread-affinity! If the classes that were updated are thread-affine (use thread local storage or a third-party API that does) they should be migrated to ThreadChecker instead. * ~NonThreadSafe() used to implcitly check in its destructor ~Sequence/ThreadChecker() doesn't by design. To keep this CL a no-op, an explicit check was added to the destructor of migrated classes. * NonThreadSafe used to provide access to subclasses, as such the |sequence_checker_| member was made protected rather than private where necessary. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org ==========
The CQ bit was checked by gab@chromium.org to run a CQ dry run
https://codereview.chromium.org/2907253003/diff/1/chrome/browser/profiles/pro... File chrome/browser/profiles/profile_manager.h (right): https://codereview.chromium.org/2907253003/diff/1/chrome/browser/profiles/pro... chrome/browser/profiles/profile_manager.h:429: SEQUENCE_CHECKER(sequence_checker_); On 2017/05/31 13:19:52, Bernhard Bauer wrote: > I would get rid of this completely in favor of > DCHECK_CURRENTLY_ON(BrowserThread::UI) (which is already used in some places > anyway). Done.
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
LGTM, thanks!
The CQ bit was unchecked by gab@chromium.org
The CQ bit was checked by gab@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by gab@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
gab@chromium.org changed reviewers: + pauljensen@chromium.org, sorin@chromium.org
TBR sorin for component_updater/ side-effects TBR pauljensen for net/ side-effects TestBrowserThreadBundle should generally be the first member of a test fixture and it not outliving TestProfilerManager was specifically causing issue in this CL.
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen ==========
The CQ bit was unchecked by gab@chromium.org
The CQ bit was checked by gab@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bauerb@chromium.org Link to the patchset: https://codereview.chromium.org/2907253003/#ps40001 (title: "TestBrowserThreadBundle as first member in fixtures using TestingProfileManager")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
lgtm component updater lgtm
The CQ bit was checked by gab@chromium.org to run a CQ dry run
The CQ bit was checked by gab@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bauerb@chromium.org, sorin@chromium.org Link to the patchset: https://codereview.chromium.org/2907253003/#ps60001 (title: "more TestBrowserThreadBundle re-ordering")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ==========
On 2017/05/31 18:57:30, gab wrote: > TBR sorin for component_updater/ side-effects > TBR pauljensen for net/ side-effects + TBR sdefresne for same nit in chrome\browser\history\android > > TestBrowserThreadBundle should generally be the first member of a test fixture > and it not outliving TestProfilerManager was specifically causing issue in this > CL.
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
I'm going to just use ThreadChecker which will provide the same properties NonThreadSafe previously did and leave it to the OWNERS to figure out how to turn this into BrowserThread::UI checks should that matter. This is making a much bigger mess than I expected per lacking TestBrowserThreadBundles... Basically this code in ChromeUnitTestSuiteInitializer::OnTestEnd(): // AsyncPolicyProvider is a lazily created KeyedService that may need to be // shut down here. However, AsyncPolicyProvider::Shutdown() will want to // post tasks to delete its policy loaders. This goes through // BrowserThreadTaskRunner::PostNonNestableDelayedTask(), which can invoke // LazyInstance<BrowserThreadGlobals>::Get() and try to create it for the // first time. It might be created during the test, but it might not (see // comments in TestingBrowserProcess::browser_policy_connector()). Since // creating BrowserThreadGlobals requires creating a SequencedWorkerPool, // and that needs a MessageLoop, make sure there is one here so that tests // don't get obscure errors. Tests can also invoke TestingBrowserProcess:: // DeleteInstance() themselves (after ensuring any TestingProfile instances // are deleted). But they shouldn't have to worry about that. DCHECK(!base::MessageLoop::current()); base::MessageLoopForUI message_loop; TestingBrowserProcess::DeleteInstance(); should probably be using a content::TestBrowserThreadBundle instead of a simpler base::MessageLoopForUI message_loop, but I don't know if that's right and won't do this as part of this mass refactor. Full stack caused by calling TestingBrowserProcess::DeleteInstance() here outside the main loop/fixture: [3724:1068:0601/073656.987:7256901:FATAL:profile_manager.cc(386)] Check failed: ::content::BrowserThread::CurrentlyOn(BrowserThread::UI). Must be called on Chrome_UIThread; actually called on Unknown Thread. Backtrace: base::debug::StackTrace::StackTrace [0x000000014305BB85+69] base::debug::StackTrace::StackTrace [0x000000014306DBA3+19] logging::LogMessage::~LogMessage [0x0000000142FAE77B+91] ProfileManager::~ProfileManager [0x000000014448D102+178] `anonymous namespace'::UnittestProfileManager::`scalar deleting destructor' [0x000000014448D2D4+20] TestingBrowserProcess::~TestingBrowserProcess [0x00000001426BDA69+649] TestingBrowserProcess::`scalar deleting destructor' [0x00000001426BDB04+20] TestingBrowserProcess::DeleteInstance [0x00000001426BDBD2+34] ChromeUnitTestSuite::InitializeResourceBundle [0x00000001426C08A9+457] testing::internal::TestEventRepeater::OnTestEnd [0x0000000141120C20+64] testing::TestInfo::Run [0x0000000141124173+227] testing::TestCase::Run [0x0000000141124015+165] testing::internal::UnitTestImpl::RunAllTests [0x00000001411244E2+562] testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,bool> [0x0000000141118E4D+61] testing::UnitTest::Run [0x0000000141124279+217] base::TestSuite::Run [0x00000001426CB5C9+137] base::LaunchUnitTests [0x00000001426CE52D+1021] base::LaunchUnitTests [0x00000001426CE197+103] main [0x0000000145A0A893+215] __scrt_common_main_seh [0x00000001459AB0C9+285] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253) BaseThreadInitThunk [0x00000000774859CD+13] RtlUserThreadStart [0x00000000775BA561+33]
The CQ bit was checked by gab@chromium.org to run a CQ dry run
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37 BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ==========
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Favored DCHECK_CURRENTLY_ON(UI) per reviewer request in the end. And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37 BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37 BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ==========
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37 BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request. And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ==========
The CQ bit was unchecked by gab@chromium.org
The CQ bit was checked by gab@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bauerb@chromium.org, sorin@chromium.org Link to the patchset: https://codereview.chromium.org/2907253003/#ps80001 (title: "back to ThreadChecker")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/06/01 20:53:31, gab wrote: > I'm going to just use ThreadChecker which will provide the same properties > NonThreadSafe previously did and leave it to the OWNERS to figure out how to > turn this into BrowserThread::UI checks should that matter. > > This is making a much bigger mess than I expected per lacking > TestBrowserThreadBundles... I'll leave the existing TestBrowserThreadBundle improvements in as they're more correct even though no longer explicitly required. Added a TODO to fix this in the name of chrome/browser/profiles/OWNERS. Thanks! > > Basically this code in ChromeUnitTestSuiteInitializer::OnTestEnd(): > > // AsyncPolicyProvider is a lazily created KeyedService that may need to be > // shut down here. However, AsyncPolicyProvider::Shutdown() will want to > // post tasks to delete its policy loaders. This goes through > // BrowserThreadTaskRunner::PostNonNestableDelayedTask(), which can invoke > // LazyInstance<BrowserThreadGlobals>::Get() and try to create it for the > // first time. It might be created during the test, but it might not (see > // comments in TestingBrowserProcess::browser_policy_connector()). Since > // creating BrowserThreadGlobals requires creating a SequencedWorkerPool, > // and that needs a MessageLoop, make sure there is one here so that tests > // don't get obscure errors. Tests can also invoke TestingBrowserProcess:: > // DeleteInstance() themselves (after ensuring any TestingProfile instances > // are deleted). But they shouldn't have to worry about that. > DCHECK(!base::MessageLoop::current()); > base::MessageLoopForUI message_loop; > TestingBrowserProcess::DeleteInstance(); > > should probably be using a content::TestBrowserThreadBundle instead of a simpler > base::MessageLoopForUI message_loop, but I don't know if that's right and won't > do this as part of this mass refactor. > > Full stack caused by calling TestingBrowserProcess::DeleteInstance() here > outside the main loop/fixture: > > [3724:1068:0601/073656.987:7256901:FATAL:profile_manager.cc(386)] Check failed: > ::content::BrowserThread::CurrentlyOn(BrowserThread::UI). Must be called on > Chrome_UIThread; actually called on Unknown Thread. > Backtrace: > base::debug::StackTrace::StackTrace [0x000000014305BB85+69] > base::debug::StackTrace::StackTrace [0x000000014306DBA3+19] > logging::LogMessage::~LogMessage [0x0000000142FAE77B+91] > ProfileManager::~ProfileManager [0x000000014448D102+178] > `anonymous namespace'::UnittestProfileManager::`scalar deleting destructor' > [0x000000014448D2D4+20] > TestingBrowserProcess::~TestingBrowserProcess [0x00000001426BDA69+649] > TestingBrowserProcess::`scalar deleting destructor' [0x00000001426BDB04+20] > TestingBrowserProcess::DeleteInstance [0x00000001426BDBD2+34] > ChromeUnitTestSuite::InitializeResourceBundle [0x00000001426C08A9+457] > testing::internal::TestEventRepeater::OnTestEnd [0x0000000141120C20+64] > testing::TestInfo::Run [0x0000000141124173+227] > testing::TestCase::Run [0x0000000141124015+165] > testing::internal::UnitTestImpl::RunAllTests [0x00000001411244E2+562] > testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,bool> > [0x0000000141118E4D+61] > testing::UnitTest::Run [0x0000000141124279+217] > base::TestSuite::Run [0x00000001426CB5C9+137] > base::LaunchUnitTests [0x00000001426CE52D+1021] > base::LaunchUnitTests [0x00000001426CE197+103] > main [0x0000000145A0A893+215] > __scrt_common_main_seh [0x00000001459AB0C9+285] > (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253) > BaseThreadInitThunk [0x00000000774859CD+13] > RtlUserThreadStart [0x00000000775BA561+33]
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by gab@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by gab@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bauerb@chromium.org, sorin@chromium.org Link to the patchset: https://codereview.chromium.org/2907253003/#ps100001 (title: "Android crashes?? Revert improvement to chrome_network_delegate_unittest.cc...")
gab@chromium.org changed reviewers: + sdefresne@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/06/01 14:13:10, gab wrote: > On 2017/05/31 18:57:30, gab wrote: > > TBR sorin for component_updater/ side-effects > > TBR pauljensen for net/ side-effects > > + TBR sdefresne for same nit in chrome\browser\history\android Oops, actually +sdefresne TBR > > > > > TestBrowserThreadBundle should generally be the first member of a test fixture > > and it not outliving TestProfilerManager was specifically causing issue in > this > > CL.
lgtm
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request. And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen, sdefresne ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request. And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen ==========
CQ is committing da patch. Bot data: {"patchset_id": 100001, "attempt_start_ts": 1496417451900060, "parent_rev": "6858b7fa2ae42b6c687589f39dd8c70509cb44ac", "commit_rev": "99ff1d83a3574b1b689ad35d7a14688eee88f97a"}
Message was sent while issue was closed.
Description was changed from ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request. And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen ========== to ========== Replace deprecated base::NonThreadSafe in chrome/browser/profiles. Note to crash team: This CL is a refactor and has no intended behavior change. This change was scripted by https://crbug.com/676387#c8. Then favored DCHECK_CURRENTLY_ON(UI) per reviewer request. And ultimately used ThreadChecker per https://codereview.chromium.org/2907253003/#msg37. BUG=676387 This CL was uploaded by git cl split. R=bauerb@chromium.org TBR=sorin, pauljensen Review-Url: https://codereview.chromium.org/2907253003 Cr-Commit-Position: refs/heads/master@{#476684} Committed: https://chromium.googlesource.com/chromium/src/+/99ff1d83a3574b1b689ad35d7a14... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/99ff1d83a3574b1b689ad35d7a14... |