Moved RtcEventLog files from call/ to logging/
The RtcEventLog headers need to be accessible from any place which needs
logging, and the implementation needs access to data structures that are
logged.
After a discussion in the code review, we all agreed to move the RtcEventLog implementation into its own top level directory - which I called "logging/" in expectation that other types of logging may have similar requirements. The directory contains two main build targets - "rtc_event_log_api", which is just rtc_event_log.h, that has no external dependencies and can be used from anywhere, and "rtc_event_log_impl" which contains the rest of the implementation and has many dependencies (more in the future).
The "api" target can be referenced from anywhere, while the "impl" target is only needed at the place of instantiation (currently Call, soon to be moved to PeerConnection by https://codereview.webrtc.org/2353033005/).
This change allows using RtcEventLog in the p2p/ directory, so that we
can log STUN pings and ICE state transitions.
BUG=webrtc:6393
R=kjellander@webrtc.org, kwiberg@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, terelius@webrtc.org
Review URL: https://codereview.webrtc.org/2380683005 .
Cr-Commit-Position: refs/heads/master@{#14485}
diff --git a/webrtc/logging/BUILD.gn b/webrtc/logging/BUILD.gn
new file mode 100644
index 0000000..7078963
--- /dev/null
+++ b/webrtc/logging/BUILD.gn
@@ -0,0 +1,100 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS. All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+
+import("../build/webrtc.gni")
+import("//third_party/protobuf/proto_library.gni")
+if (is_android) {
+ import("//build/config/android/config.gni")
+ import("//build/config/android/rules.gni")
+}
+
+rtc_source_set("rtc_event_log_api") {
+ sources = [
+ "rtc_event_log/rtc_event_log.h",
+ ]
+}
+
+rtc_static_library("rtc_event_log_impl") {
+ sources = [
+ "rtc_event_log/ringbuffer.h",
+ "rtc_event_log/rtc_event_log.cc",
+ "rtc_event_log/rtc_event_log_helper_thread.cc",
+ "rtc_event_log/rtc_event_log_helper_thread.h",
+ ]
+
+ defines = []
+
+ deps = [
+ ":rtc_event_log_api",
+ "..:webrtc_common",
+ "../modules/rtp_rtcp",
+ ]
+
+ if (rtc_enable_protobuf) {
+ defines += [ "ENABLE_RTC_EVENT_LOG" ]
+ deps += [ ":rtc_event_log_proto" ]
+ }
+ if (is_clang && !is_nacl) {
+ # Suppress warnings from Chrome's Clang plugins.
+ # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+}
+
+if (rtc_include_tests) {
+ rtc_source_set("rtc_event_log_tests") {
+ testonly = true
+ sources = [
+ "rtc_event_log/ringbuffer_unittest.cc",
+ "rtc_event_log/rtc_event_log_unittest.cc",
+ "rtc_event_log/rtc_event_log_unittest_helper.cc",
+ ]
+ deps = [
+ ":rtc_event_log_impl",
+ ":rtc_event_log_parser",
+ "../modules/rtp_rtcp",
+ "../system_wrappers:metrics_default",
+ "//testing/gmock",
+ "//testing/gtest",
+ ]
+ if (is_clang) {
+ # Suppress warnings from the Chromium Clang plugin.
+ # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+ }
+}
+
+if (rtc_enable_protobuf) {
+ proto_library("rtc_event_log_proto") {
+ sources = [
+ "rtc_event_log/rtc_event_log.proto",
+ ]
+ proto_out_dir = "webrtc/logging/rtc_event_log"
+ }
+}
+
+if (rtc_enable_protobuf) {
+ rtc_static_library("rtc_event_log_parser") {
+ sources = [
+ "rtc_event_log/rtc_event_log_parser.cc",
+ "rtc_event_log/rtc_event_log_parser.h",
+ ]
+
+ public_deps = [
+ ":rtc_event_log_proto",
+ "..:webrtc_common",
+ ]
+
+ if (is_clang && !is_nacl) {
+ # Suppress warnings from Chrome's Clang plugins.
+ # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+ }
+}