| 
    
      
  | 
  
 Chromium Code Reviews| 
         Created: 
          5 years, 4 months ago by magjed_webrtc Modified: 
          
          
          5 years, 4 months ago CC: 
          
          
          webrtc-reviews_webrtc.org, tterriberry_mozilla.com Base URL: 
          
          
          https://chromium.googlesource.com/external/webrtc.git@master Target Ref: 
          
          
          refs/pending/heads/master Project: 
          
          webrtc Visibility: 
          
          
          
        Public.  | 
      
        
  Descriptionrtc::Bind: Capture method objects as scoped_refptr if they are ref counted
R=tommi@webrtc.org
Committed: https://chromium.googlesource.com/external/webrtc/+/d3de9c548d1121e7c4787a4b81fd66be714abc04
   
  Patch Set 1 #Patch Set 2 : landable patch #
      Total comments: 1
      
     
  
  Patch Set 3 : Support any AddRef()/Release() implementation #Patch Set 4 : Update bind.h.pump #
      Total comments: 9
      
     
  
  Patch Set 5 : Remove silly comment + address tommi@s comments #
 Messages
    Total messages: 31 (14 generated)
     
  
  
 The CQ bit was checked by magjed@webrtc.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/1300523004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1300523004/1 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: linux_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_rel/builds/8891) 
 magjed@webrtc.org changed reviewers: + tommi@webrtc.org 
 This is the simplest implementation that worked. The failing bots are unrelated to this CL. is_base_of implementation is copy-pasted. std::is_base_of is defined in C++11 and in std::tr1 namespace for C++03. Do you think this will be landable? 
 On 2015/08/18 17:45:55, magjed_webrtc wrote: > This is the simplest implementation that worked. The failing bots are unrelated > to this CL. is_base_of implementation is copy-pasted. std::is_base_of is defined > in C++11 and in std::tr1 namespace for C++03. Do you think this will be > landable? Yes I think so. Some documentation would be good. 
 The CQ bit was checked by magjed@webrtc.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/1300523004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1300523004/20001 
 I can use webrtc/base/template_util.h for doing the hardcore template magic. Please take a look. 
 tommi@chromium.org changed reviewers: + tommi@chromium.org 
 great - one question https://codereview.webrtc.org/1300523004/diff/20001/webrtc/base/bind.h File webrtc/base/bind.h (right): https://codereview.webrtc.org/1300523004/diff/20001/webrtc/base/bind.h#newcode86 webrtc/base/bind.h:86: static const bool value = is_convertible<T*, RefCountInterface*>::value; is there a way to detect presence of an AddRef() method instead of RefCountInterface? 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: android on tryserver.webrtc (JOB_TIMED_OUT, no build URL) 
 The CQ bit was checked by magjed@webrtc.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/1300523004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1300523004/40001 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: android_gn_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_gn_rel/builds/5143) win_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/win_rel/builds/9072) 
 The CQ bit was checked by magjed@webrtc.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/1300523004/70001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1300523004/70001 
 Patchset #4 (id:10002) has been deleted 
 Patchset #3 (id:40001) has been deleted 
 PTAL. It's working as you want now, i.e. using rtc::Bind(T, ...) on any type T that implemens AddRef() and Release() will be captured as scoped_refptr<T>. 
 one question, member variable naming, but otherwise looks great. https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind.h File webrtc/base/bind.h (right): https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind.h#newcode3 webrtc/base/bind.h:3: // DO NOT EDIT BY HAND!!! just checking - changes in this file are the result of running the script, right? :) https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind.h#newcode58 webrtc/base/bind.h:58: // bar = nullptr; good example https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest.cc File webrtc/base/bind_unittest.cc (right): https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest... webrtc/base/bind_unittest.cc:47: LifeTimeCheck(bool* hasDied) : hasDied_(hasDied), isOkToDie(false) {} has_died https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest... webrtc/base/bind_unittest.cc:56: bool* const hasDied_; has_died_ https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest... webrtc/base/bind_unittest.cc:57: bool isOkToDie; is_ok_to_die_ (or ok_to_die_?) 
 Patchset #5 (id:110001) has been deleted 
 The CQ bit was checked by magjed@webrtc.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/1300523004/130001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1300523004/130001 
 https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind.h File webrtc/base/bind.h (right): https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind.h#newcode3 webrtc/base/bind.h:3: // DO NOT EDIT BY HAND!!! On 2015/08/20 12:35:41, tommi (webrtc) wrote: > just checking - changes in this file are the result of running the script, > right? :) yep :) https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest.cc File webrtc/base/bind_unittest.cc (right): https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest... webrtc/base/bind_unittest.cc:47: LifeTimeCheck(bool* hasDied) : hasDied_(hasDied), isOkToDie(false) {} On 2015/08/20 12:35:41, tommi (webrtc) wrote: > has_died Done. https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest... webrtc/base/bind_unittest.cc:56: bool* const hasDied_; On 2015/08/20 12:35:41, tommi (webrtc) wrote: > has_died_ Done. https://codereview.webrtc.org/1300523004/diff/90001/webrtc/base/bind_unittest... webrtc/base/bind_unittest.cc:57: bool isOkToDie; On 2015/08/20 12:35:41, tommi (webrtc) wrote: > is_ok_to_die_ (or ok_to_die_?) Done. 
 lgtm 
 The CQ bit was unchecked by magjed@webrtc.org 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Committed patchset #5 (id:130001) manually as d3de9c548d1121e7c4787a4b81fd66be714abc04 (presubmit successful).  | 
    ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
