| 
    
      
  | 
  
 Chromium Code Reviews| 
         Created: 
          4 years, 8 months ago by hiroshige Modified: 
          
          
          4 years, 7 months ago CC: 
          
          
          Mads Ager (chromium), ajuma+watch-canvas_chromium.org, blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, Rik, chromium-reviews, dglazkov+blink, dshwang, eae+blinkwatch, haraken, hongchan, Justin Novosad, kinuko+watch, kouhei+heap_chromium.org, oilpan-reviews, rwlbuis, Raymond Toy, sof Base URL: 
          
          
          https://chromium.googlesource.com/chromium/src.git@temp1912053002 Target Ref: 
          
          
          refs/pending/heads/master Project: 
          
          chromium Visibility: 
          
          
          
        Public.  | 
      
        
  DescriptionReplace threadSafeBind() + GCed pointers with CrossThreadPersistent
Disable GCed raw pointers in threadSafeBind(), use CrossThreadPersistent instead:
- Remove CrossThreadCopier for GCed raw pointers
- Introduce CrossThreadCopier for CrossThreadPersistent
- Apply wrapCrossThreadPersistent() to GCed raw pointers
BUG=597856
Committed: https://crrev.com/4a3b5f099c7831d163fbafde81f618b90736ceb4
Cr-Commit-Position: refs/heads/master@{#393555}
   
  Patch Set 1 #Patch Set 2 : Use crossThreadRetainedRef() #Patch Set 3 : Rebase #Patch Set 4 : auto-Rebase #Patch Set 5 : Rebase #
      Total comments: 4
      
     
  
  
 Depends on Patchset: Dependent Patchsets: Messages
    Total messages: 48 (26 generated)
     
  
  
 The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/1 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...) 
 Description was changed from ========== Disallow raw pointers in CrossThreadCopier/threadSafeBind() BUG= ========== to ========== Disallow raw pointers in CrossThreadCopier/threadSafeBind() BUG= ========== 
 The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/20001 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: This issue passed the CQ dry run. 
 Description was changed from ========== Disallow raw pointers in CrossThreadCopier/threadSafeBind() BUG= ========== to ========== Replace CrossThreadCopier/threadSafeBind() + GCed pointers with crossThreadRetainedRef() BUG= ========== 
 The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/40001 
 Description was changed from ========== Replace CrossThreadCopier/threadSafeBind() + GCed pointers with crossThreadRetainedRef() BUG= ========== to ========== Replace CrossThreadCopier/threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper BUG=597856 ========== 
 Description was changed from ========== Replace CrossThreadCopier/threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper BUG=597856 ========== to ========== Replace threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper BUG=597856 ========== 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...) 
 Description was changed from ========== Replace threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper BUG=597856 ========== to ========== Replace threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper In replacing, - all uses of threadSafeBind() + GCed pointers are detected by compile errors (due to lack of CrossThreadCopier), and - all uses of threadSafeBind() + crossThreadRetainedRef() are for GCed pointers (crossThreadRetainedRef() only accepts GCed pointers). BUG=597856 ========== 
 Description was changed from ========== Replace threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper In replacing, - all uses of threadSafeBind() + GCed pointers are detected by compile errors (due to lack of CrossThreadCopier), and - all uses of threadSafeBind() + crossThreadRetainedRef() are for GCed pointers (crossThreadRetainedRef() only accepts GCed pointers). BUG=597856 ========== to ========== Replace threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper In replacing, - All previous uses of threadSafeBind() + GCed pointers are detected by compile errors (due to lack of CrossThreadCopier), and - All current uses of threadSafeBind() + crossThreadRetainedRef() are for GCed pointers (crossThreadRetainedRef() only accepts GCed pointers). BUG=597856 ========== 
 The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/40001 
 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 hiroshige@chromium.org to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/60001 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) 
 The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/80001 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: This issue passed the CQ dry run. 
 Description was changed from ========== Replace threadSafeBind() + GCed pointers with crossThreadRetainedRef() Disable GCed raw pointers in threadSafeBind(), use crossThreadRetainedRef() instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadRetainedRefWrapper In replacing, - All previous uses of threadSafeBind() + GCed pointers are detected by compile errors (due to lack of CrossThreadCopier), and - All current uses of threadSafeBind() + crossThreadRetainedRef() are for GCed pointers (crossThreadRetainedRef() only accepts GCed pointers). BUG=597856 ========== to ========== Replace threadSafeBind() + GCed pointers with CrossThreadPersistent Disable GCed raw pointers in threadSafeBind(), use CrossThreadPersistent instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadPersistent - Apply wrapCrossThreadPersistent() to GCed raw pointers BUG=597856 ========== 
 hiroshige@chromium.org changed reviewers: + haraken@chromium.org, kinuko@chromium.org, tzik@chromium.org 
 PTAL. 
 LGTM https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp (right): https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp:207: Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&BlobCallback::handleEvent, wrapCrossThreadPersistent(m_callback.get()), nullptr)); Do we need get()? 
 lgtm 
 lgtm https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp (right): https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp:56: m_thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&AsyncAudioDecoder::decode, AllowCrossThreadAccess(audioData), sampleRate, wrapCrossThreadPersistent(successCallback), wrapCrossThreadPersistent(errorCallback), wrapCrossThreadPersistent(resolver), wrapCrossThreadPersistent(context))); If it's not too much work could we break lines for some of these looong lines? (Fine to keep as is in this patch too) 
 The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/100001 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...) 
 Patchset #6 (id:100001) has been deleted 
 https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp (right): https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp:207: Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&BlobCallback::handleEvent, wrapCrossThreadPersistent(m_callback.get()), nullptr)); On 2016/05/13 09:02:06, haraken wrote: > > Do we need get()? Yes, type of T* is currently needed for wrapCrossThreadPersistent() to deduce typename T. https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp (right): https://codereview.chromium.org/1904283004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp:56: m_thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&AsyncAudioDecoder::decode, AllowCrossThreadAccess(audioData), sampleRate, wrapCrossThreadPersistent(successCallback), wrapCrossThreadPersistent(errorCallback), wrapCrossThreadPersistent(resolver), wrapCrossThreadPersistent(context))); On 2016/05/13 09:27:27, kinuko wrote: > If it's not too much work could we break lines for some of these looong lines? > (Fine to keep as is in this patch too) I'll keep this as-is to make the changes mechanical as much as possible. 
 The CQ bit was checked by hiroshige@chromium.org 
 CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904283004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904283004/80001 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Description was changed from ========== Replace threadSafeBind() + GCed pointers with CrossThreadPersistent Disable GCed raw pointers in threadSafeBind(), use CrossThreadPersistent instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadPersistent - Apply wrapCrossThreadPersistent() to GCed raw pointers BUG=597856 ========== to ========== Replace threadSafeBind() + GCed pointers with CrossThreadPersistent Disable GCed raw pointers in threadSafeBind(), use CrossThreadPersistent instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadPersistent - Apply wrapCrossThreadPersistent() to GCed raw pointers BUG=597856 ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Committed patchset #5 (id:80001) 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Description was changed from ========== Replace threadSafeBind() + GCed pointers with CrossThreadPersistent Disable GCed raw pointers in threadSafeBind(), use CrossThreadPersistent instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadPersistent - Apply wrapCrossThreadPersistent() to GCed raw pointers BUG=597856 ========== to ========== Replace threadSafeBind() + GCed pointers with CrossThreadPersistent Disable GCed raw pointers in threadSafeBind(), use CrossThreadPersistent instead: - Remove CrossThreadCopier for GCed raw pointers - Introduce CrossThreadCopier for CrossThreadPersistent - Apply wrapCrossThreadPersistent() to GCed raw pointers BUG=597856 Committed: https://crrev.com/4a3b5f099c7831d163fbafde81f618b90736ceb4 Cr-Commit-Position: refs/heads/master@{#393555} ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Patchset 5 (id:??) landed as https://crrev.com/4a3b5f099c7831d163fbafde81f618b90736ceb4 Cr-Commit-Position: refs/heads/master@{#393555}  | 
    ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
