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

Issue 2784483002: Add Darwin thread.h implementation. (Closed)

Created:
3 years, 8 months ago by kthelgason
Modified:
3 years, 8 months ago
Reviewers:
magjed_webrtc, tommi
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, qiang.lu, niklas.enbom, yujie_mao (webrtc), peah-webrtc, kjellander_webrtc
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Add Darwin thread.h implementation. Due to quirks of the Cocoa runtime several platform-specific fixes were in place. See the deleted files maccocoathreadhelper and scoped_autorelease_pool for examples. There is no way to do a stack-based RAII autoreleasepool that is compatible with ARC, and autoreleasepool blocks can't be used with c++. The solution was to separate out the implementation of some methods in thread.h to an ObjC++ file for Darwin platforms, allowing us to get rid of the helper classes and enable ARC everywhere. BUG=webrtc:6412 Review-Url: https://codereview.webrtc.org/2784483002 Cr-Commit-Position: refs/heads/master@{#17436} Committed: https://chromium.googlesource.com/external/webrtc/+/61abe1582915fb25fe3f231d7d2c9a174c0e3e6b

Patch Set 1 #

Total comments: 6

Patch Set 2 : rename cocoathread #

Total comments: 4

Patch Set 3 : also rename the file in BUILD.gn #

Patch Set 4 : Add clarifying comments #

Patch Set 5 : Make ThreadInit private to rtc::Thread #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -189 lines) Patch
M webrtc/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/base/BUILD.gn View 1 2 1 chunk +1 line, -4 lines 0 comments Download
D webrtc/base/maccocoathreadhelper.h View 1 chunk +0 lines, -27 lines 0 comments Download
D webrtc/base/maccocoathreadhelper.mm View 1 chunk +0 lines, -41 lines 0 comments Download
D webrtc/base/scoped_autorelease_pool.h View 1 chunk +0 lines, -59 lines 0 comments Download
D webrtc/base/scoped_autorelease_pool.mm View 1 chunk +0 lines, -25 lines 0 comments Download
M webrtc/base/thread.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M webrtc/base/thread.cc View 1 2 3 8 chunks +8 lines, -32 lines 0 comments Download
A webrtc/base/thread_darwin.mm View 1 2 3 1 chunk +93 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (8 generated)
kthelgason
3 years, 8 months ago (2017-03-28 13:39:43 UTC) #2
kthelgason
PTAL :) https://codereview.webrtc.org/2784483002/diff/1/webrtc/BUILD.gn File webrtc/BUILD.gn (left): https://codereview.webrtc.org/2784483002/diff/1/webrtc/BUILD.gn#oldcode36 webrtc/BUILD.gn:36: "NO_MAIN_THREAD_WRAPPING", This define is also in webrtc/base/BUILD.gn, ...
3 years, 8 months ago (2017-03-28 13:40:46 UTC) #3
tommi
https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/BUILD.gn File webrtc/base/BUILD.gn (right): https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/BUILD.gn#newcode547 webrtc/base/BUILD.gn:547: "cocoathread.mm", I wonder if we should call this file ...
3 years, 8 months ago (2017-03-28 13:59:01 UTC) #6
kthelgason
https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/BUILD.gn File webrtc/base/BUILD.gn (right): https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/BUILD.gn#newcode547 webrtc/base/BUILD.gn:547: "cocoathread.mm", On 2017/03/28 13:59:01, tommi (webrtc) wrote: > I ...
3 years, 8 months ago (2017-03-28 14:29:59 UTC) #9
tommi
https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/thread.h File webrtc/base/thread.h (right): https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/thread.h#newcode94 webrtc/base/thread.h:94: struct ThreadInit { On 2017/03/28 14:29:58, kthelgason wrote: > ...
3 years, 8 months ago (2017-03-28 14:38:56 UTC) #10
magjed_webrtc
https://codereview.webrtc.org/2784483002/diff/20001/webrtc/base/thread.cc File webrtc/base/thread.cc (right): https://codereview.webrtc.org/2784483002/diff/20001/webrtc/base/thread.cc#newcode460 webrtc/base/thread.cc:460: #if !defined(WEBRTC_MAC) Maybe add a comment that the implementation ...
3 years, 8 months ago (2017-03-28 14:41:15 UTC) #11
kthelgason
Thanks for the good comments. Fixed. https://codereview.webrtc.org/2784483002/diff/20001/webrtc/base/thread.cc File webrtc/base/thread.cc (right): https://codereview.webrtc.org/2784483002/diff/20001/webrtc/base/thread.cc#newcode460 webrtc/base/thread.cc:460: #if !defined(WEBRTC_MAC) On ...
3 years, 8 months ago (2017-03-28 14:50:21 UTC) #12
kthelgason
On 2017/03/28 14:38:56, tommi (webrtc) wrote: > https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/thread.h > File webrtc/base/thread.h (right): > > https://codereview.webrtc.org/2784483002/diff/1/webrtc/base/thread.h#newcode94 ...
3 years, 8 months ago (2017-03-28 16:07:21 UTC) #13
tommi
lgtm
3 years, 8 months ago (2017-03-28 22:29:17 UTC) #14
magjed_webrtc
lgtm
3 years, 8 months ago (2017-03-29 08:16:57 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2784483002/80001
3 years, 8 months ago (2017-03-29 08:29:31 UTC) #17
commit-bot: I haz the power
3 years, 8 months ago (2017-03-29 09:32:40 UTC) #20
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/external/webrtc/+/61abe1582915fb25fe3f231d7...

Powered by Google App Engine
This is Rietveld 408576698