Commit graph

9 commits

Author SHA1 Message Date
Tommi
8d2c5a810f Detangling target dependencies in rtc_base_approved.
The eventual goal is to allow PlatformThread to use
SequencedTaskChecker, but getting to that point will require
some more detangling.

Here are (roughly) the steps taken in this CL:
* Make constructormagic a separate target.
* Move atomicops and arraysize to separate targets
* Move platform_thread_types to a separate target
* Move criticalsection to a separate target
* Move thread_checker to separate target
* Make sequenced_task_checker not depend on base_approved
* Move ptr_util to a separate target
* Move scoped_ptr to ptr_util
* Make rtc_task_queue_api not depend on base_approved
* Make sequenced_task_checker depend on rtc_task_queue_api
* Move rtc::Event to its own target
* Move basictypes.h to constructormagic
* Move format_macros and stringize_macros into constructormagic
* Rename constructormagic target to... macromagic
* Move stringencode to stringutils
* New target for safe_conversions
* Move timeutils to a new target.
* Move logging to a new target.
* Move platform_thread to a new target.
* Make refcount a new target (refcount, refcountedobject, refcounter).
* Remove rtc_base_approved from deps of TQ
* Remove a circular dependency between event tracer and platform thread.

Further steps will probably be to factor TaskQueue::Current() to not
be a part of the TaskQueue class itself and have it declared+implemented
in a target that's lower level than TQ itself. SequencedTaskChecker can
then depend on that target and avoid the TQ dependency. Once we're there,
PlatformThread will be able to depend on SequencedTaskChecker.

Attempted but eventually removed from this CL:
* Make TQ a part of rtc_base_approved
* Remove direct dependencies on sequenced_task_checker.
* Profit.

A few include-what-you-use updates along the way.
Fix a few targets that were depending on rtc_task_queue_api

Change-Id: Iee79aa2e81d978444c51b3005db9df7dc12d92a9
Bug: webrtc:8957
Reviewed-on: https://webrtc-review.googlesource.com/58480
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22487}
2018-03-19 11:02:01 +00:00
Tommi
1f3f3c2d19 Reland "Remove criticalsection.cc dependency on platform_thread.cc."
This is a reland of 5af97ee3ad.

What's changed from the original?
- Moved the #include for <process.h> for Fuchsia to the types header.

Original change's description:
> Remove criticalsection.cc dependency on platform_thread.cc.
>
> As part of this, I'm moving global thread related functions over to
> platform_thread_types.* and introducing platform_thread_types.cc
> for the implementation.
>
> Change-Id: I4624877fb379e77d215f4ecd60f20b06d8df3ce5
> Bug: webrtc:8893
> Reviewed-on: https://webrtc-review.googlesource.com/53940
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22037}

Bug: webrtc:8893
Change-Id: Idd0baa6756efd10ad11a5c6e4791eaa7a9dbc97f
Tbr: danilchap@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/54800
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22068}
2018-02-17 12:00:12 +00:00
Guido Urdaneta
08ff1733fb Revert "Remove criticalsection.cc dependency on platform_thread.cc."
This reverts commit 5af97ee3ad.

Reason for revert: Breaks chrome compilation on Fuchsia, preventing rolls.

Sample failed bot run: https://ci.chromium.org/buildbot/tryserver.chromium.linux/fuchsia_arm64/59693


Sample compiler error:
In file included from ../../third_party/webrtc/rtc_base/platform_thread_types.cc:11:
../../third_party/webrtc/rtc_base/platform_thread_types.h:30:9: error: unknown type name 'pthread_t'
typedef pthread_t PlatformThreadRef;
        ^
../../third_party/webrtc/rtc_base/platform_thread_types.cc:47:10: error: use of undeclared identifier 'pthread_self'; did you mean 'zx_thread_self'?
  return pthread_self();
         ^~~~~~~~~~~~
         zx_thread_self
../../third_party/fuchsia-sdk/sysroot/aarch64-fuchsia/include/zircon/process.h:21:13: note: 'zx_thread_self' declared here
zx_handle_t zx_thread_self(void);
            ^
../../third_party/webrtc/rtc_base/platform_thread_types.cc:55:10: error: use of undeclared identifier 'pthread_equal'
  return pthread_equal(a, b);
         ^


Original change's description:
> Remove criticalsection.cc dependency on platform_thread.cc.
> 
> As part of this, I'm moving global thread related functions over to
> platform_thread_types.* and introducing platform_thread_types.cc
> for the implementation.
> 
> Change-Id: I4624877fb379e77d215f4ecd60f20b06d8df3ce5
> Bug: webrtc:8893
> Reviewed-on: https://webrtc-review.googlesource.com/53940
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22037}

TBR=danilchap@webrtc.org,tommi@webrtc.org

Change-Id: I73cca942eedf804a0f3ed5a10f01135fbc6f275b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8893
Reviewed-on: https://webrtc-review.googlesource.com/54340
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22048}
2018-02-16 11:21:49 +00:00
Tommi
5af97ee3ad Remove criticalsection.cc dependency on platform_thread.cc.
As part of this, I'm moving global thread related functions over to
platform_thread_types.* and introducing platform_thread_types.cc
for the implementation.

Change-Id: I4624877fb379e77d215f4ecd60f20b06d8df3ce5
Bug: webrtc:8893
Reviewed-on: https://webrtc-review.googlesource.com/53940
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22037}
2018-02-15 16:46:35 +00:00
Wez
0614ed9d35 Remove calls to some POSIX APIs which Fuchsia does not implement.
Fuchsia's POSIX-lite does not provide the pthread priority nor file
locking APIs.

Bug: chromium:809201
Change-Id: I1efc5fe46909771e4934d91d2ed5f3e97c33444c
Reviewed-on: https://webrtc-review.googlesource.com/48860
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Wez <wez@google.com>
Cr-Commit-Position: refs/heads/master@{#21990}
2018-02-12 22:06:44 +00:00
Yura Yaroshevich
665d18ea29 Use sched_yield instead of nanosleep(0) for Android
Use sched_yield instead of nanosleep for Android inside
rtc::PlatformThread::Run to avoid slow nanosleep(0) issue
after app minimization on Android.

Bug: webrtc:8770
Change-Id: I51ae0ae370313beb38a5027b0633a4bd48381d5c
Reviewed-on: https://webrtc-review.googlesource.com/42200
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21772}
2018-01-26 11:07:16 +00:00
Sergey Ulanov
6acefdb70a Fixes to build WebRTC for Fuchsia
1. Added WEBRTC_FUCHSIA define.
2. Added PlatformThreadId typedef for Fuchsia.
3. Updated ifdefs for _strnicmp()/strncasecmd(), so _strnicmp()
   is used on all platforms
3. Updated ifdefs in clock.cc to avoid invalid assumption that
   POSIX = LINUX || MAC .

Bug: chromium:750940
Change-Id: Id7aa98e017f467bcebb78a0b298ba91655502072
Reviewed-on: https://webrtc-review.googlesource.com/31641
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21233}
2017-12-12 23:37:28 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/rtc_base/platform_thread.cc (Browse further)