Do not build task_queue.cc and include from webrtc_overrides in Chrome.
This is step 2 of the plan below.
The modified plan
1. First land unmodified task_queue.h into webrtc_override in Chrome
2. Modify build files in the webrtc repo to include the task_queue.h and task_queue.cc from webrtc_overrides. This will breaks webrtc Chrome FYI.
3. Combine a roll of webrtc to Chrome and a the cl in https://codereview.chromium.org/2293913003/ into one cl.
The combined cl will roll in build files from 2 and add task_queue.cc in webrtc_overrides and build task_queue_unittest.cc as part of content_unittests to test task_queue.cc in webrtc_overrides.
4... Start using task queues in webrtc........
BUG=webrtc:5687
Review-Url: https://codereview.webrtc.org/2289203002
Cr-Commit-Position: refs/heads/master@{#13983}
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index 9d4aa4c..e166a4f 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -207,31 +207,41 @@
"sequenced_task_checker.h",
"sequenced_task_checker_impl.cc",
"sequenced_task_checker_impl.h",
- "task_queue.h",
- "task_queue_posix.h",
]
- if (rtc_build_libevent) {
- deps = [
- "//base/third_party/libevent",
- ]
- }
-
- if (rtc_enable_libevent) {
+ if (build_with_chromium) {
sources += [
- "task_queue_libevent.cc",
- "task_queue_posix.cc",
+ "../../webrtc_overrides/webrtc/base/task_queue.cc",
+ "../../webrtc_overrides/webrtc/base/task_queue.h",
]
- all_dependent_configs = [ ":enable_libevent_config" ]
+ include_dirs = [ "../../webrtc_overrides" ]
} else {
- if (is_mac || is_ios) {
- sources += [
- "task_queue_gcd.cc",
- "task_queue_posix.cc",
+ sources += [
+ "task_queue.h",
+ "task_queue_posix.h",
+ ]
+ if (rtc_build_libevent) {
+ deps = [
+ "//base/third_party/libevent",
]
}
- if (is_win) {
- sources += [ "task_queue_win.cc" ]
+
+ if (rtc_enable_libevent) {
+ sources += [
+ "task_queue_libevent.cc",
+ "task_queue_posix.cc",
+ ]
+ all_dependent_configs = [ ":enable_libevent_config" ]
+ } else {
+ if (is_mac || is_ios) {
+ sources += [
+ "task_queue_gcd.cc",
+ "task_queue_posix.cc",
+ ]
+ }
+ if (is_win) {
+ sources += [ "task_queue_win.cc" ]
+ }
}
}
}
diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp
index 52c4059..6e3b02e 100644
--- a/webrtc/base/base.gyp
+++ b/webrtc/base/base.gyp
@@ -149,37 +149,52 @@
'sequenced_task_checker.h',
'sequenced_task_checker_impl.cc',
'sequenced_task_checker_impl.h',
- 'task_queue.h',
- 'task_queue_posix.h',
],
'conditions': [
- ['build_libevent==1', {
- 'dependencies': [
- '<(DEPTH)/base/third_party/libevent/libevent.gyp:libevent',
+ ['build_with_chromium==1', {
+ 'include_dirs': [
+ '../../webrtc_overrides'
],
- }],
- ['enable_libevent==1', {
- 'sources': [
- 'task_queue_libevent.cc',
- 'task_queue_posix.cc',
+ 'sources' : [
+ '../../webrtc_overrides/webrtc/base/task_queue.cc',
+ '../../webrtc_overrides/webrtc/base/task_queue.h',
+ ]
+ } , {
+ # If not build for chromium, use our own implementation.
+ 'sources' : [
+ 'task_queue.h',
+ 'task_queue_posix.h',
],
- 'defines': [ 'WEBRTC_BUILD_LIBEVENT' ],
- 'all_dependent_settings': {
- 'defines': [ 'WEBRTC_BUILD_LIBEVENT' ]
- },
- }, {
- # If not libevent, fall back to the other task queues.
'conditions': [
- ['OS=="mac" or OS=="ios"', {
- 'sources': [
- 'task_queue_gcd.cc',
- 'task_queue_posix.cc',
- ],
+ ['build_libevent==1', {
+ 'dependencies': [
+ '<(DEPTH)/base/third_party/libevent/libevent.gyp:libevent',
+ ],
}],
- ['OS=="win"', {
- 'sources': [ 'task_queue_win.cc' ],
- }]
- ],
+ ['enable_libevent==1', {
+ 'sources': [
+ 'task_queue_libevent.cc',
+ 'task_queue_posix.cc',
+ ],
+ 'defines': [ 'WEBRTC_BUILD_LIBEVENT' ],
+ 'all_dependent_settings': {
+ 'defines': [ 'WEBRTC_BUILD_LIBEVENT' ]
+ },
+ }, {
+ # If not libevent, fall back to the other task queues.
+ 'conditions': [
+ ['OS=="mac" or OS=="ios"', {
+ 'sources': [
+ 'task_queue_gcd.cc',
+ 'task_queue_posix.cc',
+ ],
+ }],
+ ['OS=="win"', {
+ 'sources': [ 'task_queue_win.cc' ],
+ }]
+ ],
+ }],
+ ]
}],
],
},
diff --git a/webrtc/base/task_queue_unittest.cc b/webrtc/base/task_queue_unittest.cc
index db4e6c2..5cf3a63 100644
--- a/webrtc/base/task_queue_unittest.cc
+++ b/webrtc/base/task_queue_unittest.cc
@@ -253,9 +253,6 @@
EXPECT_GE(tasks_cleaned_up, tasks_executed);
EXPECT_EQ(kTaskCount, tasks_cleaned_up);
-
- LOG(INFO) << "tasks executed: " << tasks_executed
- << ", tasks cleaned up: " << tasks_cleaned_up;
}
} // namespace rtc