Skip to content

Commit

Permalink
jingle_glue: Add a NetworkService equivalent of ChromeAsyncSocket
Browse files Browse the repository at this point in the history
The former will have some problems with some proxy setups once the Network Service
is on, so this introduces a replacement. This CL doesn't hook it up to anything,
just builds & tests it. Next steps would require an equivalent to FakeSSLClientSocket,
and then actually hooking those up and wiring the different injected config from
Chrome.

To ease the review of this somewhat, this CL was split in two, with
https://chromium-review.googlesource.com/c/chromium/src/+/1237214
just copying over ChomeAsyncSocket and its tests to new files, to produce something of
a meaningful diff. (Thanks to lassey@ for the idea)

Bug: 875032
Change-Id: Ic5d4e4276c993e0e70f059d485b9d34aeab41e6d
Reviewed-on: https://chromium-review.googlesource.com/c/1232034
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604490}
  • Loading branch information
Maks Orlovich authored and Commit Bot committed Nov 1, 2018
1 parent ddde5a1 commit a1b1bcd
Show file tree
Hide file tree
Showing 7 changed files with 1,231 additions and 657 deletions.
19 changes: 16 additions & 3 deletions jingle/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ static_library("jingle_glue") {
sources = [
"glue/chrome_async_socket.cc",
"glue/chrome_async_socket.h",
"glue/network_service_async_socket.cc",
"glue/network_service_async_socket.h",
"glue/resolving_client_socket_factory.h",
"glue/task_pump.cc",
"glue/task_pump.h",
Expand All @@ -28,6 +30,7 @@ static_library("jingle_glue") {
"//base/third_party/dynamic_annotations",
"//net",
"//services/network:network_service",
"//services/network/public/mojom",
"//third_party/libjingle_xmpp:rtc_task_runner",
]

Expand All @@ -36,9 +39,13 @@ static_library("jingle_glue") {
if (is_nacl) {
sources -= [
"glue/chrome_async_socket.cc",
"glue/network_service_async_socket.cc",
"glue/xmpp_client_socket_factory.cc",
]
deps -= [ "//services/network:network_service" ]
deps -= [
"//services/network:network_service",
"//services/network/public/mojom",
]
}
}

Expand Down Expand Up @@ -117,8 +124,8 @@ static_library("notifier") {
"//base",
"//net",
"//third_party/expat",
"//url",
"//third_party/libjingle_xmpp:rtc_task_runner",
"//url",
]
}

Expand Down Expand Up @@ -151,6 +158,7 @@ test("jingle_unittests") {
"glue/logging_unittest.cc",
"glue/mock_task.cc",
"glue/mock_task.h",
"glue/network_service_async_socket_unittest.cc",
"glue/task_pump_unittest.cc",
"glue/thread_wrapper_unittest.cc",
"notifier/base/weak_xmpp_client_unittest.cc",
Expand All @@ -166,6 +174,7 @@ test("jingle_unittests") {
"notifier/listener/send_ping_task_unittest.cc",
"notifier/listener/xml_element_util_unittest.cc",
"notifier/listener/xmpp_push_client_unittest.cc",
"run_all_unittests.cc",
]

if (is_android || is_ios) {
Expand All @@ -174,6 +183,7 @@ test("jingle_unittests") {
# EXPECT_DEBUG_DEATH() uses features not enabled.
# Should we -std=c++0x or -std=gnu++0x?
"glue/chrome_async_socket_unittest.cc",
"glue/network_service_async_socket_unittest.cc",
"notifier/base/xmpp_connection_unittest.cc",
]
}
Expand All @@ -195,10 +205,13 @@ test("jingle_unittests") {
":notifier",
":notifier_test_util",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//mojo/core/embedder",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//net",
"//net:test_support",
"//services/network:network_service",
"//services/network:test_support",
"//testing/gmock",
"//testing/gtest",
Expand Down
1 change: 1 addition & 0 deletions jingle/DEPS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_rules = [
"+mojo/core/embedder",
"+net",
"+third_party/libjingle_xmpp/task_runner",
"+third_party/libjingle_xmpp/xmllite",
Expand Down
3 changes: 3 additions & 0 deletions jingle/glue/DEPS
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Needed by logging_unittest.cc since it tests the overrides.
include_rules = [
"+mojo/public/cpp",
"+services/network/proxy_resolving_client_socket.h",
"+services/network/proxy_resolving_client_socket_factory.h",
"+services/network/proxy_resolving_socket_factory_mojo.h",
"+services/network/public/mojom",
"+third_party/libjingle_xmpp/task_runner",
"+third_party/webrtc",
"+third_party/webrtc_overrides",
Expand Down
Loading

0 comments on commit a1b1bcd

Please sign in to comment.