| 
    
      
  | 
  
 Chromium Code Reviews| 
         Created: 
          4 years, 4 months ago by Ken Rockot(use gerrit already) Modified: 
          4 years, 4 months ago Reviewers: 
          
          jam CC: 
          
          
          chromium-reviews, darin-cc_chromium.org, jam Base URL: 
          
          
          https://chromium.googlesource.com/chromium/src.git@master Target Ref: 
          
          
          refs/pending/heads/master Project: 
          
          chromium Visibility: 
          
          
          
        Public.  | 
      
        
  DescriptionEnsure BrowserThread::CurrentlyOn is correct through MessageLoop teardown
Changes BrowserThread::CurrentlyOn (and thus
BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report
a BrowserThread's association during MessageLoop destruction notification.
Also adds an explicit Start() to BrowserThreadImpl as there are tests which
call it and which incorrectly assumed base::Thread's implementation would
call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter
is not a virtual function.)
This change provokes many tests to delete ExtensionFunction instances that
were otherwise being leaked because UIThreadExtensionFunction::Destroy was
incorrectly deferring destruction when run on the UI thread during shutdown.
This in turn revealed a few small bugs which have also been fixed here.
BUG=631093
R=jam@chromium.org
Committed: https://crrev.com/b02da29fb9116d1a1fb4fd0476628f333ff6bd1a
Committed: https://crrev.com/48a6aacd388c57b77d037e21bffe64a0c8c78b39
Cr-Original-Commit-Position: refs/heads/master@{#408295}
Cr-Commit-Position: refs/heads/master@{#408411}
   
  Patch Set 1 #Patch Set 2 : . #Patch Set 3 : . #Patch Set 4 : . #Patch Set 5 : . #Patch Set 6 : fix TestBrowserThread weirdness #Patch Set 7 : . #Patch Set 8 : fix a few more TestBrowserThread uses #Patch Set 9 : fix that test for reals #Dependent Patchsets: Messages
    Total messages: 61 (47 generated)
     
  
  
 The CQ bit was checked by rockot@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 unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) 
 lgtm 
 The CQ bit was checked by rockot@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... 
 Description was changed from ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) BUG=631093 R=jam@chromium.org ========== to ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) This change provokes many tests to delete ExtensionFunction instances that were otherwise being leaked because UIThreadExtensionFunction::Destroy was incorrectly posting from the UI thread to the UI thread instead of destroying immediately. This in turn revealed a few bugs which have been fixed here. BUG=631093 R=jam@chromium.org ========== 
 Description was changed from ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) This change provokes many tests to delete ExtensionFunction instances that were otherwise being leaked because UIThreadExtensionFunction::Destroy was incorrectly posting from the UI thread to the UI thread instead of destroying immediately. This in turn revealed a few bugs which have been fixed here. BUG=631093 R=jam@chromium.org ========== to ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) This change provokes many tests to delete ExtensionFunction instances that were otherwise being leaked because UIThreadExtensionFunction::Destroy was incorrectly deferring destruction when run on the UI thread during shutdown. This in turn revealed a few small bugs which have also been fixed here. BUG=631093 R=jam@chromium.org ========== 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) 
 The CQ bit was checked by rockot@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 rockot@chromium.org to run a CQ dry run 
 Patchset #3 (id:40001) has been deleted 
 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: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) 
 The CQ bit was checked by rockot@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 rockot@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 unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...) 
 Taking longer than expected to land this. Apparently unit_tests on Android heavily relies on this being broken, though I can't repro any of the failures locally... 
 The CQ bit was checked by rockot@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 unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...) chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) 
 The CQ bit was checked by rockot@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 rockot@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 unchecked by rockot@chromium.org 
 The CQ bit was checked by rockot@chromium.org 
 The patchset sent to the CQ was uploaded after l-g-t-m from jam@chromium.org Link to the patchset: https://codereview.chromium.org/2180253003/#ps140001 (title: ".") 
 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: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) 
 The CQ bit was checked by rockot@chromium.org 
 The patchset sent to the CQ was uploaded after l-g-t-m from jam@chromium.org Link to the patchset: https://codereview.chromium.org/2180253003/#ps160001 (title: "fix a few more TestBrowserThread uses") 
 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_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) 
 The CQ bit was checked by rockot@chromium.org 
 CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Committed patchset #8 (id:160001) 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Description was changed from ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) This change provokes many tests to delete ExtensionFunction instances that were otherwise being leaked because UIThreadExtensionFunction::Destroy was incorrectly deferring destruction when run on the UI thread during shutdown. This in turn revealed a few small bugs which have also been fixed here. BUG=631093 R=jam@chromium.org ========== to ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) This change provokes many tests to delete ExtensionFunction instances that were otherwise being leaked because UIThreadExtensionFunction::Destroy was incorrectly deferring destruction when run on the UI thread during shutdown. This in turn revealed a few small bugs which have also been fixed here. BUG=631093 R=jam@chromium.org Committed: https://crrev.com/b02da29fb9116d1a1fb4fd0476628f333ff6bd1a Cr-Commit-Position: refs/heads/master@{#408295} ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Patchset 8 (id:??) landed as https://crrev.com/b02da29fb9116d1a1fb4fd0476628f333ff6bd1a Cr-Commit-Position: refs/heads/master@{#408295} 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        A revert of this CL (patchset #8 id:160001) has been created in https://codereview.chromium.org/2186213002/ by rockot@chromium.org. The reason for reverting is: Test failures in the changes to the ComponentCloudPolicyTest. Doh.. 
 The CQ bit was checked by rockot@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 unchecked by commit-bot@chromium.org 
 Dry run: This issue passed the CQ dry run. 
 The CQ bit was checked by rockot@chromium.org 
 The patchset sent to the CQ was uploaded after l-g-t-m from jam@chromium.org Link to the patchset: https://codereview.chromium.org/2180253003/#ps180001 (title: "fix that test for reals") 
 CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Committed patchset #9 (id:180001) 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Description was changed from ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) This change provokes many tests to delete ExtensionFunction instances that were otherwise being leaked because UIThreadExtensionFunction::Destroy was incorrectly deferring destruction when run on the UI thread during shutdown. This in turn revealed a few small bugs which have also been fixed here. BUG=631093 R=jam@chromium.org Committed: https://crrev.com/b02da29fb9116d1a1fb4fd0476628f333ff6bd1a Cr-Commit-Position: refs/heads/master@{#408295} ========== to ========== Ensure BrowserThread::CurrentlyOn is correct through MessageLoop teardown Changes BrowserThread::CurrentlyOn (and thus BrowserThreadTaskRunner::RunsTasksOnCurrentThread()) to correctly report a BrowserThread's association during MessageLoop destruction notification. Also adds an explicit Start() to BrowserThreadImpl as there are tests which call it and which incorrectly assumed base::Thread's implementation would call BrowserThreadImpl::StartWithOptions (which it wouldn't since the latter is not a virtual function.) This change provokes many tests to delete ExtensionFunction instances that were otherwise being leaked because UIThreadExtensionFunction::Destroy was incorrectly deferring destruction when run on the UI thread during shutdown. This in turn revealed a few small bugs which have also been fixed here. BUG=631093 R=jam@chromium.org Committed: https://crrev.com/b02da29fb9116d1a1fb4fd0476628f333ff6bd1a Committed: https://crrev.com/48a6aacd388c57b77d037e21bffe64a0c8c78b39 Cr-Original-Commit-Position: refs/heads/master@{#408295} Cr-Commit-Position: refs/heads/master@{#408411} ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Patchset 9 (id:??) landed as https://crrev.com/48a6aacd388c57b77d037e21bffe64a0c8c78b39 Cr-Commit-Position: refs/heads/master@{#408411}  | 
    
