diff --git a/BUILD.gn b/BUILD.gn index 2d67eaa243befe..b42cb106811ebe 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -198,6 +198,7 @@ group("both_gn_and_gyp") { "//ui/display:display_unittests", "//ui/events:events_unittests", "//ui/gl:gl_unittests", + "//ui/latency_info:latency_info_unittests", "//ui/touch_selection:ui_touch_selection_unittests", "//url/ipc:url_ipc_unittests", ] diff --git a/build/all.gyp b/build/all.gyp index 1635f82a614a36..95d92562ca36fa 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -827,6 +827,7 @@ '../ui/android/ui_android.gyp:ui_android_unittests', '../ui/base/ui_base_tests.gyp:ui_base_unittests', '../ui/events/events_unittests.gyp:events_unittests', + '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests', # Unit test bundles packaged as an apk. '../base/base.gyp:base_unittests_apk', @@ -855,6 +856,7 @@ '../ui/events/events_unittests.gyp:events_unittests_apk', '../ui/gfx/gfx_tests.gyp:gfx_unittests_apk', '../ui/gl/gl_tests.gyp:gl_unittests_apk', + '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests_apk', ], 'conditions': [ @@ -1054,6 +1056,7 @@ '../ui/events/events_unittests.gyp:events_unittests', '../ui/gfx/gfx_tests.gyp:gfx_unittests', '../ui/gl/gl_tests.gyp:gl_unittests', + '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests', '../ui/views/views.gyp:views_unittests', '../url/url.gyp:url_unittests', @@ -1157,6 +1160,7 @@ '../ui/gfx/gfx_tests.gyp:gfx_unittests', '../ui/gl/gl_tests.gyp:gl_unittests', '../ui/keyboard/keyboard.gyp:keyboard_unittests', + '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests', '../url/url.gyp:url_unittests', ], @@ -1275,6 +1279,7 @@ '../ui/events/events.gyp:*', '../ui/gfx/gfx_tests.gyp:gfx_unittests', '../ui/gl/gl_tests.gyp:gl_unittests', + '../ui/latency_info/latency_info.gyp:*', '../ui/keyboard/keyboard.gyp:*', '../ui/snapshot/snapshot.gyp:snapshot_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests', diff --git a/cc/BUILD.gn b/cc/BUILD.gn index f1f05f5faa8568..984b76f6bc5d80 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn @@ -554,10 +554,10 @@ component("cc") { "//gpu", "//gpu/command_buffer/client:gles2_interface", "//media", - "//ui/events:events_base", "//ui/gfx", "//ui/gfx/geometry", "//ui/gl", + "//ui/latency_info", ] defines = [ "CC_IMPLEMENTATION=1" ] @@ -952,12 +952,12 @@ test("cc_unittests") { "//media", "//testing/gmock", "//testing/gtest", - "//ui/events:events_base", "//ui/gfx", "//ui/gfx:test_support", "//ui/gfx/geometry", "//ui/gl", "//ui/gl:test_support", + "//ui/latency_info", ] data_deps = [ diff --git a/cc/DEPS b/cc/DEPS index f1bdb3fc5b3868..934528631ab00a 100644 --- a/cc/DEPS +++ b/cc/DEPS @@ -15,7 +15,7 @@ include_rules = [ "+third_party/khronos/GLES2/gl2.h", "+third_party/khronos/GLES2/gl2ext.h", "+third_party/skia/include", - "+ui/events/latency_info.h", + "+ui/latency_info", "+ui/gfx", "+ui/gl", "-cc/blink", diff --git a/cc/cc.gyp b/cc/cc.gyp index 69ab83957d8b02..4e6a0d88c84c90 100644 --- a/cc/cc.gyp +++ b/cc/cc.gyp @@ -19,10 +19,10 @@ '<(DEPTH)/media/media.gyp:media', '<(DEPTH)/skia/skia.gyp:skia', '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite', - '<(DEPTH)/ui/events/events.gyp:events_base', '<(DEPTH)/ui/gfx/gfx.gyp:gfx', '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry', '<(DEPTH)/ui/gl/gl.gyp:gl', + "<(DEPTH)/ui/latency_info/latency_info.gyp:latency_info", ], 'variables': { 'optimize': 'max', @@ -667,9 +667,9 @@ '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '<(DEPTH)/gpu/gpu.gyp:gpu', '<(DEPTH)/skia/skia.gyp:skia', - '<(DEPTH)/ui/events/events.gyp:events_base', '<(DEPTH)/ui/gfx/gfx.gyp:gfx', '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry', + "<(DEPTH)/ui/latency_info/latency_info.gyp:latency_info", ], 'defines': [ 'CC_SURFACES_IMPLEMENTATION=1', diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index fb5d9876bb1f5e..b2aec9f17b4396 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -330,9 +330,9 @@ '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', '../third_party/protobuf/protobuf.gyp:protobuf_lite', - '../ui/events/events.gyp:events_base', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', + '../ui/latency_info/latency_info.gyp:latency_info', 'cc.gyp:cc', 'cc.gyp:cc_proto', 'cc.gyp:cc_surfaces', diff --git a/cc/output/compositor_frame_metadata.h b/cc/output/compositor_frame_metadata.h index 54b2047fcd6454..c73499dda852e2 100644 --- a/cc/output/compositor_frame_metadata.h +++ b/cc/output/compositor_frame_metadata.h @@ -13,9 +13,9 @@ #include "cc/output/viewport_selection_bound.h" #include "cc/surfaces/surface_id.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size_f.h" #include "ui/gfx/geometry/vector2d_f.h" +#include "ui/latency_info/latency_info.h" namespace cc { diff --git a/cc/output/latency_info_swap_promise.h b/cc/output/latency_info_swap_promise.h index 23a1c862afbc17..4b5915954d034c 100644 --- a/cc/output/latency_info_swap_promise.h +++ b/cc/output/latency_info_swap_promise.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "cc/output/swap_promise.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace cc { diff --git a/cc/surfaces/BUILD.gn b/cc/surfaces/BUILD.gn index 1c5ca5cc08578c..c64d96e5ed0620 100644 --- a/cc/surfaces/BUILD.gn +++ b/cc/surfaces/BUILD.gn @@ -55,9 +55,9 @@ component("surfaces") { "//gpu/command_buffer/client:gles2_interface", "//gpu/command_buffer/common", "//skia", - "//ui/events:events_base", "//ui/gfx", "//ui/gfx/geometry", + "//ui/latency_info", ] if (is_android && !is_debug) { diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h index cb8e898b5b4d6e..3ab9cefbe86820 100644 --- a/cc/surfaces/display.h +++ b/cc/surfaces/display.h @@ -18,7 +18,7 @@ #include "cc/surfaces/surface_id.h" #include "cc/surfaces/surface_manager.h" #include "cc/surfaces/surfaces_export.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace gpu { class GpuMemoryBufferManager; diff --git a/content/DEPS b/content/DEPS index 1d6f952b9ba7fd..f5efa16c8c09fd 100644 --- a/content/DEPS +++ b/content/DEPS @@ -81,6 +81,7 @@ include_rules = [ "+ui/events", "+ui/gfx", "+ui/gl", + "+ui/latency_info", "+ui/native_theme", "+ui/ozone/public", "+ui/resources/grit/ui_resources.h", diff --git a/content/browser/android/in_process/synchronous_input_event_filter.cc b/content/browser/android/in_process/synchronous_input_event_filter.cc index b4d9f7fa82b0e9..ff378b21dcfc9a 100644 --- a/content/browser/android/in_process/synchronous_input_event_filter.cc +++ b/content/browser/android/in_process/synchronous_input_event_filter.cc @@ -9,7 +9,7 @@ #include "content/browser/android/in_process/synchronous_compositor_registry_in_proc.h" #include "content/public/browser/browser_thread.h" #include "ui/events/blink/synchronous_input_handler_proxy.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" using blink::WebInputEvent; diff --git a/content/browser/compositor/image_transport_factory.h b/content/browser/compositor/image_transport_factory.h index 8a398bd8afd557..c334c80892eb9f 100644 --- a/content/browser/compositor/image_transport_factory.h +++ b/content/browser/compositor/image_transport_factory.h @@ -12,8 +12,8 @@ #include "build/build_config.h" #include "cc/surfaces/surface_id_allocator.h" #include "content/common/content_export.h" -#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" +#include "ui/latency_info/latency_info.h" namespace cc { class SurfaceManager; diff --git a/content/browser/compositor/software_browser_compositor_output_surface.cc b/content/browser/compositor/software_browser_compositor_output_surface.cc index 4413c4c3bfc2f2..1ceacaae0da0bb 100644 --- a/content/browser/compositor/software_browser_compositor_output_surface.cc +++ b/content/browser/compositor/software_browser_compositor_output_surface.cc @@ -16,8 +16,8 @@ #include "cc/output/output_surface_client.h" #include "cc/output/software_output_device.h" #include "content/browser/renderer_host/render_widget_host_impl.h" -#include "ui/events/latency_info.h" #include "ui/gfx/vsync_provider.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 2e30fecd9c44e2..fcf2ff3ac8957b 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -53,8 +53,8 @@ #include "ipc/message_filter.h" #include "media/base/media_switches.h" #include "ui/base/ui_base_switches.h" -#include "ui/events/latency_info.h" #include "ui/gl/gl_switches.h" +#include "ui/latency_info/latency_info.h" #if defined(OS_ANDROID) #include "base/android/build_info.h" diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc index 59b6d0055b995b..98003ce76adb6b 100644 --- a/content/browser/loader/resource_scheduler_unittest.cc +++ b/content/browser/loader/resource_scheduler_unittest.cc @@ -30,7 +30,7 @@ #include "net/url_request/url_request.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" using std::string; diff --git a/content/browser/renderer_host/input/non_blocking_event_browsertest.cc b/content/browser/renderer_host/input/non_blocking_event_browsertest.cc index 7711e2df48c878..1c3bd749fa9f21 100644 --- a/content/browser/renderer_host/input/non_blocking_event_browsertest.cc +++ b/content/browser/renderer_host/input/non_blocking_event_browsertest.cc @@ -27,7 +27,7 @@ #include "content/shell/browser/shell.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event_switches.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" using blink::WebInputEvent; diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker.h b/content/browser/renderer_host/input/render_widget_host_latency_tracker.h index 633e4e878da43b..2afffe8855ce47 100644 --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker.h +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker.h @@ -12,7 +12,7 @@ #include "base/macros.h" #include "content/browser/renderer_host/event_with_latency_info.h" #include "content/common/content_export.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc index e1fd3b06f31365..74abdc6d82400f 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc @@ -10,7 +10,7 @@ #include "content/common/input_messages.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" using blink::WebInputEvent; using blink::WebTouchEvent; diff --git a/content/browser/renderer_host/input/synthetic_pointer_action.cc b/content/browser/renderer_host/input/synthetic_pointer_action.cc index 6353f342631d0c..cb144b1bda33cb 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_action.cc +++ b/content/browser/renderer_host/input/synthetic_pointer_action.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/browser/renderer_host/input/synthetic_tap_gesture.cc b/content/browser/renderer_host/input/synthetic_tap_gesture.cc index 46dc23aeab4634..1242d8262fb36c 100644 --- a/content/browser/renderer_host/input/synthetic_tap_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_tap_gesture.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc index 3a317822b9c193..6fff6819e9ef6b 100644 --- a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc @@ -9,7 +9,7 @@ #include #include "base/logging.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc index 2c4ab954bec817..17516af107faee 100644 --- a/content/browser/renderer_host/input/touch_action_browsertest.cc +++ b/content/browser/renderer_host/input/touch_action_browsertest.cc @@ -32,7 +32,7 @@ #include "content/shell/browser/shell.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event_switches.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" using blink::WebInputEvent; diff --git a/content/browser/renderer_host/input/touch_input_browsertest.cc b/content/browser/renderer_host/input/touch_input_browsertest.cc index 7ff1dd067015b6..d374b2c54678a8 100644 --- a/content/browser/renderer_host/input/touch_input_browsertest.cc +++ b/content/browser/renderer_host/input/touch_input_browsertest.cc @@ -25,7 +25,7 @@ #include "content/shell/browser/shell.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event_switches.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" using blink::WebInputEvent; diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 43047c22be768b..7dfd14d417180b 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -43,8 +43,8 @@ #include "ui/base/ime/text_input_mode.h" #include "ui/base/ime/text_input_type.h" #include "ui/events/gesture_detection/gesture_provider_config_helper.h" -#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" +#include "ui/latency_info/latency_info.h" struct FrameHostMsg_HittestData_Params; struct ViewHostMsg_SelectionBounds_Params; diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index ee96ebc4de0a8e..fc115a824896ff 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn @@ -203,12 +203,12 @@ source_set("common") { "//ui/accessibility", "//ui/base", "//ui/base/ime", - "//ui/events/ipc", "//ui/gfx", "//ui/gfx/geometry", "//ui/gfx/ipc", "//ui/gfx/ipc/skia", "//ui/gl", + "//ui/latency_info/ipc", "//ui/shell_dialogs", "//url", "//url/ipc:url_ipc", diff --git a/content/common/accelerated_surface_buffers_swapped_params_mac.h b/content/common/accelerated_surface_buffers_swapped_params_mac.h index 71fb4ffd7774d2..a25a41a63ae65f 100644 --- a/content/common/accelerated_surface_buffers_swapped_params_mac.h +++ b/content/common/accelerated_surface_buffers_swapped_params_mac.h @@ -6,8 +6,8 @@ #define CONTENT_COMMON_ACCELERATED_SURFACE_BUFFERS_SWAPPED_PARAMS_MAC_H_ #include "ui/base/cocoa/remote_layer_api.h" -#include "ui/events/latency_info.h" #include "ui/gfx/mac/io_surface.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/common/gpu_host_messages.h b/content/common/gpu_host_messages.h index 0705be089559c4..d9c7846d8d42f1 100644 --- a/content/common/gpu_host_messages.h +++ b/content/common/gpu_host_messages.h @@ -20,10 +20,10 @@ #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_start.h" -#include "ui/events/ipc/latency_info_param_traits.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" +#include "ui/latency_info/ipc/latency_info_param_traits.h" #include "url/gurl.h" #include "url/ipc/url_param_traits.h" diff --git a/content/common/input/event_with_latency_info.h b/content/common/input/event_with_latency_info.h index 24742a3baeb0f5..553838764dfd59 100644 --- a/content/common/input/event_with_latency_info.h +++ b/content/common/input/event_with_latency_info.h @@ -5,7 +5,7 @@ #ifndef CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ #define CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" #include "content/common/input/web_input_event_traits.h" diff --git a/content/common/input/input_event.h b/content/common/input/input_event.h index 58485e13216e59..6f3dc1b81bca21 100644 --- a/content/common/input/input_event.h +++ b/content/common/input/input_event.h @@ -10,7 +10,7 @@ #include "base/macros.h" #include "content/common/content_export.h" #include "content/common/input/scoped_web_input_event.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace blink { class WebInputEvent; diff --git a/content/common/input/input_event_ack.h b/content/common/input/input_event_ack.h index 565b66f6461d28..f7510d967c778a 100644 --- a/content/common/input/input_event_ack.h +++ b/content/common/input/input_event_ack.h @@ -13,7 +13,7 @@ #include "content/common/input/did_overscroll_params.h" #include "content/common/input/input_event_ack_state.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/common/input_messages.h b/content/common/input_messages.h index e83a77bac4e471..2a4b5211da7ec1 100644 --- a/content/common/input_messages.h +++ b/content/common/input_messages.h @@ -27,13 +27,13 @@ #include "content/common/input/touch_action.h" #include "ipc/ipc_message_macros.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/events/ipc/latency_info_param_traits.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/vector2d_f.h" #include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" #include "ui/gfx/range/range.h" +#include "ui/latency_info/ipc/latency_info_param_traits.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 05375e0d1b849e..e1415e3ffa4588 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -63,6 +63,7 @@ '../ui/events/events.gyp:gesture_detection', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', + '../ui/latency_info/latency_info.gyp:latency_info', '../ui/resources/ui_resources.gyp:ui_resources', '../ui/snapshot/snapshot.gyp:snapshot', '../ui/surface/surface.gyp:surface', diff --git a/content/content_common.gypi b/content/content_common.gypi index 1ae5f116ac5cbe..a0441e60aac8c9 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -45,7 +45,7 @@ '../ui/accessibility/accessibility.gyp:ax_gen', '../ui/base/ime/ui_base_ime.gyp:ui_base_ime', '../ui/base/ui_base.gyp:ui_base', - '../ui/events/events.gyp:events_ipc', + '../ui/latency_info/latency_info.gyp:latency_info_ipc', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc', diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 00adfe550f21cb..4399cbb163269b 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -870,6 +870,7 @@ '../ui/events/events.gyp:events_test_support', '../ui/events/events.gyp:gesture_detection', '../ui/gfx/gfx.gyp:gfx_test_support', + '../ui/latency_info/latency_info.gyp:latency_info', '../ui/resources/ui_resources.gyp:ui_resources', '../ui/surface/surface.gyp:surface', '../url/url.gyp:url_lib', diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn index 75ea4c5810a32a..35fc15ea336f7c 100644 --- a/content/gpu/BUILD.gn +++ b/content/gpu/BUILD.gn @@ -56,9 +56,9 @@ source_set("gpu_sources") { "//media/mojo/services:application_factory", "//services/shell/public/interfaces", "//skia", - "//ui/events/ipc", "//ui/gfx/ipc", "//ui/gl", + "//ui/latency_info/ipc", ] if (mojo_media_host == "gpu") { diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 0fc10f6e202c9c..a76aa3020e40b3 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc @@ -59,7 +59,7 @@ #include "ui/events/gesture_detection/gesture_configuration.h" #include "ui/events/keycodes/dom/dom_code.h" #include "ui/events/keycodes/dom/keycode_converter.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" #include "ui/resources/grit/webui_resources.h" #if defined(USE_AURA) diff --git a/content/renderer/android/synchronous_compositor_proxy.cc b/content/renderer/android/synchronous_compositor_proxy.cc index 4b1eaca6d80e8d..a0d4daf7af4aeb 100644 --- a/content/renderer/android/synchronous_compositor_proxy.cc +++ b/content/renderer/android/synchronous_compositor_proxy.cc @@ -16,8 +16,8 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkImageInfo.h" #include "third_party/skia/include/core/SkRegion.h" -#include "ui/events/latency_info.h" #include "ui/gfx/skia_util.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/renderer/input/main_thread_event_queue.h b/content/renderer/input/main_thread_event_queue.h index 0eb2d147f8970e..02f7d8d65bce9d 100644 --- a/content/renderer/input/main_thread_event_queue.h +++ b/content/renderer/input/main_thread_event_queue.h @@ -12,7 +12,7 @@ #include "content/common/input/input_event_dispatch_type.h" #include "content/common/input/web_input_event_queue.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace content { diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc index e407428414bb72..7914eea0881383 100644 --- a/content/renderer/input/render_widget_input_handler.cc +++ b/content/renderer/input/render_widget_input_handler.cc @@ -26,8 +26,8 @@ #include "content/renderer/render_widget.h" #include "third_party/WebKit/public/platform/WebFloatPoint.h" #include "third_party/WebKit/public/platform/WebFloatSize.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point_conversions.h" +#include "ui/latency_info/latency_info.h" #if defined(OS_ANDROID) #include diff --git a/content/renderer/mus/BUILD.gn b/content/renderer/mus/BUILD.gn index c2d3f93d317d2c..326748f104cd6c 100644 --- a/content/renderer/mus/BUILD.gn +++ b/content/renderer/mus/BUILD.gn @@ -33,5 +33,6 @@ source_set("mus") { "//third_party/WebKit/public:blink", "//ui/events:events", "//ui/events:events_base", + "//ui/latency_info", ] } diff --git a/content/renderer/mus/compositor_mus_connection.cc b/content/renderer/mus/compositor_mus_connection.cc index 57cdb76d79c0e1..0ae3a84e54c01a 100644 --- a/content/renderer/mus/compositor_mus_connection.cc +++ b/content/renderer/mus/compositor_mus_connection.cc @@ -10,7 +10,7 @@ #include "content/renderer/mus/render_widget_mus_connection.h" #include "mojo/converters/blink/blink_input_events_type_converters.h" #include "mojo/converters/input_events/input_events_type_converters.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" namespace { diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index cc7ce3c5f9743b..d25ebf1af784a6 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -169,12 +169,12 @@ #include "third_party/icu/source/common/unicode/uscript.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/ui_base_switches_util.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/native_widget_types.h" +#include "ui/latency_info/latency_info.h" #include "url/url_constants.h" #include "v8/include/v8.h" diff --git a/gpu/gpu_ipc_client.gypi b/gpu/gpu_ipc_client.gypi index 6ca3c0e0683517..0aa890058bcfaf 100644 --- a/gpu/gpu_ipc_client.gypi +++ b/gpu/gpu_ipc_client.gypi @@ -8,11 +8,11 @@ '../ipc/ipc.gyp:ipc', '../third_party/khronos/khronos.gyp:khronos_headers', '../ui/base/ui_base.gyp:ui_base', - '../ui/events/events.gyp:events_base', - '../ui/events/events.gyp:events_ipc', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc', '../ui/gl/gl.gyp:gl', + '../ui/latency_info/latency_info.gyp:latency_info', + '../ui/latency_info/latency_info.gyp:latency_info_ipc', '../url/url.gyp:url_lib', '../url/ipc/url_ipc.gyp:url_ipc', ], diff --git a/gpu/gpu_ipc_common.gypi b/gpu/gpu_ipc_common.gypi index 9e9ea60cfcdd35..05e7c44b77e794 100644 --- a/gpu/gpu_ipc_common.gypi +++ b/gpu/gpu_ipc_common.gypi @@ -8,11 +8,10 @@ '../ipc/ipc.gyp:ipc', '../third_party/khronos/khronos.gyp:khronos_headers', '../ui/base/ui_base.gyp:ui_base', - '../ui/events/events.gyp:events_base', - '../ui/events/events.gyp:events_ipc', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc', '../ui/gl/gl.gyp:gl', + '../ui/latency_info/latency_info.gyp:latency_info_ipc', '../url/url.gyp:url_lib', '../url/ipc/url_ipc.gyp:url_ipc', ], diff --git a/gpu/gpu_ipc_service.gypi b/gpu/gpu_ipc_service.gypi index 8865814582eb60..8a8b636188d4e2 100644 --- a/gpu/gpu_ipc_service.gypi +++ b/gpu/gpu_ipc_service.gypi @@ -6,11 +6,10 @@ 'dependencies': [ '../base/base.gyp:base', '../ipc/ipc.gyp:ipc', - '../ui/events/events.gyp:events_base', - '../ui/events/events.gyp:events_ipc', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gl/gl.gyp:gl', + '../ui/latency_info/latency_info.gyp:latency_info_ipc', '../url/url.gyp:url_lib', ], 'include_dirs': [ diff --git a/gpu/ipc/client/BUILD.gn b/gpu/ipc/client/BUILD.gn index f77d1feb712037..2c0f88d41bca92 100644 --- a/gpu/ipc/client/BUILD.gn +++ b/gpu/ipc/client/BUILD.gn @@ -57,9 +57,9 @@ source_set("ipc_client_sources") { "//gpu/config:config_sources", "//gpu/ipc/common:ipc_common_sources", "//ipc", - "//ui/events/ipc", "//ui/gfx/ipc", "//ui/gl", + "//ui/latency_info/ipc", "//url/ipc:url_ipc", ] if (use_ozone) { diff --git a/gpu/ipc/client/DEPS b/gpu/ipc/client/DEPS index 45e1d3de6314d5..e90ac2eb903025 100644 --- a/gpu/ipc/client/DEPS +++ b/gpu/ipc/client/DEPS @@ -1,6 +1,5 @@ include_rules = [ "+base", "+ipc", - "+ui/events", - "+ui/base", + "+ui/latency_info", ] diff --git a/gpu/ipc/client/command_buffer_proxy_impl.h b/gpu/ipc/client/command_buffer_proxy_impl.h index 89347bf2910c7b..7a200deac8dc24 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.h +++ b/gpu/ipc/client/command_buffer_proxy_impl.h @@ -27,8 +27,8 @@ #include "gpu/command_buffer/common/gpu_memory_allocation.h" #include "gpu/gpu_export.h" #include "ipc/ipc_listener.h" -#include "ui/events/latency_info.h" #include "ui/gfx/swap_result.h" +#include "ui/latency_info/latency_info.h" struct GPUCommandBufferConsoleMessage; diff --git a/gpu/ipc/client/gpu_channel_host.h b/gpu/ipc/client/gpu_channel_host.h index be04133199c625..f2c27e1f852f59 100644 --- a/gpu/ipc/client/gpu_channel_host.h +++ b/gpu/ipc/client/gpu_channel_host.h @@ -27,10 +27,10 @@ #include "ipc/ipc_sync_channel.h" #include "ipc/message_filter.h" #include "ipc/message_router.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gl/gpu_preference.h" +#include "ui/latency_info/latency_info.h" class GURL; diff --git a/gpu/ipc/common/BUILD.gn b/gpu/ipc/common/BUILD.gn index c596e265f53656..2c31f72c8d331f 100644 --- a/gpu/ipc/common/BUILD.gn +++ b/gpu/ipc/common/BUILD.gn @@ -86,9 +86,9 @@ source_set("ipc_common_sources") { "//gpu/command_buffer/common:common_sources", "//gpu/config:config_sources", "//ipc", - "//ui/events/ipc", "//ui/gfx/ipc", "//ui/gl", + "//ui/latency_info/ipc", "//url/ipc:url_ipc", ] diff --git a/gpu/ipc/common/DEPS b/gpu/ipc/common/DEPS index 45e1d3de6314d5..04878b1405715a 100644 --- a/gpu/ipc/common/DEPS +++ b/gpu/ipc/common/DEPS @@ -1,6 +1,6 @@ include_rules = [ "+base", "+ipc", - "+ui/events", "+ui/base", + "+ui/latency_info", ] diff --git a/gpu/ipc/common/gpu_messages.h b/gpu/ipc/common/gpu_messages.h index 449d151c52965a..0e5ed72e3ab109 100644 --- a/gpu/ipc/common/gpu_messages.h +++ b/gpu/ipc/common/gpu_messages.h @@ -26,13 +26,13 @@ #include "gpu/ipc/common/surface_handle.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_message_macros.h" -#include "ui/events/ipc/latency_info_param_traits.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/swap_result.h" +#include "ui/latency_info/ipc/latency_info_param_traits.h" +#include "ui/latency_info/latency_info.h" #include "url/ipc/url_param_traits.h" #if defined(OS_ANDROID) diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn index 7f022f843982f5..9ad2c9cdf4bea9 100644 --- a/gpu/ipc/service/BUILD.gn +++ b/gpu/ipc/service/BUILD.gn @@ -46,10 +46,10 @@ source_set("ipc_service_sources") { public_deps = [ "//base", "//ipc", - "//ui/events:events_base", "//ui/gfx", "//ui/gfx/geometry", "//ui/gl", + "//ui/latency_info/ipc", "//url", ] deps = [ diff --git a/gpu/ipc/service/DEPS b/gpu/ipc/service/DEPS index 0461b20ed011c4..facf83edeb681d 100644 --- a/gpu/ipc/service/DEPS +++ b/gpu/ipc/service/DEPS @@ -2,6 +2,6 @@ include_rules = [ "+third_party/skia", "+ui/accelerated_widget_mac", "+ui/base", - "+ui/events", + "+ui/latency_info", "+ui/ozone", ] diff --git a/gpu/ipc/service/gpu_channel_manager_delegate.h b/gpu/ipc/service/gpu_channel_manager_delegate.h index 83f2dc11526aa4..803e0112186c85 100644 --- a/gpu/ipc/service/gpu_channel_manager_delegate.h +++ b/gpu/ipc/service/gpu_channel_manager_delegate.h @@ -10,8 +10,8 @@ #if defined(OS_MACOSX) #include "ui/base/cocoa/remote_layer_api.h" -#include "ui/events/latency_info.h" #include "ui/gfx/mac/io_surface.h" +#include "ui/latency_info/latency_info.h" #endif class GURL; diff --git a/gpu/ipc/service/gpu_command_buffer_stub.h b/gpu/ipc/service/gpu_command_buffer_stub.h index 9d176030f89485..3b4992b3197dad 100644 --- a/gpu/ipc/service/gpu_command_buffer_stub.h +++ b/gpu/ipc/service/gpu_command_buffer_stub.h @@ -27,12 +27,12 @@ #include "gpu/ipc/service/gpu_memory_manager.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/swap_result.h" #include "ui/gl/gl_surface.h" #include "ui/gl/gpu_preference.h" +#include "ui/latency_info/latency_info.h" #include "url/gurl.h" namespace gpu { diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h index e455cf004167d2..a8c46002896fdd 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.h +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h @@ -13,9 +13,9 @@ #include "gpu/ipc/service/gpu_command_buffer_stub.h" #include "gpu/ipc/service/image_transport_surface.h" #include "ui/base/cocoa/remote_layer_api.h" -#include "ui/events/latency_info.h" #include "ui/gl/gl_surface.h" #include "ui/gl/gpu_switching_observer.h" +#include "ui/latency_info/latency_info.h" @class CAContext; @class CALayer; diff --git a/gpu/ipc/service/pass_through_image_transport_surface.h b/gpu/ipc/service/pass_through_image_transport_surface.h index b63194a784160e..4c8f92731446a0 100644 --- a/gpu/ipc/service/pass_through_image_transport_surface.h +++ b/gpu/ipc/service/pass_through_image_transport_surface.h @@ -13,8 +13,8 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "gpu/ipc/service/image_transport_surface.h" -#include "ui/events/latency_info.h" #include "ui/gl/gl_surface.h" +#include "ui/latency_info/latency_info.h" namespace gpu { class GpuChannelManager; diff --git a/ui/events/BUILD.gn b/ui/events/BUILD.gn index 20b75f2cbdaea7..21eecf0b91a68b 100644 --- a/ui/events/BUILD.gn +++ b/ui/events/BUILD.gn @@ -54,8 +54,6 @@ component("events_base") { "keycodes/keyboard_code_conversion_win.cc", "keycodes/keyboard_code_conversion_win.h", "keycodes/keyboard_codes.h", - "latency_info.cc", - "latency_info.h", ] defines = [ "EVENTS_BASE_IMPLEMENTATION" ] @@ -151,6 +149,7 @@ component("events") { "//skia", "//ui/gfx", "//ui/gfx/geometry", + "//ui/latency_info", ] if (use_x11) { @@ -368,7 +367,6 @@ test("events_unittests") { "keycodes/dom/keycode_converter_unittest.cc", "keycodes/keyboard_code_conversion_unittest.cc", "keycodes/platform_key_map_win_unittest.cc", - "latency_info_unittest.cc", "platform/platform_event_source_unittest.cc", "scoped_target_handler_unittest.cc", "win/event_utils_win_unittest.cc", @@ -389,6 +387,7 @@ test("events_unittests") { "//ui/events/devices", "//ui/events/platform", "//ui/gfx:test_support", + "//ui/latency_info", ] if (!is_ios) { @@ -396,7 +395,6 @@ test("events_unittests") { "blink/input_handler_proxy_unittest.cc", "blink/input_scroll_elasticity_controller_unittest.cc", "gestures/blink/web_gesture_curve_impl_unittest.cc", - "ipc/latency_info_param_traits_unittest.cc", ] deps += [ "//cc", @@ -404,7 +402,6 @@ test("events_unittests") { "//third_party/WebKit/public:blink_headers", "//ui/events/blink", "//ui/events/gestures/blink", - "//ui/events/ipc", ] } diff --git a/ui/events/DEPS b/ui/events/DEPS index b273ae3319cc3d..8a186054731124 100644 --- a/ui/events/DEPS +++ b/ui/events/DEPS @@ -1,3 +1,4 @@ include_rules = [ "+ui/gfx", + "+ui/latency_info", ] diff --git a/ui/events/OWNERS b/ui/events/OWNERS index f14df80fd4864c..1c0edbda9e661f 100644 --- a/ui/events/OWNERS +++ b/ui/events/OWNERS @@ -1,7 +1,4 @@ sadrul@chromium.org -per-file latency_info*=tdresser@chromium.org -per-file latency_info*=jbauman@chromium.org -per-file latency_info*=miletus@chromium.org # If you're doing structural changes get a review from one of the OWNERS. per-file *.gyp*=* diff --git a/ui/events/blink/events_blink.gyp b/ui/events/blink/events_blink.gyp index 8b1b8fa4289f5d..c347d9be666209 100644 --- a/ui/events/blink/events_blink.gyp +++ b/ui/events/blink/events_blink.gyp @@ -15,6 +15,7 @@ '../../../cc/cc.gyp:cc', '../../../third_party/WebKit/public/blink_headers.gyp:blink_headers', '../../gfx/gfx.gyp:gfx_geometry', + '../../latency_info/latency_info.gyp:latency_info', '../events.gyp:events', '../events.gyp:gesture_detection', ], @@ -31,4 +32,4 @@ ], }, ], -} \ No newline at end of file +} diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc index 2d9eefbcdc93b6..bc494871089e4f 100644 --- a/ui/events/blink/input_handler_proxy.cc +++ b/ui/events/blink/input_handler_proxy.cc @@ -20,8 +20,8 @@ #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/blink/input_handler_proxy_client.h" #include "ui/events/blink/input_scroll_elasticity_controller.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point_conversions.h" +#include "ui/latency_info/latency_info.h" using blink::WebFloatPoint; using blink::WebFloatSize; diff --git a/ui/events/blink/input_handler_proxy_unittest.cc b/ui/events/blink/input_handler_proxy_unittest.cc index 2ef91cd7824aa0..729029b4b1d627 100644 --- a/ui/events/blink/input_handler_proxy_unittest.cc +++ b/ui/events/blink/input_handler_proxy_unittest.cc @@ -18,9 +18,9 @@ #include "third_party/WebKit/public/platform/WebPoint.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/blink/input_handler_proxy_client.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/scroll_offset.h" #include "ui/gfx/geometry/size_f.h" +#include "ui/latency_info/latency_info.h" using blink::WebActiveWheelFlingParameters; using blink::WebFloatPoint; diff --git a/ui/events/event.h b/ui/events/event.h index 5c1b108f1220b4..07416945c24ba4 100644 --- a/ui/events/event.h +++ b/ui/events/event.h @@ -20,9 +20,9 @@ #include "ui/events/gestures/gesture_types.h" #include "ui/events/keycodes/dom/dom_key.h" #include "ui/events/keycodes/keyboard_codes.h" -#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point_conversions.h" +#include "ui/latency_info/latency_info.h" namespace gfx { class Transform; diff --git a/ui/events/events.gyp b/ui/events/events.gyp index c8d994f5e4b7df..8c814d365d6295 100644 --- a/ui/events/events.gyp +++ b/ui/events/events.gyp @@ -66,8 +66,6 @@ 'keycodes/keyboard_code_conversion_x.cc', 'keycodes/keyboard_code_conversion_x.h', 'keycodes/keyboard_codes.h', - 'latency_info.cc', - 'latency_info.h', 'x/keysym_to_unicode.cc', 'x/keysym_to_unicode.h', ], @@ -100,6 +98,7 @@ '<(DEPTH)/skia/skia.gyp:skia', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', + '../latency_info/latency_info.gyp:latency_info', 'dom_keycode_converter', 'events_base', 'gesture_detection', @@ -300,24 +299,6 @@ }], ], }, - { - # GN version: //ui/events/ipc:events_ipc - 'target_name': 'events_ipc', - 'type': '<(component)', - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/ipc/ipc.gyp:ipc', - 'events_base', - ], - 'defines': [ - 'EVENTS_IPC_IMPLEMENTATION', - ], - 'sources': [ - 'ipc/latency_info_param_traits.cc', - 'ipc/latency_info_param_traits.h', - 'ipc/latency_info_param_traits_macros.h', - ], - }, { # GN version: //ui/events:test_support 'target_name': 'events_test_support', diff --git a/ui/events/events_unittests.gyp b/ui/events/events_unittests.gyp index f5a5d01c3e0f49..0665b339e7dbb3 100644 --- a/ui/events/events_unittests.gyp +++ b/ui/events/events_unittests.gyp @@ -26,7 +26,6 @@ 'events.gyp:dom_keycode_converter', 'events.gyp:events', 'events.gyp:events_base', - 'events.gyp:events_ipc', 'events.gyp:events_test_support', 'events.gyp:gesture_detection', 'events.gyp:gestures_blink', @@ -54,11 +53,9 @@ 'gestures/fling_curve_unittest.cc', 'gestures/gesture_provider_aura_unittest.cc', 'gestures/motion_event_aura_unittest.cc', - 'ipc/latency_info_param_traits_unittest.cc', 'keycodes/dom/keycode_converter_unittest.cc', 'keycodes/keyboard_code_conversion_unittest.cc', 'keycodes/platform_key_map_win_unittest.cc', - 'latency_info_unittest.cc', 'platform/platform_event_source_unittest.cc', 'scoped_target_handler_unittest.cc', 'win/event_utils_win_unittest.cc', diff --git a/ui/events/ipc/events_ipc_export.h b/ui/events/ipc/events_ipc_export.h deleted file mode 100644 index a02d669e17677f..00000000000000 --- a/ui/events/ipc/events_ipc_export.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_EVENTS_EVENTS_IPC_EXPORT_H_ -#define UI_EVENTS_EVENTS_IPC_EXPORT_H_ - -#if defined(COMPONENT_BUILD) -#if defined(WIN32) - -#if defined(EVENTS_IPC_IMPLEMENTATION) -#define EVENTS_IPC_EXPORT __declspec(dllexport) -#else -#define EVENTS_IPC_EXPORT __declspec(dllimport) -#endif // defined(EVENTS_IPC_IMPLEMENTATION) - -#else // defined(WIN32) -#if defined(EVENTS_IPC_IMPLEMENTATION) -#define EVENTS_IPC_EXPORT __attribute__((visibility("default"))) -#else -#define EVENTS_IPC_EXPORT -#endif -#endif - -#else // defined(COMPONENT_BUILD) -#define EVENTS_IPC_EXPORT -#endif - -#endif // UI_EVENTS_EVENTS_IPC_EXPORT_H_ diff --git a/ui/latency_info/BUILD.gn b/ui/latency_info/BUILD.gn new file mode 100644 index 00000000000000..ad8f8c1523fa45 --- /dev/null +++ b/ui/latency_info/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +component("latency_info") { + sources = [ + "latency_info.cc", + "latency_info.h", + "latency_info_export.h", + ] + + defines = [ "LATENCY_INFO_IMPLEMENTATION" ] + + deps = [ + "//base", + ] +} + +test("latency_info_unittests") { + sources = [ + "latency_info_unittest.cc", + ] + + deps = [ + ":latency_info", + "//base", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//testing/gmock", + "//testing/gtest", + ] + + if (!is_ios) { + sources += [ "ipc/latency_info_param_traits_unittest.cc" ] + deps += [ + "//ipc:test_support", + "//ui/latency_info/ipc", + ] + } +} diff --git a/ui/latency_info/OWNERS b/ui/latency_info/OWNERS new file mode 100644 index 00000000000000..b29cc1a125aded --- /dev/null +++ b/ui/latency_info/OWNERS @@ -0,0 +1 @@ +tdresser@chromium.org diff --git a/ui/events/ipc/BUILD.gn b/ui/latency_info/ipc/BUILD.gn similarity index 68% rename from ui/events/ipc/BUILD.gn rename to ui/latency_info/ipc/BUILD.gn index b6ccbf51d5fc10..411305da2e4be3 100644 --- a/ui/events/ipc/BUILD.gn +++ b/ui/latency_info/ipc/BUILD.gn @@ -2,21 +2,23 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/ui.gni") - component("ipc") { - output_name = "events_ipc" + output_name = "latency_info_ipc" sources = [ + "latency_info_ipc_export.h", "latency_info_param_traits.cc", "latency_info_param_traits.h", "latency_info_param_traits_macros.h", ] - defines = [ "EVENTS_IPC_IMPLEMENTATION" ] + defines = [ "LATENCY_INFO_IPC_IMPLEMENTATION" ] + + public_deps = [ + "//ui/latency_info", + ] deps = [ "//base", "//ipc", - "//ui/events:events_base", ] } diff --git a/ui/events/ipc/OWNERS b/ui/latency_info/ipc/OWNERS similarity index 58% rename from ui/events/ipc/OWNERS rename to ui/latency_info/ipc/OWNERS index 6732300c3a79d0..107c4012ed90de 100644 --- a/ui/events/ipc/OWNERS +++ b/ui/latency_info/ipc/OWNERS @@ -1,12 +1,13 @@ +# Changes to IPCs require a security review to avoid introducing +# new sandbox escapes. set noparent dcheng@chromium.org inferno@chromium.org jln@chromium.org jschuh@chromium.org kenrb@chromium.org +mkwst@chromium.org nasko@chromium.org palmer@chromium.org tsepez@chromium.org - -per-file *.gyp*=* -per-file BUILD.gn=* +wfh@chromium.org diff --git a/ui/latency_info/ipc/latency_info_ipc_export.h b/ui/latency_info/ipc/latency_info_ipc_export.h new file mode 100644 index 00000000000000..cf80d5fd463d64 --- /dev/null +++ b/ui/latency_info/ipc/latency_info_ipc_export.h @@ -0,0 +1,29 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_LATENCY_INFO_LATENCY_INFO_IPC_EXPORT_H_ +#define UI_LATENCY_INFO_LATENCY_INFO_IPC_EXPORT_H_ + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(LATENCY_INFO_IPC_IMPLEMENTATION) +#define LATENCY_INFO_IPC_EXPORT __declspec(dllexport) +#else +#define LATENCY_INFO_IPC_EXPORT __declspec(dllimport) +#endif // defined(LATENCY_INFO_IPC_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(LATENCY_INFO_IPC_IMPLEMENTATION) +#define LATENCY_INFO_IPC_EXPORT __attribute__((visibility("default"))) +#else +#define LATENCY_INFO_IPC_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define LATENCY_INFO_IPC_EXPORT +#endif + +#endif // UI_LATENCY_INFO_LATENCY_INFO_IPC_EXPORT_H_ diff --git a/ui/events/ipc/latency_info_param_traits.cc b/ui/latency_info/ipc/latency_info_param_traits.cc similarity index 77% rename from ui/events/ipc/latency_info_param_traits.cc rename to ui/latency_info/ipc/latency_info_param_traits.cc index a472307407a3d7..22785fcf03d995 100644 --- a/ui/events/ipc/latency_info_param_traits.cc +++ b/ui/latency_info/ipc/latency_info_param_traits.cc @@ -2,31 +2,31 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/events/ipc/latency_info_param_traits_macros.h" +#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" // Generate param traits write methods. #include "ipc/param_traits_write_macros.h" namespace IPC { -#undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#include "ui/events/ipc/latency_info_param_traits_macros.h" +#undef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" } // namespace IPC // Generate param traits read methods. #include "ipc/param_traits_read_macros.h" namespace IPC { -#undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#include "ui/events/ipc/latency_info_param_traits_macros.h" +#undef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" } // namespace IPC // Generate param traits log methods. #include "ipc/param_traits_log_macros.h" namespace IPC { -#undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#include "ui/events/ipc/latency_info_param_traits_macros.h" +#undef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" } // namespace IPC // Implemetation for ParamTraits. -#include "ui/events/ipc/latency_info_param_traits.h" +#include "ui/latency_info/ipc/latency_info_param_traits.h" namespace IPC { void ParamTraits::Write(base::Pickle* m, const param_type& p) { @@ -54,7 +54,7 @@ bool ParamTraits::Read(const base::Pickle* m, return false; for (size_t i = 0; i < input_coordinates_size; i++) { if (!ReadParam(m, iter, &input_coordinates)) - return false; + return false; if (!p->AddInputCoordinate(input_coordinates)) return false; } @@ -67,8 +67,7 @@ bool ParamTraits::Read(const base::Pickle* m, return true; } -void ParamTraits::Log(const param_type& p, - std::string* l) { +void ParamTraits::Log(const param_type& p, std::string* l) { LogParam(p.trace_name_, l); l->append(" "); LogParam(p.latency_components_, l); diff --git a/ui/events/ipc/latency_info_param_traits.h b/ui/latency_info/ipc/latency_info_param_traits.h similarity index 59% rename from ui/events/ipc/latency_info_param_traits.h rename to ui/latency_info/ipc/latency_info_param_traits.h index 9e11104341fc6d..4bfdc6ef4e1b4f 100644 --- a/ui/events/ipc/latency_info_param_traits.h +++ b/ui/latency_info/ipc/latency_info_param_traits.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_H_ -#define UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_H_ +#ifndef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_H_ +#define UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_H_ -#include "ui/events/ipc/events_ipc_export.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/ipc/latency_info_ipc_export.h" +#include "ui/latency_info/latency_info.h" namespace IPC { template <> -struct EVENTS_IPC_EXPORT ParamTraits { +struct LATENCY_INFO_IPC_EXPORT ParamTraits { typedef ui::LatencyInfo param_type; static void Write(base::Pickle* m, const param_type& p); static bool Read(const base::Pickle* m, @@ -20,4 +20,4 @@ struct EVENTS_IPC_EXPORT ParamTraits { }; } // namespace IPC -#endif // UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_H_ +#endif // UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_H_ diff --git a/ui/events/ipc/latency_info_param_traits_macros.h b/ui/latency_info/ipc/latency_info_param_traits_macros.h similarity index 66% rename from ui/events/ipc/latency_info_param_traits_macros.h rename to ui/latency_info/ipc/latency_info_param_traits_macros.h index 40bf73845b34a5..2539d92919935a 100644 --- a/ui/events/ipc/latency_info_param_traits_macros.h +++ b/ui/latency_info/ipc/latency_info_param_traits_macros.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#define UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#ifndef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#define UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ #include "ipc/ipc_message_macros.h" -#include "ui/events/ipc/events_ipc_export.h" -#include "ui/events/latency_info.h" +#include "ui/latency_info/ipc/latency_info_ipc_export.h" +#include "ui/latency_info/latency_info.h" #undef IPC_MESSAGE_EXPORT -#define IPC_MESSAGE_EXPORT EVENTS_IPC_EXPORT +#define IPC_MESSAGE_EXPORT LATENCY_INFO_IPC_EXPORT IPC_ENUM_TRAITS_MAX_VALUE(ui::LatencyComponentType, ui::LATENCY_COMPONENT_TYPE_LAST) @@ -26,4 +26,4 @@ IPC_STRUCT_TRAITS_BEGIN(ui::LatencyInfo::InputCoordinate) IPC_STRUCT_TRAITS_MEMBER(y) IPC_STRUCT_TRAITS_END() -#endif // UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#endif // UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ diff --git a/ui/events/ipc/latency_info_param_traits_unittest.cc b/ui/latency_info/ipc/latency_info_param_traits_unittest.cc similarity index 84% rename from ui/events/ipc/latency_info_param_traits_unittest.cc rename to ui/latency_info/ipc/latency_info_param_traits_unittest.cc index 69224dace99ac5..4a1f8dcfaf6be1 100644 --- a/ui/events/ipc/latency_info_param_traits_unittest.cc +++ b/ui/latency_info/ipc/latency_info_param_traits_unittest.cc @@ -7,8 +7,8 @@ #include "ipc/ipc_message_macros.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/events/ipc/latency_info_param_traits.h" -#include "ui/events/ipc/latency_info_param_traits_macros.h" +#include "ui/latency_info/ipc/latency_info_param_traits.h" +#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" namespace ui { @@ -20,13 +20,13 @@ TEST(LatencyInfoParamTraitsTest, Basic) { latency.AddLatencyNumber(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 1234, 100); latency.AddLatencyNumber(INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 1234, 0); - EXPECT_TRUE(latency.AddInputCoordinate( - LatencyInfo::InputCoordinate(100, 200))); - EXPECT_TRUE(latency.AddInputCoordinate( - LatencyInfo::InputCoordinate(101, 201))); + EXPECT_TRUE( + latency.AddInputCoordinate(LatencyInfo::InputCoordinate(100, 200))); + EXPECT_TRUE( + latency.AddInputCoordinate(LatencyInfo::InputCoordinate(101, 201))); // Up to 2 InputCoordinate is allowed. - EXPECT_FALSE(latency.AddInputCoordinate( - LatencyInfo::InputCoordinate(102, 202))); + EXPECT_FALSE( + latency.AddInputCoordinate(LatencyInfo::InputCoordinate(102, 202))); EXPECT_EQ(100, latency.trace_id()); EXPECT_TRUE(latency.terminated()); @@ -48,13 +48,11 @@ TEST(LatencyInfoParamTraitsTest, Basic) { output.input_coordinates()[i].y); } - EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, - 1234, + EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 1234, nullptr)); LatencyInfo::LatencyComponent rwh_comp; - EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, - 1234, + EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 1234, &rwh_comp)); EXPECT_EQ(100, rwh_comp.sequence_number); EXPECT_EQ(1u, rwh_comp.event_count); diff --git a/ui/events/latency_info.cc b/ui/latency_info/latency_info.cc similarity index 81% rename from ui/events/latency_info.cc rename to ui/latency_info/latency_info.cc index b5d99547465c4d..66e374838aa0ab 100644 --- a/ui/events/latency_info.cc +++ b/ui/latency_info/latency_info.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" #include @@ -20,7 +20,9 @@ namespace { const size_t kMaxLatencyInfoNumber = 100; const char* GetComponentName(ui::LatencyComponentType type) { -#define CASE_TYPE(t) case ui::t: return #t +#define CASE_TYPE(t) \ + case ui::t: \ + return #t switch (type) { CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); CASE_TYPE(LATENCY_BEGIN_SCROLL_LISTENER_UPDATE_MAIN_COMPONENT); @@ -104,8 +106,7 @@ LatencyInfoTracedValue::FromValue(std::unique_ptr value) { new LatencyInfoTracedValue(value.release())); } -LatencyInfoTracedValue::~LatencyInfoTracedValue() { -} +LatencyInfoTracedValue::~LatencyInfoTracedValue() {} void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const { std::string tmp; @@ -114,32 +115,28 @@ void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const { } LatencyInfoTracedValue::LatencyInfoTracedValue(base::Value* value) - : value_(value) { -} + : value_(value) {} const char kTraceCategoriesForAsyncEvents[] = "benchmark,latencyInfo"; struct LatencyInfoEnabledInitializer { - LatencyInfoEnabledInitializer() : - latency_info_enabled(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( - kTraceCategoriesForAsyncEvents)) { - } + LatencyInfoEnabledInitializer() + : latency_info_enabled(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( + kTraceCategoriesForAsyncEvents)) {} const unsigned char* latency_info_enabled; }; static base::LazyInstance::Leaky - g_latency_info_enabled = LAZY_INSTANCE_INITIALIZER; + g_latency_info_enabled = LAZY_INSTANCE_INITIALIZER; } // namespace namespace ui { -LatencyInfo::InputCoordinate::InputCoordinate() : x(0), y(0) { -} +LatencyInfo::InputCoordinate::InputCoordinate() : x(0), y(0) {} -LatencyInfo::InputCoordinate::InputCoordinate(float x, float y) : x(x), y(y) { -} +LatencyInfo::InputCoordinate::InputCoordinate(float x, float y) : x(x), y(y) {} LatencyInfo::LatencyInfo() : input_coordinates_size_(0), @@ -162,8 +159,7 @@ bool LatencyInfo::Verify(const std::vector& latency_info, LOG(ERROR) << referring_msg << ", LatencyInfo vector size " << latency_info.size() << " is too big."; TRACE_EVENT_INSTANT1("input,benchmark", "LatencyInfo::Verify Fails", - TRACE_EVENT_SCOPE_GLOBAL, - "size", latency_info.size()); + TRACE_EVENT_SCOPE_GLOBAL, "size", latency_info.size()); return false; } return true; @@ -173,11 +169,9 @@ void LatencyInfo::CopyLatencyFrom(const LatencyInfo& other, LatencyComponentType type) { for (const auto& lc : other.latency_components()) { if (lc.first.first == type) { - AddLatencyNumberWithTimestamp(lc.first.first, - lc.first.second, - lc.second.sequence_number, - lc.second.event_time, - lc.second.event_count); + AddLatencyNumberWithTimestamp( + lc.first.first, lc.first.second, lc.second.sequence_number, + lc.second.event_time, lc.second.event_count); } } } @@ -185,11 +179,9 @@ void LatencyInfo::CopyLatencyFrom(const LatencyInfo& other, void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) { for (const auto& lc : other.latency_components()) { if (!FindLatency(lc.first.first, lc.first.second, NULL)) { - AddLatencyNumberWithTimestamp(lc.first.first, - lc.first.second, - lc.second.sequence_number, - lc.second.event_time, - lc.second.event_count); + AddLatencyNumberWithTimestamp( + lc.first.first, lc.first.second, lc.second.sequence_number, + lc.second.event_time, lc.second.event_count); } } } @@ -243,12 +235,9 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl( // not when we actually issue the ASYNC_BEGIN trace event. LatencyComponent begin_component; int64_t ts = 0; - if (FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, - 0, + if (FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, &begin_component) || - FindLatency(INPUT_EVENT_LATENCY_UI_COMPONENT, - 0, - &begin_component)) { + FindLatency(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, &begin_component)) { ts = begin_component.event_time.ToInternalValue(); } else { ts = base::TimeTicks::Now().ToInternalValue(); @@ -262,17 +251,13 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl( } TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0( - kTraceCategoriesForAsyncEvents, - trace_name_.c_str(), - TRACE_ID_DONT_MANGLE(trace_id_), - ts); + kTraceCategoriesForAsyncEvents, trace_name_.c_str(), + TRACE_ID_DONT_MANGLE(trace_id_), ts); } - TRACE_EVENT_WITH_FLOW1("input,benchmark", - "LatencyInfo.Flow", + TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(trace_id_), - TRACE_EVENT_FLAG_FLOW_OUT, - "trace_id", trace_id_); + TRACE_EVENT_FLAG_FLOW_OUT, "trace_id", trace_id_); } LatencyMap::key_type key = std::make_pair(component, id); @@ -281,15 +266,15 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl( LatencyComponent info = {component_sequence_number, time, event_count}; latency_components_[key] = info; } else { - it->second.sequence_number = std::max(component_sequence_number, - it->second.sequence_number); + it->second.sequence_number = + std::max(component_sequence_number, it->second.sequence_number); uint32_t new_count = event_count + it->second.event_count; if (event_count > 0 && new_count != 0) { // Do a weighted average, so that the new event_time is the average of // the times of events currently in this structure with the time passed // into this method. - it->second.event_time += (time - it->second.event_time) * event_count / - new_count; + it->second.event_time += + (time - it->second.event_time) * event_count / new_count; it->second.event_count = new_count; } } @@ -300,15 +285,13 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl( terminated_ = true; if (*latency_info_enabled) { - TRACE_EVENT_COPY_ASYNC_END2(kTraceCategoriesForAsyncEvents, - trace_name_.c_str(), - TRACE_ID_DONT_MANGLE(trace_id_), - "data", AsTraceableData(), - "coordinates", CoordinatesAsTraceableData()); + TRACE_EVENT_COPY_ASYNC_END2( + kTraceCategoriesForAsyncEvents, trace_name_.c_str(), + TRACE_ID_DONT_MANGLE(trace_id_), "data", AsTraceableData(), + "coordinates", CoordinatesAsTraceableData()); } - TRACE_EVENT_WITH_FLOW0("input,benchmark", - "LatencyInfo.Flow", + TRACE_EVENT_WITH_FLOW0("input,benchmark", "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(trace_id_), TRACE_EVENT_FLAG_FLOW_IN); } @@ -323,11 +306,9 @@ LatencyInfo::AsTraceableData() { new base::DictionaryValue()); component_info->SetDouble("comp_id", static_cast(lc.first.second)); component_info->SetDouble( - "time", - static_cast(lc.second.event_time.ToInternalValue())); + "time", static_cast(lc.second.event_time.ToInternalValue())); component_info->SetDouble("count", lc.second.event_count); - component_info->SetDouble("sequence_number", - lc.second.sequence_number); + component_info->SetDouble("sequence_number", lc.second.sequence_number); record_data->Set(GetComponentName(lc.first.first), std::move(component_info)); } @@ -351,8 +332,8 @@ LatencyInfo::CoordinatesAsTraceableData() { bool LatencyInfo::FindLatency(LatencyComponentType type, int64_t id, LatencyComponent* output) const { - LatencyMap::const_iterator it = latency_components_.find( - std::make_pair(type, id)); + LatencyMap::const_iterator it = + latency_components_.find(std::make_pair(type, id)); if (it == latency_components_.end()) return false; if (output) diff --git a/ui/events/latency_info.dot b/ui/latency_info/latency_info.dot similarity index 100% rename from ui/events/latency_info.dot rename to ui/latency_info/latency_info.dot diff --git a/ui/latency_info/latency_info.gyp b/ui/latency_info/latency_info.gyp new file mode 100644 index 00000000000000..ce7f05f764607c --- /dev/null +++ b/ui/latency_info/latency_info.gyp @@ -0,0 +1,46 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'targets': [ + { + # GN version: //ui/latency_info:latency_info + 'target_name': 'latency_info', + 'type': '<(component)', + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base', + ], + 'defines': [ + 'LATENCY_INFO_IMPLEMENTATION', + ], + 'sources': [ + 'latency_info.cc', + 'latency_info.h', + 'latency_info_export.h', + ], + }, + { + # GN version: //ui/latency_info/ipc:latency_info_ipc + 'target_name': 'latency_info_ipc', + 'type': '<(component)', + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/ipc/ipc.gyp:ipc', + 'latency_info', + ], + 'defines': [ + 'LATENCY_INFO_IPC_IMPLEMENTATION', + ], + 'sources': [ + 'ipc/latency_info_ipc_export.h', + 'ipc/latency_info_param_traits.cc', + 'ipc/latency_info_param_traits.h', + 'ipc/latency_info_param_traits_macros.h', + ], + }, + ], +} diff --git a/ui/events/latency_info.h b/ui/latency_info/latency_info.h similarity index 96% rename from ui/events/latency_info.h rename to ui/latency_info/latency_info.h index 22e1ab4ecfea36..880b4adf968569 100644 --- a/ui/events/latency_info.h +++ b/ui/latency_info/latency_info.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_EVENTS_LATENCY_INFO_H_ -#define UI_EVENTS_LATENCY_INFO_H_ +#ifndef UI_LATENCY_INFO_LATENCY_INFO_H_ +#define UI_LATENCY_INFO_LATENCY_INFO_H_ #include @@ -15,7 +15,7 @@ #include "base/containers/small_map.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" -#include "ui/events/events_base_export.h" +#include "ui/latency_info/latency_info_export.h" #if !defined(OS_IOS) #include "ipc/ipc_param_traits.h" // nogncheck @@ -97,10 +97,10 @@ enum LatencyComponentType { // but the swap failed. INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, LATENCY_COMPONENT_TYPE_LAST = - INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, + INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, }; -class EVENTS_BASE_EXPORT LatencyInfo { +class LATENCY_INFO_EXPORT LatencyInfo { public: struct LatencyComponent { // Nondecreasing number that can be used to determine what events happened @@ -113,7 +113,7 @@ class EVENTS_BASE_EXPORT LatencyInfo { uint32_t event_count; }; - struct EVENTS_BASE_EXPORT InputCoordinate { + struct LATENCY_INFO_EXPORT InputCoordinate { InputCoordinate(); InputCoordinate(float x, float y); @@ -130,7 +130,8 @@ class EVENTS_BASE_EXPORT LatencyInfo { // component info. typedef base::SmallMap< std::map, LatencyComponent>, - kTypicalMaxComponentsPerLatencyInfo> LatencyMap; + kTypicalMaxComponentsPerLatencyInfo> + LatencyMap; LatencyInfo(); LatencyInfo(const LatencyInfo& other); @@ -240,4 +241,4 @@ class EVENTS_BASE_EXPORT LatencyInfo { } // namespace ui -#endif // UI_EVENTS_LATENCY_INFO_H_ +#endif // UI_LATENCY_INFO_LATENCY_INFO_H_ diff --git a/ui/latency_info/latency_info_export.h b/ui/latency_info/latency_info_export.h new file mode 100644 index 00000000000000..864c9660d93434 --- /dev/null +++ b/ui/latency_info/latency_info_export.h @@ -0,0 +1,29 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_LATENCY_INFO_LATENCY_INFO_EXPORT_H_ +#define UI_LATENCY_INFO_LATENCY_INFO_EXPORT_H_ + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(LATENCY_INFO_IMPLEMENTATION) +#define LATENCY_INFO_EXPORT __declspec(dllexport) +#else +#define LATENCY_INFO_EXPORT __declspec(dllimport) +#endif // defined(LATENCY_INFO_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(LATENCY_INFO_IMPLEMENTATION) +#define LATENCY_INFO_EXPORT __attribute__((visibility("default"))) +#else +#define LATENCY_INFO_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define LATENCY_INFO_EXPORT +#endif + +#endif // UI_LATENCY_INFO_LATENCY_INFO_EXPORT_H_ diff --git a/ui/events/latency_info_unittest.cc b/ui/latency_info/latency_info_unittest.cc similarity index 98% rename from ui/events/latency_info_unittest.cc rename to ui/latency_info/latency_info_unittest.cc index e27986397eabd8..1d17863a7d4ac9 100644 --- a/ui/events/latency_info_unittest.cc +++ b/ui/latency_info/latency_info_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/events/latency_info.h" +#include "ui/latency_info/latency_info.h" #include diff --git a/ui/latency_info/latency_info_unittests.gyp b/ui/latency_info/latency_info_unittests.gyp new file mode 100644 index 00000000000000..d2c9d54b8fcdc5 --- /dev/null +++ b/ui/latency_info/latency_info_unittests.gyp @@ -0,0 +1,33 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'targets': [ + { + # GN version: //ui/latency_info:latency_info_unittests + 'target_name': 'latency_info_unittests', + 'type': '<(gtest_target_type)', + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/base/base.gyp:run_all_unittests', + '<(DEPTH)/base/base.gyp:test_support_base', + '<(DEPTH)/ipc/ipc.gyp:test_support_ipc', + '<(DEPTH)/testing/gtest.gyp:gtest', + 'latency_info.gyp:latency_info', + 'latency_info.gyp:latency_info_ipc', + ], + 'sources': [ + # Note: sources list duplicated in GN build. + 'latency_info_unittest.cc', + 'ipc/latency_info_param_traits_unittest.cc', + ], + 'include_dirs': [ + '../../testing/gmock/include', + ], + }, + ], +} diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index 5b85b89b3cfe64..f88fe268bdbbcc 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn @@ -34,6 +34,7 @@ component("views") { "//skia", "//third_party/icu", "//ui/accessibility", + "//ui/latency_info", "//ui/native_theme", "//ui/resources", "//ui/strings", diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 43f4ac31194308..837d206dff4efe 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp @@ -671,6 +671,7 @@ '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', '../gfx/gfx.gyp:gfx_vector_icons', + '../latency_info/latency_info.gyp:latency_info', '../native_theme/native_theme.gyp:native_theme', '../resources/ui_resources.gyp:ui_resources', '../strings/ui_strings.gyp:ui_strings',